Files
lotherk 9558ad4f07 www: the pages in the voice of docs/reference/website-voice.txt, license.html, new pictures
license.html carries the CNCL and the table of docs/LICENSES.md and is linked
from every page and the guide's template; shot-bar and shot-dtchat are used
by desktop.html and index.html (every href/src of www/*.html resolves).  The
guide no longer announces a photo editor (dtphoto exists).
2026-11-17 16:39:44 +00:00

2578 lines
128 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!-- License: CNCL 1.0 (Could Not Care Less), see LICENSE at the top of the tree. -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content="The Makronix Guide: installation, MCDE, administration, networking and building.">
<title>The Makronix Guide</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="window">
<div class="titlebar">The Makronix Guide</div>
<div class="menubar">
<a href="index.html">Home</a>
<a href="features.html">Features</a>
<a href="download.html">Download</a>
<a href="install.html">Install</a>
<a href="upgrade.html">Upgrade</a>
<a href="desktop.html">Desktop</a>
<a href="guide.html" class="here">Guide</a>
<a href="source.html">Source</a>
<a href="license.html">License</a>
</div>
<div class="content guide">
<div class="guide-head">
<img src="img/makronix.png" width="380" height="140" alt="Makronix -- based on NetBSD">
<h1 class="guide-title">The Makronix Guide</h1>
<p class="guide-subtitle">A guide to the Makronix operating system and
the MCDE desktop</p>
<p class="guide-edition">Makronix 0.99.10 (Camouflage) -- November
2026</p>
</div>
<div class="guide-toc">
<h2>Contents</h2>
<ul>
<li><a href="#preface" id="toc-preface">Preface</a></li>
<li><a href="#what" id="toc-what">What Makronix Is</a></li>
<li><a href="#tour" id="toc-tour">A Tour of the System</a></li>
<li><a href="#before-install" id="toc-before-install">Before You
Install</a></li>
<li><a href="#install" id="toc-install">Installing Makronix</a></li>
<li><a href="#vm" id="toc-vm">Installing in a Virtual Machine</a></li>
<li><a href="#upgrade" id="toc-upgrade">Upgrading Makronix</a></li>
<li><a href="#mcde" id="toc-mcde">MCDE: The Desktop</a></li>
<li><a href="#x11" id="toc-x11">The Display and X11</a></li>
<li><a href="#dtinfo" id="toc-dtinfo">The Information Manager</a></li>
<li><a href="#shell" id="toc-shell">The Command Line</a></li>
<li><a href="#rc" id="toc-rc">Services and rc.d</a></li>
<li><a href="#users" id="toc-users">Users and Accounts</a></li>
<li><a href="#disks" id="toc-disks">Disks and Filesystems</a></li>
<li><a href="#pkgsrc" id="toc-pkgsrc">Packages and pkgsrc</a></li>
<li><a href="#printing" id="toc-printing">Printing, Sound and
Power</a></li>
<li><a href="#network" id="toc-network">Networking</a></li>
<li><a href="#services" id="toc-services">DNS, DHCP and NTP</a></li>
<li><a href="#sharing" id="toc-sharing">Remote Access and File
Sharing</a></li>
<li><a href="#firewall" id="toc-firewall">The Firewall</a></li>
<li><a href="#mailweb" id="toc-mailweb">Mail and the Web</a></li>
<li><a href="#building" id="toc-building">Building Makronix</a></li>
<li><a href="#cross" id="toc-cross">Cross-Building and the Source
Tree</a></li>
<li><a href="#updating" id="toc-updating">Updating the Desktop</a></li>
<li><a href="#help" id="toc-help">Appendix A: Getting Help</a></li>
<li><a href="#glossary" id="toc-glossary">Appendix B: Glossary</a></li>
<li><a href="#license" id="toc-license">Appendix C: Licence and
Sources</a></li>
</ul>
</div>
<h1 id="preface">Preface</h1>
<p>This is the guide to Makronix, a desktop operating system built on
NetBSD. It is written for the person who installs the system, uses the
MCDE desktop and administers the machine afterwards. It is not a
replacement for the manual pages; it tells you which page to read and in
which order.</p>
<p>Makronix is opinionated. It decides what NetBSD leaves open: the
installer, the desktop, the packages on the medium, and the way a
release is made. This guide is opinionated in the same way. It says what
the system is, what it does, and where it stops; when a detail belongs
to NetBSD, it names the NetBSD text instead of repeating it badly.</p>
<h2 id="preface-shape">The shape of this guide</h2>
<p>The guide follows the shape of The NetBSD Guide: a tour,
installation, the desktop, administration, networking and building, with
the same assumption that a system is something you understand rather
than something you click through. It is not a copy. The Makronix parts
are written for this system, and where NetBSD's guide has a chapter for
a subsystem Makronix does not change, this guide names the manual pages
and the NetBSD text instead of repeating them.</p>
<p>That is a deliberate limit. A guide that repeats every NetBSD chapter
would be out of date the moment NetBSD changes it, and it would hide the
parts that are actually Makronix's. What is here is the system as it is
installed: the decisions, the files, the commands and the reasons. The
rest is NetBSD, and NetBSD documents it.</p>
<h2 id="preface-how-to-read">How to read it</h2>
<p>Read <a href="#what">What Makronix Is</a> first, then <a
href="#install">Installing Makronix</a> if the system is new. The
chapters about the desktop (<a href="#mcde">MCDE: The Desktop</a>, <a
href="#x11">The Display and X11</a> and <a href="#dtinfo">The
Information Manager</a>) are for everybody; the administration chapters
are reference material. The last part is for the person who builds
Makronix from its own sources.</p>
<p>Commands are shown as they are typed. A <code>#</code> at the
beginning means the command runs as root; a <code>$</code> means it runs
as your own account. File names are in <code>this style</code>, commands
in <code>this style</code>, and values you replace in &lt;this
style&gt;.</p>
<p>The guide does not assume that you have used a Unix system before,
but it does assume that you are willing to read. A chapter that says
“see the manual page” means it: the page is installed, it is short, and
it was written by the people who wrote the program.</p>
<h2 id="preface-forms">The guide in five forms</h2>
<p>The same text is installed five ways, so that it is readable where
you are:</p>
<ul>
<li><p>as manual pages, starting at <code
class="citerefentry">makronix-guide(7)</code>;</p></li>
<li><p>as a PDF,
<code>/usr/share/doc/makronix/makronix-guide.pdf</code>;</p></li>
<li><p>as one HTML file,
<code>/usr/share/doc/makronix/makronix-guide.html</code>;</p></li>
<li><p>as a page of the Makronix website,
<code>guide.html</code>;</p></li>
<li><p>as a book in the MCDE Information Manager (<code
class="citerefentry">dtinfo(1)</code>).</p></li>
</ul>
<p>They are generated from one source, <code>docs/guide/book.xml</code>
in the source tree. There is no second text to keep in step: a change to
a chapter reaches all five forms, or none of them.</p>
<h2 id="preface-conventions">Conventions</h2>
<p>Makronix is based on NetBSD, and much of what this guide describes is
NetBSD's mechanism, unchanged. When a chapter says “NetBSD”, it means
the mechanism Makronix inherited; when it says “Makronix”, it means the
part Makronix decides itself. Where a procedure differs between the two,
the chapter gives the Makronix way first.</p>
<p>The version this guide describes is Makronix 0.99.10, release name
“Camouflage”. A later release can change a path, a menu or a default;
the source tree is the last word, and the release notes name what
changed.</p>
<h2 id="preface-licence">The licence: the CNCL 1.0</h2>
<p>Makronix's own files — the tools, the configuration, this guide and
the text you are reading — are under the CNCL 1.0, the Could Not Care
Less License. The full text is in <a href="#license-makronix">Makronix:
the CNCL 1.0</a> and in the file <code>LICENSE</code> at the top of the
source tree. It is short enough to read in a minute, and this section
explains what it means in plain words. If the two ever disagree, the
text in the appendix is the licence; this section is only an
introduction.</p>
<p>The CNCL is not a carefully balanced legal instrument. It is a
statement of intent written as a licence, and its intent is in its name.
The preamble says that software is the product of collective human
knowledge, that every idea builds on ideas that came before, and that
the authors do not believe in artificial boundaries around creativity.
It says that creating something does not give the author the moral
authority to dictate what others may do with it. Then the licence does
what that preamble promises: it gets out of the way.</p>
<p>In plain words, the CNCL says:</p>
<ul>
<li><p><em>Do whatever you want with it.</em> Use it, copy it, modify
it, break it, fix it, sell it, give it away, incorporate it into
something else, release it under another licence. Use it commercially or
personally. The licence names all of that.</p></li>
<li><p><em>You owe the author nothing.</em> No attribution, no
royalties, no source disclosure, no reciprocal licensing, no
contribution, no permission. You do not have to publish your changes;
you do not have to keep them private either. You do not have to
ask.</p></li>
<li><p><em>There is no warranty.</em> The software is provided “AS IS”,
without warranty of any kind. The authors accept no responsibility for
its use, misuse, modification, distribution or consequences. That is the
whole disclaimer, and it is meant literally.</p></li>
</ul>
<p>The name is not a joke about quality. It is a joke about ownership.
The authors could not care less what you do with the work, because they
do not believe that making something gives them a claim on what happens
next. The licence is permissive in the extreme: it is not a copyleft, it
does not ask for a contribution back, and it does not try to keep the
work in a particular community. If you improve this guide and sell it,
the CNCL is happy. If you print it, translate it, put it on a website or
feed it to a machine, the CNCL is happy. If you never look at it again,
the CNCL is happy too.</p>
<p>What the CNCL does <em>not</em> cover is just as important. Makronix
is built from other people's work, and that work keeps its own
licence:</p>
<ul>
<li><p><em>NetBSD</em> is under the BSD licence. The kernel, the
userland and the parts of this guide that follow The NetBSD Guide keep
the NetBSD copyright and the BSD terms. The CNCL does not replace them,
and this guide does not relicense them. Appendix C names the
source.</p></li>
<li><p><em>CDE and MCDE</em> are under the GNU Lesser General Public
License, version 2 or later. MCDE is a fork of CDE; the fork keeps the
licence of the work it came from.</p></li>
<li><p><em>pkgsrc packages</em> keep their own licences, which are as
different as the packages themselves. The package's message and its
<code>LICENSE</code> file say which one applies.</p></li>
<li><p><em>The Hack font</em> is under the MIT licence, and the DocBook
DTD is under the OASIS licence. They are tools of the guide, not parts
of the Makronix text.</p></li>
</ul>
<p>So the rule is simple: if a file carries the CNCL line, the CNCL
applies to that file. If it carries another notice, that notice applies.
A file can contain both kinds of material, and then both notices apply
to their parts. This guide is such a file: the Makronix text is CNCL,
the structure and the general NetBSD procedures are credited to The
NetBSD Guide, and the appendix keeps the NetBSD notice next to the CNCL
text.</p>
<p>Why this licence, and not a longer one? Because Makronix is
opinionated about the system, not about the person using it. The project
wants to decide how the installer behaves, what the desktop looks like
and what a release contains; it does not want to decide what you may do
with the result. A licence that requires a lawyer to read would
contradict the rest of the project. The CNCL is short because the
project's claim is short: here is the work, do what you like, do not
blame us.</p>
<p>It also fits the way the system is built. Makronix stands on NetBSD,
on CDE, on pkgsrc and on a long history of Unix ideas. The CNCL preamble
says that plainly: everything created is built on something that existed
before. The licence is an attempt to act like it. It does not claim
ownership of the collective intelligence the system is made of; it adds
one more layer and lets the next person take it further.</p>
<p>For this guide specifically, the CNCL means you can copy it, put it
on a wall, translate it, cut it up, publish a changed version, or sell
it without asking. You do not have to credit Makronix for the Makronix
text, although the NetBSD-derived parts keep their notice. If you change
the guide, you do not have to say what you changed; a reader would still
appreciate it. And if the guide is wrong, the authors are not liable:
the system is provided as it is, and the guide describes it as well as
the authors could.</p>
<p>That last point is not a loophole to hide behind. It is the other
half of the same idea: no control, and no promise of control. The guide
tries to be accurate, the tests try to prove it, and the source is open
so that you can check. But the CNCL does not turn the authors into a
support desk, and it does not turn a mistake in this text into a
contractual obligation. Read the commands before you run them; keep a
backup; the machine is yours.</p>
<h2 id="preface-made">How this guide was made</h2>
<p>The guide is written in DocBook XML. One file,
<code>docs/guide/book.xml</code>, includes one file per chapter from
<code>docs/guide/chapters/</code>. A single build script turns that
source into the five forms: the manual pages with pandoc, the HTML with
the site's stylesheet, the PDF by printing the HTML with a headless
browser, and the MCDE information library with MCDE's own
<code>dtdocbook2infolib</code>. The website form is the same text in the
site's window; the system HTML form is one self-contained file with the
logo and the colours in it.</p>
<p>The source and the build are in the source tree, under
<code>docs/guide</code>. The generated forms are installed as part of
the system and are also in the tree, so that a release does not need a
browser, a DocBook toolchain or an MCDE host build to package them.
<code>docs/guide/AGENTS.md</code> describes the build.</p>
<p>The structure, the order of the parts and the general NetBSD
procedures come from The NetBSD Guide, Copyright (c) 1998-2026 The
NetBSD Foundation, Inc., under the BSD 2-clause licence. The Makronix
text, the MCDE chapters and the five output forms are Makronix's.
Appendix C has the full attribution.</p>
<h2 id="preface-not">What is not in this guide</h2>
<p>A guide that promises everything is a guide that lies. This one does
not cover the internals of the NetBSD kernel, the details of every
filesystem, the configuration of every server, or the history of Unix.
It covers the system Makronix installs and the decisions Makronix makes.
When a question goes deeper, the manual pages and The NetBSD Guide are
the next places to look; <a href="#help">Appendix A: Getting Help</a>
says how to find them.</p>
<p>The same is true of the desktop: MCDE is a large program, and this
guide describes what a person needs to use it, not every resource and
every configuration file. The manual pages and the source are there for
the rest.</p>
<h1 id="what">What Makronix Is</h1>
<p>Makronix is a complete operating system for the desktop: a kernel, a
userland, a graphical login, a desktop and the programs that make a
machine usable, installed together and updated together. It is built on
NetBSD, uses NetBSD's conventions and keeps NetBSD's manual pages, so a
person who knows NetBSD will find the system familiar. What Makronix
decides is everything NetBSD leaves open.</p>
<h2 id="what-netbsd">NetBSD underneath</h2>
<p>The kernel, the C library, the userland and the build system are
NetBSD's. Makronix tracks NetBSD's source tree directly; there is no
patch layer between the two. The boot loader, <code>/etc/rc.conf</code>,
the package tools and the section 8 manual pages are the ones NetBSD
documents.</p>
<p>The kernel still calls itself “NetBSD” in <code
class="citerefentry">uname(1)</code>, on purpose: pkgsrc,
<code>config.guess</code> and a great deal of third-party software
decide from that name which system they are on. The product name
“Makronix 0.99.10” is what the installer, the login screen, the message
of the day and the release notes call the system.</p>
<h2 id="what-decided">What Makronix decides</h2>
<p>Four decisions turn NetBSD into Makronix:</p>
<ul>
<li><p><em>The installer.</em> Makronix's <code
class="citerefentry">sysinst(8)</code> has two ways. The simple way asks
for the disk and whether it is encrypted, then installs everything, then
asks the questions a new computer needs — its name, the network, the
time zone, the administrator's password and the first account — before
the first reboot. The full way is the NetBSD installation,
unchanged.</p></li>
<li><p><em>The desktop.</em> MCDE, the Makronix Common Desktop
Environment, is a fork of CDE. It starts at <code
class="citerefentry">dtlogin(1)</code>, uses Motif, and is designed to
be quick on a machine from the 1990s. It is described in <a
href="#mcde">MCDE: The Desktop</a>.</p></li>
<li><p><em>The packages on the medium.</em> The programs that Makronix
ships are on the installation medium, in the “makronix” set and in the
repository next to it. A machine is usable without a network
connection.</p></li>
<li><p><em>The source set.</em> The medium also carries the sources —
NetBSD's source sets and the Makronix source set — so that the system
can rebuild itself offline. The procedure is in <a
href="#building">Building Makronix</a>.</p></li>
</ul>
<h2 id="what-release">The release and its name</h2>
<p>This guide describes Makronix 0.99.10, whose release name is
“Camouflage”. Release names are CDE palette names, and a release looks
like its palette: the logo, the icon set, the installer colours and the
desktop colours come from it. The palette is installed as
<code>/usr/pkg/dt/share/palettes/Camouflage.dp</code>.</p>
<p>0.99.10 is a snapshot, not a long-term release. Install it on a
machine whose data you have elsewhere, and read the release notes on the
installation medium before you start.</p>
<h2 id="what-platforms">Platforms</h2>
<p>amd64 is the first target and the one the build tests on every
change, in QEMU with BIOS and UEFI and on a 2011 MacBook Pro. PowerPC
Macs (G3, G4 and G5) and 64-bit ARM machines (Raspberry Pi 4, ODROID-N2,
ODROID-M1) are the next targets; a platform counts as supported only
when an installation from its medium reaches a login prompt. The
measured state of each platform is in
<code>/usr/src/docs/PLATFORMS.md</code> in the source set.</p>
<h2 id="what-license">Licence</h2>
<p>Makronix's own text and tools are under the CNCL 1.0 (Could Not Care
Less), a licence that asks only that you do not blame the authors.
NetBSD's source keeps its BSD licence, MCDE keeps the CDE licence (LGPL
2.0 or later), and pkgsrc packages keep their own licences. Appendix C
lists the details.</p>
<h1 id="tour">A Tour of the System</h1>
<p>Before you change anything, know where things are. Makronix uses
NetBSD's layout; the Makronix parts sit in the places CDE and pkgsrc
already use.</p>
<h2 id="tour-filesystem">The file system</h2>
<dl>
<dt><code>/</code></dt>
<dd>
<p>The root file system: the kernel (<code>/netbsd</code>), the boot
loader and the base userland.</p>
</dd>
<dt><code>/etc</code></dt>
<dd>
<p>The configuration of this machine: <code>rc.conf</code>,
<code>fstab</code>, <code>master.passwd</code>, the network
configuration and the <code>rc.d</code> scripts. Files here belong to
the administrator, not to a package.</p>
</dd>
<dt><code>/usr</code></dt>
<dd>
<p>The base system's programs, libraries, headers, manual pages and
shared files. <code>/usr/src</code> holds the whole source tree when the
source set is installed: the NetBSD sources under
<code>/usr/src/src</code>, X under <code>/usr/src/xsrc</code> and pkgsrc
under <code>/usr/src/pkgsrc</code>.</p>
</dd>
<dt><code>/usr/pkg</code></dt>
<dd>
<p>Everything pkgsrc installs. The programs are in
<code>/usr/pkg/bin</code> and <code>/usr/pkg/sbin</code>; the MCDE
desktop is in <code>/usr/pkg/dt</code>. The package database is
<code>/usr/pkg/pkgdb</code>.</p>
</dd>
<dt><code>/home</code></dt>
<dd>
<p>One directory per user. A new account gets
<code>/home/</code>&lt;name&gt; and the files from
<code>/etc/skel</code>.</p>
</dd>
<dt><code>/var</code></dt>
<dd>
<p>Data that changes: logs in <code>/var/log</code>, mail spools,
databases, the package cache and the print spool.</p>
</dd>
</dl>
<h2 id="tour-mcde">Where MCDE lives</h2>
<p>MCDE is installed as a package under <code>/usr/pkg/dt</code>. The
programs are in <code>/usr/pkg/dt/bin</code>; the shared data, the
palettes and the colors are in <code>/usr/pkg/dt/share</code>; the
session configuration is in <code>/usr/pkg/dt/config</code>. A user's
own desktop settings live in <code>~/.dt</code>.</p>
<p>The system-wide CDE configuration directory is <code>/etc/dt</code>.
It is the place for settings that apply to every user, and it is where
the Makronix Guide's information library is installed (see <a
href="#dtinfo">The Information Manager</a>).</p>
<h2 id="tour-config">The files you will edit</h2>
<ul>
<li><p><code>/etc/rc.conf</code> — which services start at boot. The
variables are documented in <code
class="citerefentry">rc.conf(5)</code>.</p></li>
<li><p><code>/etc/fstab</code> — which file systems are mounted
where.</p></li>
<li><p><code>/etc/hosts</code>, <code>/etc/resolv.conf</code> and
<code>/etc/mygate</code> — the network, as in NetBSD.</p></li>
<li><p><code>/etc/npf.conf</code> — the firewall. Makronix installs a
rule set that lets in SSH and the replies to outgoing traffic.</p></li>
<li><p><code>/etc/makronix/update</code> — the first line names the
source of software updates.</p></li>
<li><p><code>/etc/dt/config/Xsession.d/</code> — scripts that every MCDE
session runs.</p></li>
</ul>
<h2 id="tour-processes">What runs</h2>
<p>After boot, <code class="citerefentry">init(8)</code> starts the
services named in <code>/etc/rc.conf</code>. On a Makronix desktop the
important ones are:</p>
<ul>
<li><p><code class="citerefentry">dtlogin(1)</code> — the graphical
login screen. It starts the X server and the user's session.</p></li>
<li><p><code class="citerefentry">dtwm(1)</code> — the window manager:
window frames, the front panel and the workspaces.</p></li>
<li><p><code class="citerefentry">dtsession(1)</code> — the session
manager behind the desktop.</p></li>
<li><p><code class="citerefentry">dhcpcd(8)</code> — the DHCP client,
when the network is configured by DHCP.</p></li>
<li><p><code class="citerefentry">ntpd(8)</code> — the time
synchronisation the installer enables.</p></li>
</ul>
<p><code class="citerefentry">ps(1)</code> shows them; <code
class="citerefentry">top(1)</code> shows what they use. A process that
fails at boot leaves its reason in <code>/var/log/messages</code> and,
for a service, in the console output of <code>rc.d</code>.</p>
<h2 id="tour-documentation">Documentation on the machine</h2>
<p>The manual pages are installed in the usual sections. Start with
<code class="citerefentry">afterboot(8)</code>, then read the page for
the program you are using. The Makronix Guide itself is <code
class="citerefentry">makronix-guide(7)</code>; each chapter has its own
page, and the guide is also installed as a PDF and as HTML under
<code>/usr/share/doc/makronix</code>.</p>
<p>When a page does not answer the question, the source is the last
word. The source set puts the whole tree in <code>/usr/src</code>: the
NetBSD sources under <code>/usr/src/src</code>, X under
<code>/usr/src/xsrc</code>, pkgsrc under <code>/usr/src/pkgsrc</code>,
and Makronix's own tools and documentation at the top of the tree.</p>
<h1 id="before-install">Before You Install</h1>
<p>An installation replaces what is on the disk you choose. Read this
chapter with the machine in front of you, and do not start until the
data you need is somewhere else.</p>
<h2 id="before-hardware">The machine</h2>
<p>amd64 is the platform this release is tested on. The USB image is 10
GiB; give the system at least 12 GiB, and considerably more if you want
the source set on the same disk. A machine with 2 GiB of memory runs the
installer and the desktop; 4 GiB or more make the desktop
comfortable.</p>
<p>The USB image starts on UEFI machines and, through the protective
MBR, on BIOS-only machines. A Mac needs its firmware boot menu: hold
<code>Option</code> while the machine starts and choose the stick. The
DVD and the CDs start through the normal firmware boot order.</p>
<h2 id="before-media">The media</h2>
<p>A Makronix release is more than one image:</p>
<ul>
<li><p>the <em>USB image</em> or the <em>DVD</em>, which carry the
system and the “makronix” set;</p></li>
<li><p><em>CD 1</em>, which carries the system and starts the
installer;</p></li>
<li><p><em>CD 2</em>, which carries the “makronix” set (the desktop and
its programs);</p></li>
<li><p><em>CD 3</em>, which carries the binary packages (Firefox,
Thunderbird, QEMU, the games).</p></li>
</ul>
<p>The installer asks for the next CD when it needs one. A DVD or a USB
stick carries everything and asks for nothing. The source set is on the
DVD and on the USB image when it was built with
<code>make sourcesets</code>; the installed system can also fetch it
later.</p>
<h2 id="before-usb">Writing a USB stick</h2>
<p>Write the image to the whole device, not to a partition. On NetBSD,
find the device with <code class="citerefentry">dmesg(8)</code> after
inserting the stick; it is usually <code>/dev/rsd0d</code>.</p>
<pre><code># dd if=Makronix-0.99.10-amd64-install.img of=/dev/rsd0d bs=1m conv=sync</code></pre>
<p>On Linux the same operation is:</p>
<pre><code># dd if=Makronix-0.99.10-amd64-install.img of=/dev/sdX bs=4M conv=fsync status=progress</code></pre>
<p>Replace <code>/dev/sdX</code> with the stick, and check the device
name twice: <code>dd</code> does not ask. Afterwards, compare the
checksum of the image with the one published next to it. A stick that
reads back differently at every attempt is defective; the installer will
fail in ways that look like software bugs.</p>
<h2 id="before-answers">The answers the installer needs</h2>
<p>The simple installation asks for the following. Write them down
before you start; the installer does not go back once it has begun.</p>
<dl>
<dt>The disk</dt>
<dd>
<p>The whole disk that will hold Makronix. Every partition on it is
destroyed.</p>
</dd>
<dt>Encryption</dt>
<dd>
<p>Whether the disk is encrypted with <code
class="citerefentry">cgd(4)</code>, and the passphrase. The passphrase
is asked for at every boot and cannot be recovered. A long sentence you
can type is better than a short password.</p>
</dd>
<dt>The computer's name</dt>
<dd>
<p>A short host name, without spaces or dots. The local network name
becomes &lt;name&gt;<code>.local</code>.</p>
</dd>
<dt>The network</dt>
<dd>
<p>Ethernet with DHCP, or a Wi-Fi network and its passphrase. The
installer configures the interface and enables <code
class="citerefentry">dhcpcd(8)</code>.</p>
</dd>
<dt>The time zone</dt>
<dd>
<p>The zone of the place the machine is in, for example
<code>Europe/Berlin</code>.</p>
</dd>
<dt>The administrator's password</dt>
<dd>
<p>The password of root. It is used with <code>su</code>.</p>
</dd>
<dt>Your account</dt>
<dd>
<p>A user name, a full name and a password. The account is put in the
groups that a desktop user needs: wheel (for <code>su</code>), operator,
staff, users, dialer (serial ports), games and wsrc (the source
tree).</p>
</dd>
</dl>
<h2 id="before-backup">Back up, then begin</h2>
<p>Copy the files you need to another machine or an external disk. An
installation does not offer to preserve a partition that it is about to
overwrite. If the machine has another operating system, decide before
the installation whether it is to survive; the full installation way can
keep it, the simple way uses the whole disk.</p>
<h1 id="install">Installing Makronix</h1>
<p>The installer is <code class="citerefentry">sysinst(8)</code>,
Makronix's fork of NetBSD's installer. It has two ways: the simple way,
which decides as much as it can, and the full way, which is NetBSD's
installation with every question. Both install the same system.</p>
<p>If the machine is a virtual one, <a href="#vm">Installing in a
Virtual Machine</a> has the QEMU/KVM and Proxmox VE settings.</p>
<h2 id="install-boot">Starting the installer</h2>
<p>Start the machine from the medium. On a machine with UEFI, choose the
stick or the DVD in the firmware's boot menu; on a Mac, hold
<code>Option</code> while it starts. On a BIOS machine, set the boot
order or press the firmware's boot-menu key. The installer starts from
the medium and runs in memory, so the medium can be removed once the
installation has begun.</p>
<p>The first questions are the language and the keyboard layout. They
apply to the installer only; the installed system gets its keyboard
layout from the desktop settings.</p>
<h2 id="install-simple">The simple way</h2>
<ol style="list-style-type: decimal">
<li><p><em>Choose the installation type.</em> The simple way is the
first choice. The full way is “Install NetBSD” and is described in <a
href="#install-full">The full way</a>.</p></li>
<li><p><em>Choose the disk.</em> The installer lists the disks it found.
Choosing one erases every partition on it. If the machine has more than
one disk, unplug the one you want to keep before you start; that is
safer than reading the list twice.</p></li>
<li><p><em>Decide about encryption.</em> If you say yes, the installer
encrypts the root file system with <code
class="citerefentry">cgd(4)</code> and asks for the passphrase twice.
The passphrase is asked for at every boot. If you say no, the disk is
installed in clear text.</p></li>
<li><p><em>The installer partitions the disk and unpacks the sets.</em>
It installs the base system, the “makronix” set (the desktop and its
programs) and, when the medium carries them, the source sets. It asks
whether to install the games; the default is yes.</p></li>
<li><p><em>Answer the configuration forms.</em> The installer asks for
the computer's name, the network (Ethernet with DHCP, or Wi-Fi and its
passphrase), the time zone, the administrator's password and your
account. These are the answers from <a href="#before-answers">The
answers the installer needs</a>.</p></li>
<li><p><em>Reboot.</em> Remove the medium. The machine starts into <code
class="citerefentry">dtlogin(1)</code>, the MCDE login screen.</p></li>
</ol>
<p>The installer sets up more than the account: SSH is enabled, time
synchronisation is enabled, a firewall (npf) lets in SSH and the replies
to outgoing traffic, and the machine answers to
&lt;name&gt;<code>.local</code> on the local network.</p>
<p><em>Note:</em> the simple way uses the whole disk. It does not
preserve another operating system. If the machine must keep one, use the
full way and partition by hand.</p>
<h2 id="install-full">The full way</h2>
<p>The full way is the NetBSD installation. It asks for the partition
table (MBR or GPT), the NetBSD disklabel, the sets, the network and the
time zone, and it writes the boot blocks. The procedure is the one in
The NetBSD Guide, chapter “Example installation”; the questions and
their meanings are NetBSD's, and the installer's manual page is <code
class="citerefentry">sysinst(8)</code>.</p>
<p>Two Makronix details matter in the full way:</p>
<ul>
<li><p>Choose the “makronix” set as well as the base sets. Without it
there is no desktop, no <code>dtlogin</code> and no MCDE
programs.</p></li>
<li><p>The “Next CD” menu asks for the next medium when a set is not on
the current one. A DVD or a USB image does not need it.</p></li>
</ul>
<h2 id="install-encrypted">An encrypted system</h2>
<p>With encryption, the disk holds one <code>cgd</code> partition with
the root file system, and a small unencrypted partition that the boot
loader can read: the kernel, <code>cgdroot.kmod</code> and
<code>cgd.conf</code>. The loader asks for the passphrase, unlocks the
disk and starts the kernel from the encrypted root.</p>
<p>The unencrypted partition is mounted as <code>/cgdboot</code> (with
“noauto” in <code>/etc/fstab</code>). A kernel update on an encrypted
system is not complete until the new kernel and the matching
<code>cgdroot.kmod</code> are copied to it; <a
href="#upgrade-encrypted">An encrypted system</a> gives the
commands.</p>
<h2 id="install-first-boot">The first boot</h2>
<p>The login screen is MCDE's <code>dtlogin</code>. Log in with the
account you created; the desktop starts with the front panel, the bar at
the top and the workspace controls. <a href="#mcde">MCDE: The
Desktop</a> explains what you are looking at.</p>
<p>Open a terminal and check the machine:</p>
<pre><code>$ ifconfig -a
$ netstat -rn
$ date
$ ps -ax | grep -E &#39;dhcpcd|ntpd|dtlogin&#39;</code></pre>
<p>If the network is not up, <code>dhcpcd</code> can be started by hand;
if the clock is wrong, <code>ntpd</code> needs a reachable server. Both
are services in <code>/etc/rc.conf</code>; see <a href="#rc">Services
and rc.d</a>.</p>
<p>Change the administrator's password and your own with <code
class="citerefentry">passwd(1)</code>. The account is in the wheel
group, so <code>su</code> works; use it for administrative commands, as
the rest of this guide does.</p>
<h2 id="install-trouble">When the installation does not start</h2>
<ul>
<li><p><em>The firmware does not offer the stick.</em> Write the image
again to a different stick and compare its checksum. On a UEFI machine,
disable “Secure Boot” for the installation; on a Mac, the stick must be
formatted by the image, not copied as a file.</p></li>
<li><p><em>The machine starts, then stops with a mount or unpacking
error.</em> The medium is bad or the disk is failing. Check the medium's
checksum and try another disk.</p></li>
<li><p><em>The installed machine does not start.</em> Start from the
medium again and choose the shell, then inspect the disk with
<code>disklabel</code> and mount the root partition by hand. The boot
messages are on the console; <code>dmesg</code> repeats them.</p></li>
</ul>
<h1 id="vm">Installing in a Virtual Machine</h1>
<p>A virtual machine is the cheapest way to try Makronix: no disk is
overwritten, a snapshot is one command away, and the same installer runs
as on real hardware. This chapter gives the settings that matter for
QEMU with KVM and for Proxmox VE. The values are starting points; the
installer is the same as on a physical machine (<a
href="#install">Installing Makronix</a>).</p>
<h2 id="vm-needs">What the VM needs</h2>
<ul>
<li><p><em>KVM.</em> A virtual machine without hardware acceleration
(QEMU's TCG) installs, but slowly. On Linux, <code>/dev/kvm</code> must
exist and your user must be allowed to use it; on Proxmox VE, KVM is the
default.</p></li>
<li><p><em>Memory.</em> 2 GiB installs the system and runs the text
console; 4 GiB make the MCDE desktop comfortable. 8 GiB are useful only
if the guest runs a browser or another VM.</p></li>
<li><p><em>Disk.</em> 32 GiB is a comfortable size for the system, the
desktop and a few packages. The source set needs considerably more; <a
href="#building">Building Makronix</a> explains it.</p></li>
<li><p><em>Firmware.</em> UEFI (OVMF) or BIOS. UEFI is the modern
choice; the installer and the boot loader handle both. For UEFI, give
the VM a writable variable store, not only the read-only firmware
image.</p></li>
<li><p><em>Disk and network devices.</em> VirtIO is the fast choice. The
installer sees a VirtIO block disk as <code>ld0</code>, a SCSI or AHCI
disk as <code>sd0</code>, and an IDE disk as <code>wd0</code>.</p></li>
<li><p><em>A display for the desktop.</em> The graphical installer and
<code>dtlogin</code> need a VGA device. <code>std</code> is the safe
emulation; a serial console is enough for a headless
installation.</p></li>
</ul>
<h2 id="vm-qemu">QEMU and KVM</h2>
<p>Create a disk image first. <code>qemu-img</code> makes a sparse qcow2
file; it grows as the installation writes to it.</p>
<pre><code>qemu-img create -f qcow2 makronix.qcow2 32G</code></pre>
<p>The following command starts a BIOS machine with 4 GiB of memory,
four CPUs, an IDE disk, the DVD image, user-mode networking with SSH
forwarded to port 2222, and a graphical window:</p>
<pre><code>qemu-system-x86_64 -enable-kvm -cpu host -smp 4 -m 4G \
-drive file=makronix.qcow2,if=ide,format=qcow2 \
-drive file=Makronix-0.99.10-amd64-dvd.iso,media=cdrom,readonly=on \
-boot order=dc \
-nic user,model=e1000, \
hostfwd=tcp:127.0.0.1:2222-:22 \
-vga std -display gtk</code></pre>
<p>If <code>/dev/kvm</code> is not available, remove
<code>-enable-kvm -cpu host</code> and add <code>-cpu max</code>; the
installation then runs in emulation and takes much longer. Replace
<code>-display gtk</code> with
<code>-display none -serial mon:stdio</code> for a console-only machine;
the install media talks on <code>com0</code>, as <a
href="#vm-qemu-serial">A serial console</a> explains.</p>
<h3 id="vm-qemu-uefi">UEFI</h3>
<p>UEFI needs the OVMF firmware and a writable copy of its variable
store. The paths differ between distributions; these are the Debian and
Ubuntu names:</p>
<pre><code>cp /usr/share/OVMF/OVMF_VARS_4M.fd OVMF_VARS.fd
qemu-system-x86_64 -enable-kvm -cpu host -smp 4 -m 4G \
-machine q35 \
-drive if=pflash,format=raw,readonly=on, \
file=/usr/share/OVMF/OVMF_CODE_4M.fd \
-drive if=pflash,format=raw,file=OVMF_VARS.fd \
-device ich9-ahci,id=ahci \
-drive file=makronix.qcow2,if=none,id=hd0,format=qcow2 \
-device ide-hd,drive=hd0,bus=ahci.0 \
-drive file=Makronix-0.99.10-amd64-dvd.iso,media=cdrom,readonly=on, \
if=none,id=cd0 \
-device ide-cd,drive=cd0,bus=ahci.1 \
-boot order=dc \
-nic user,model=e1000, \
hostfwd=tcp:127.0.0.1:2222-:22 \
-vga std -display gtk</code></pre>
<p>The AHCI controller is deliberate. OVMF's IDE driver reads a CD or a
disk so slowly that the boot loader can need minutes for the kernel; the
tree's own test machines put the disk and the CD on AHCI when UEFI is
used (<code>tools/vmsh.sh</code>).</p>
<h3 id="vm-qemu-serial">A serial console</h3>
<p>The installer's boot configuration uses <code>com0</code> at 115200
baud, so a headless machine can be installed from a terminal. Run QEMU
with the serial line on the terminal and no display:</p>
<pre><code>qemu-system-x86_64 -enable-kvm -cpu host -smp 4 -m 4G \
-drive file=makronix.qcow2,if=ide,format=qcow2 \
-drive file=Makronix-0.99.10-amd64-dvd.iso,media=cdrom,readonly=on \
-boot order=dc -display none -serial mon:stdio</code></pre>
<p><code>Ctrl-A C</code> switches between the guest console and the QEMU
monitor; <code>Ctrl-A X</code> stops the machine. After the
installation, boot the disk with <code>-boot order=c</code> and leave
the CD out.</p>
<h3 id="vm-qemu-disks">Which disk the installer shows</h3>
<p>In the installer's disk menu, the device name tells you which bus the
disk is on:</p>
<ul>
<li><p><code>ld0</code> — a VirtIO block device
(<code>if=virtio</code>). The fastest choice for a Linux KVM
host.</p></li>
<li><p><code>sd0</code> — SCSI, AHCI or a VirtIO SCSI controller (the
Proxmox default).</p></li>
<li><p><code>wd0</code> — the emulated IDE controller
(<code>if=ide</code>), which is the simplest but the slowest.</p></li>
</ul>
<p>After the reboot, remove the CD from the command line (or set
<code>-boot order=c</code>). The installed system starts from the disk.
The network is <code>vioif0</code> for VirtIO and <code>wm0</code> or
<code>re0</code> for the emulated cards; the installer's DHCP client
configures it either way.</p>
<h2 id="vm-proxmox">Proxmox VE</h2>
<p>Proxmox VE runs QEMU with KVM and adds its own storage, snapshots and
a web console. A Makronix VM is an “Other” guest; the settings that
matter are the machine type, the firmware, the disk bus and the
display.</p>
<p>In the web interface, create a VM with these values:</p>
<ul>
<li><p>OS: the DVD image <code>Makronix-0.99.10-amd64-dvd.iso</code> as
the CD/DVD, guest type “Other”.</p></li>
<li><p>System: machine <code>q35</code>, BIOS <code>OVMF (UEFI)</code>,
an EFI disk, Secure Boot off. For a BIOS VM use machine
<code>i440fx</code> and SeaBIOS instead.</p></li>
<li><p>Disks: SCSI controller <code>VirtIO SCSI</code>, 32 GiB. The
guest sees it as <code>sd0</code>.</p></li>
<li><p>CPU: type <code>host</code>, 4 cores. On a cluster with mixed
CPUs, a named model such as <code>x86-64-v2-AES</code> is needed for
migration; it is slower but portable.</p></li>
<li><p>Memory: 4096 MiB (2048 is the minimum for a text
installation).</p></li>
<li><p>Network: model <code>VirtIO</code>, bridge <code>vmbr0</code>,
firewall as your network needs it.</p></li>
<li><p>Display: <code>std</code>, and a serial port if you want the text
console.</p></li>
<li><p>Boot order: CD/DVD first, the SCSI disk second.</p></li>
</ul>
<p>The same VM from the command line:</p>
<pre><code>qm create 100 --name makronix --ostype other --machine q35 --bios ovmf \
--efidisk0 local-lvm:1,efitype=4m,pre-enrolled-keys=0 \
--cpu host --cores 4 --memory 4096 --scsihw virtio-scsi-pci \
--scsi0 local-lvm:32 \
--ide2 local:iso/Makronix-0.99.10-amd64-dvd.iso,media=cdrom \
--boot &#39;order=ide2;scsi0&#39; --net0 virtio,bridge=vmbr0 \
--vga std --serial0 socket
qm start 100</code></pre>
<p><code>local-lvm</code> and <code>local</code> are the storage names
of your Proxmox installation; replace them with the names in Datacenter
&gt; Storage. For a BIOS VM, omit <code>--bios ovmf</code> and
<code>--efidisk0</code>, use <code>--machine i440fx</code>, and keep the
same <code>--boot</code> order.</p>
<p>Open the console with Console (noVNC) for the graphical installer, or
<code>qm terminal 100</code> for the serial one. If the web console
shows the installer but the keyboard does not work, click inside the
console once; Proxmox forwards the keyboard only after the console has
the focus.</p>
<p>When the installation is finished, detach the ISO and boot the
disk:</p>
<pre><code>qm set 100 --boot order=scsi0
qm set 100 --delete ide2</code></pre>
<p><em>Agent and cloud-init:</em> leave the QEMU guest agent off unless
you install it in the guest; Makronix does not ship it. Proxmox's
snapshots and backups work at the block level without it. For a
consistent backup of a running guest, stop it first or use the guest's
own backup; a block snapshot of a mounted file system is not a
transactional backup.</p>
<h2 id="vm-after">After the installation</h2>
<p>The first boot is the same as on a physical machine: the MCDE login
screen, the account you created, and the network the installer
configured. In QEMU's user-mode network, the host reaches the guest's
SSH server through the forwarded port:</p>
<pre><code>ssh -p 2222 user@127.0.0.1</code></pre>
<p>In Proxmox, the guest is on the bridge and gets an address from the
network's DHCP server, or the fixed address you configure in the
installer. The serial console remains available with
<code>qm terminal 100</code>; log out of it with
<code>Ctrl-O</code>.</p>
<p>An encrypted installation works in a VM exactly as on hardware: the
installer asks for the passphrase, and every boot asks for it again. A
Proxmox snapshot of an encrypted guest is a snapshot of the encrypted
blocks; the passphrase is still needed to start it.</p>
<h2 id="vm-trouble">When the VM does not cooperate</h2>
<ul>
<li><p><em>The VM starts but the installer does not appear.</em> Check
the boot order (CD before disk), and give the firmware a moment: OVMF
scans its devices before it reads the CD. With UEFI, make sure the
writable variable store is attached; a read-only OVMF image cannot keep
the boot entries.</p></li>
<li><p><em>UEFI is very slow.</em> Move the disk and the CD to AHCI
(<code>ich9-ahci</code> in QEMU, VirtIO SCSI in Proxmox). OVMF's IDE
driver is the usual cause.</p></li>
<li><p><em>The desktop does not start.</em> The installer may have
completed on a serial console with no VGA device. Add
<code>-vga std</code> (QEMU) or <code>vga: std</code> (Proxmox), start
the graphical installer, and use the full installation way if the simple
way cannot detect the display.</p></li>
<li><p><em>No network.</em> QEMU's user-mode network is NAT: the guest
can reach out, and the host reaches the guest only through a forwarded
port. A bridged Proxmox VM behaves like a machine on the LAN; check the
bridge and the firewall.</p></li>
<li><p><em>The keyboard is wrong.</em> The installer asks for the
keyboard layout; the MCDE session has its own setting. A VM console that
sends the wrong keys is usually a host layout problem, not a guest
one.</p></li>
</ul>
<h1 id="upgrade">Upgrading Makronix</h1>
<p>An upgrade replaces the base system and keeps your accounts, your
files and the packages you installed. There are two ways to do it: from
a new installation medium, or from a running system with <code
class="citerefentry">sysupgrade(8)</code>. Both end with the same steps:
the sets are unpacked, the configuration is merged, and the machine is
rebooted.</p>
<h2 id="upgrade-medium">From the medium</h2>
<p>Start the new medium and choose “Upgrade NetBSD on a hard disk” in
<code>sysinst</code>. The installer asks for the disk and the root
partition, unpacks the new sets over the old system and leaves
<code>/etc</code> and <code>/home</code> alone. The “makronix” set is
part of the upgrade; choose it when the installer offers the sets.</p>
<p>After the reboot, run the two NetBSD tools that bring the
configuration up to date:</p>
<pre><code># postinstall -s /usr/src/etc fix
# etcupdate -s /usr/src/etc</code></pre>
<p><code class="citerefentry">postinstall(8)</code> repairs the files
that NetBSD knows how to merge (the mail configuration, the device
files, the fonts); <code class="citerefentry">etcupdate(8)</code> merges
the rest and leaves its conflicts for you to resolve. Read
<code>/etc/rc.conf</code> afterwards: a new release can add a service or
rename a variable, and the old file is kept as
<code>/etc/rc.conf.old</code> when it is replaced.</p>
<h2 id="upgrade-sysupgrade">With sysupgrade</h2>
<p><code>sysupgrade</code> does the same work from the running system.
It fetches the sets from a directory, a <code>file://</code> address or
an <code>https://</code> address, unpacks them and updates the kernel.
The address is the first line of <code>/etc/makronix/update</code>:</p>
<pre><code># cat /etc/makronix/update
https://example.invalid/makronix/0.99.10/amd64
# sysupgrade auto https://example.invalid/makronix/0.99.10/amd64</code></pre>
<p>After <code>sysupgrade</code>, run <code>postinstall</code> and
<code>etcupdate</code> as above and reboot. The MCDE System Settings has
the same operation as a dialog: it reads the source from
<code>/etc/makronix/update</code>, runs <code>sysupgrade</code> for the
base system and then <code>pkg_add -uu</code> for the packages.</p>
<p><em>Trust:</em> an <code>https://</code> source is protected by TLS;
a <code>file://</code> source is as trusted as the medium it is on. This
release does not verify a signature on the sets. Use a source you
control, and keep a copy of the previous release until the new one has
started.</p>
<h2 id="upgrade-packages">The packages</h2>
<p>Packages from pkgsrc are updated with the package tools, not with the
base system:</p>
<pre><code># pkg_add -uu
# pkg_admin rebuild</code></pre>
<p>The packages of the “makronix” set are not in the package database:
the installer unpacks them as part of the set. They change with a
Makronix release, which is one reason to upgrade the whole system rather
than a single file.</p>
<h2 id="upgrade-encrypted">An encrypted system</h2>
<p>On an encrypted system the kernel the machine boots is the copy on
the small unencrypted partition, not <code>/netbsd</code> in the
encrypted root. After an upgrade, copy the new kernel and the matching
<code>cgdroot.kmod</code> to that partition:</p>
<pre><code># mount /cgdboot
# cp /netbsd /cgdboot/netbsd
# cp /path/from/the/release/cgdroot.kmod /cgdboot/
# umount /cgdboot</code></pre>
<p>The release notes name the exact path of <code>cgdroot.kmod</code>;
it is part of the kernel set of the new release. Keep the old kernel as
<code>/cgdboot/netbsd.old</code> so that the loader can start it if the
new one fails.</p>
<h2 id="upgrade-recovery">If the upgrade fails</h2>
<p>A failed upgrade is not a lost machine. Start the old medium, mount
the root partition and read <code>/var/log/messages</code>; the
installer has left the old configuration in
<code>/etc/rc.conf.old</code> and the old kernel in
<code>/netbsd.old</code>. The loader's menu can start
<code>netbsd.old</code> when the new kernel does not boot. With the
source set installed, the system can be rebuilt in place (<a
href="#building">Building Makronix</a>).</p>
<h1 id="mcde">MCDE: The Desktop</h1>
<p>MCDE is the Makronix Common Desktop Environment, a fork of CDE 2.5.3.
CDE is the desktop that Sun, HP, IBM, DEC, SCO, Fujitsu and Hitachi
shipped on their workstations, and it has been open source since 2012.
MCDE keeps what made it good — Motif, a quick and steady desktop that
does not need a fast machine — and makes it one desktop that works as a
whole.</p>
<div class="float" id="mcde-desktop-fig">
<img src="img/shot-desktop.png">
<div class="figcaption">The MCDE desktop</div>
</div>
<p>MCDE is written in C99 against Motif, Xlib and X11. It uses no other
toolkit and no compositor, and it builds and runs on NetBSD and on Linux
through pkgsrc on both. Everything that differs between the operating
systems — users, network, sound — is behind one layer, so that no
program has to know which system it runs on.</p>
<h2 id="mcde-login">Logging in</h2>
<p>The graphical login is <code class="citerefentry">dtlogin(1)</code>.
It shows the users of the machine and a field for the password; the
Options menu chooses the session type and the language. After login,
<code class="citerefentry">dtsession(1)</code> starts the session: the
window manager, the front panel, the bar at the top and the programs
that are set to open at login.</p>
<p>Lock Screen in the Makronix menu locks the session without ending it;
Log Out ends it and returns to <code>dtlogin</code>. A session can be
saved on logout and restored at the next login; the setting is in System
Settings, under Login.</p>
<h2 id="mcde-bar">The bar at the top</h2>
<p>One bar runs along the top of the screen. On the left is the Makronix
menu: about this computer, software update, system settings, your
favourites and recent items, force quit, sleep, restart, shut down, lock
the screen and log out. Next to it are the menus of the program you are
working with. They leave the program's window and stand in the bar, for
every MCDE program, without a change to the program itself.</p>
<p>On the right are the status items: the volume (a slider in the menu,
a mute switch, and the wheel over the speaker), Bluetooth, the network,
the battery on a machine that has one, and the clock.</p>
<h2 id="mcde-panel">The front panel</h2>
<p>CDE's front panel stays as it is: the controls in the middle, the
drawers above them, the workspace switches, and the trash. Left of the
trash the panel shows the programs that are open and have no place in
the panel yet; a click brings the window forward. The right button keeps
one in the panel, or you can drag it to the left; from then on it is
there at every login. A click starts it, or brings it forward when it is
already running.</p>
<p>The workspaces are in the middle of the panel. A window can be sent
to another workspace from its window menu; the panel's workspace buttons
switch between them. The number of workspaces is set in the window
manager's settings.</p>
<h2 id="mcde-windows">Windows and the window manager</h2>
<p><code class="citerefentry">dtwm(1)</code> draws the frames. The title
bar has the window menu on the left and the minimize and maximize
buttons on the right; the window menu moves, resizes, raises, lowers,
sends the window to a workspace, or closes it. A double click on the
title bar maximizes the window.</p>
<p>The window manager's configuration is <code>~/.dt/dtwmrc</code>;
without it, the system file <code>/usr/pkg/dt/config/C/sys.dtwmrc</code>
applies. The menu that appears on the root window (the desktop) is
defined there. Most people never edit it: the settings that matter are
in System Settings.</p>
<h2 id="mcde-dtfile">The file manager</h2>
<p><code class="citerefentry">dtfile(1)</code> is the file manager. A
toolbar has Back and Forward — every window keeps its own history — and
the views. A sidebar holds the places: the computer, your home, the
desktop, documents and downloads, and the free space of the disk is in
the status line.</p>
<div class="float" id="mcde-dtfile-fig">
<img src="img/shot-dtfile.png">
<div class="figcaption">The file manager</div>
</div>
<p>The column view shows one column for each folder down to the one you
are in, and on the right what you selected: its icon, kind, size and
date. Files are copied and moved by dragging them; the trash is on the
front panel. The file manager also shows network places when the sharing
services are configured (<a href="#sharing">Remote Access and File
Sharing</a>).</p>
<h2 id="mcde-dtterm">The terminal</h2>
<p><code class="citerefentry">dtterm(1)</code> is the terminal. It has
tabs: <code>Ctrl+Shift+T</code> opens one, <code>Ctrl+Shift+W</code>
closes it, and <code>Ctrl+Shift+Left</code> and
<code>Ctrl+Shift+Right</code> move between them. A program's title
appears on its tab, and the window title is the title of the tab in
front. A profile gives a tab its font, its colours and its command
(Window, New Tab with Profile). <code>Ctrl+Shift+D</code> splits a tab
and puts another terminal below it. Started as
<code>dtterm -dropdown</code>, the terminal waits out of sight and comes
down from the top of the screen at <code>F12</code>; the next press puts
it back.</p>
<div class="float" id="mcde-dtterm-fig">
<img src="img/shot-dtterm-tabs.png">
<div class="figcaption">The terminal with two tabs</div>
</div>
<p>The terminal draws anti-aliased UTF-8 text in the Hack font, and
falls back to another font for characters Hack does not have. The shell
inside it is the login shell of your account; on a fresh account it is
<code class="citerefentry">sh(1)</code>.</p>
<h2 id="mcde-programs">The other programs</h2>
<dl>
<dt><code class="citerefentry">dtpad(1)</code></dt>
<dd>
<p>The text editor. It edits plain text, has a search and replace, and
opens several files in one window.</p>
</dd>
<dt><code class="citerefentry">dtcalc(1)</code></dt>
<dd>
<p>The calculator: a normal calculator, a scientific one and a
programmer's one, in one window.</p>
</dd>
<dt><code>dtpaint</code></dt>
<dd>
<p>The paint program: lines, curves, shapes, fill, text and zoom, in the
colours of the release. It is for pictures drawn by hand.</p>
</dd>
<dt><code>dtlaunch</code></dt>
<dd>
<p>The launcher, opened with <code>Alt+Space</code>. Type a few letters
to find a program; type a keyword to find a text snippet; leave the
field empty to see what you copied last; type <code>=12*(3+4)</code> and
it shows 84. Return starts the program or puts the text on the
clipboard. Snippets live in <code>~/.dt/snippets</code>.</p>
</dd>
<dt><code class="citerefentry">dtinfo(1)</code></dt>
<dd>
<p>The Information Manager: this guide, with search. <a
href="#dtinfo">The Information Manager</a> is its chapter.</p>
</dd>
</dl>
<h2 id="mcde-settings">System Settings</h2>
<p><code>dtsystemsettings</code> is one window for every setting of the
computer. It has four rows of icons — personal, hardware, internet and
network, system — and a click opens a setting in the same window; Show
All goes back.</p>
<div class="float" id="mcde-settings-fig">
<img src="img/shot-settings.png">
<div class="figcaption">System Settings</div>
</div>
<p>It draws the colours (every palette with its colours), the font of
every window, the backdrop (a picture, or a folder of pictures that
change by themselves) and the screen saver, the keyboard and the mouse,
sound, the network and the Wi-Fi networks in reach, Bluetooth, the date,
time and time zone, the accounts of the people who use the computer, the
software update and the facts about the computer. It also decides what
happens at login: the session and the programs that open by
themselves.</p>
<p>Changing an account, the network or the software update asks for the
administrator's password. The settings that belong to one user are
stored in <code>~/.dt</code>; the ones that belong to the machine are in
<code>/etc/dt</code> and <code>/usr/pkg/dt/config</code>.</p>
<h2 id="mcde-colours">Colours, fonts and the palette</h2>
<p>A Makronix release is named after a CDE palette, and the desktop
starts in that palette. For 0.99.10 it is “Camouflage”: the background
is a grey-green, the panels are olive and grey-green, and the title bars
are a deep green. The palette is a plain file,
<code>/usr/pkg/dt/share/palettes/Camouflage.dp</code>, and System
Settings shows every installed palette with its colours before you
choose it.</p>
<p>Fonts are set the same way. MCDE ships Hack, an open source monospace
font, and uses it for the terminal and the login screen; the rest of the
desktop uses the system font, which System Settings can change.
Anti-aliasing is on by default and can be turned off for a machine that
is too slow for it.</p>
<h2 id="mcde-session">The session and your files</h2>
<p>Everything that belongs to your desktop is under <code>~/.dt</code>:
the session, the panel layout, the menus, the snippets, the backdrop
choice and the settings of the programs. Removing a file there resets
that part of the desktop at the next login; removing the whole directory
gives you a fresh desktop, without touching your documents.</p>
<p>The session manager can save the programs that are open when you log
out and start them again at the next login. The setting is in System
Settings under Login. A program that should always start belongs in the
session, not in a shell startup file: the session is what the desktop
restores.</p>
<h2 id="mcde-help">Help</h2>
<p>The MCDE programs have a Help menu, but their own help pages are not
part of this release: the cross build turns the MCDE documentation off.
The Information Manager holds this guide, which is the place to start
when the question is about the system rather than about one program. The
next chapter explains how to open it and how to search in it.</p>
<h1 id="x11">The Display and X11</h1>
<p>MCDE draws on the X Window System, and X is part of the Makronix base
system. The server, the drivers, the fonts and the clients are in
<code>/usr/X11R7</code>; there is no separate X package to install. On a
normal machine the server needs no configuration at all, and
<code>dtlogin</code> starts it.</p>
<h2 id="x11-server">The server and the session</h2>
<p>The login screen starts the X server and, after a login, the MCDE
session. A text console can start a bare X session with <code
class="citerefentry">startx(1)</code>, but that is not the MCDE session:
it starts the user's <code>~/.xinitrc</code> and nothing else. Use it to
test the server, not as the daily desktop.</p>
<pre><code>$ startx
$ xdpyinfo | head
$ xrandr</code></pre>
<p><code>xdpyinfo</code> prints the display's capabilities, and
<code>xrandr</code> lists the outputs and the modes. A second monitor is
enabled with <code>xrandr --output</code>; the setting lasts for the
session unless it is put in a session script.</p>
<h2 id="x11-config">When the server needs a configuration</h2>
<p>Most hardware is detected. A machine with an unusual graphics chip, a
wrong resolution or a display that stays black can be given a
configuration file:</p>
<pre><code># X -configure
# cp /root/xorg.conf.new /etc/X11/xorg.conf
# X -config /etc/X11/xorg.conf</code></pre>
<p>The file is a starting point, not a guarantee. The log is
<code>/var/log/Xorg.0.log</code>; the lines marked <code>(EE)</code> are
errors and <code>(WW)</code> are warnings. A server that starts from the
console but not from <code>dtlogin</code> usually has a permission or a
display-manager problem, not a driver problem.</p>
<h2 id="x11-keyboard">Keyboard and fonts</h2>
<p>The text console and X have separate keyboard settings. The console
is configured with <code class="citerefentry">wsconsctl(8)</code>:</p>
<pre><code># wsconsctl -w keyboard.encoding=de</code></pre>
<p>The key map is set in <code>/etc/wscons.conf</code>. In X, MCDE's
System Settings sets the layout for the session; the X server's own
configuration is in <code>/etc/X11/xorg.conf.d/</code>. A keyboard that
types the wrong characters in a terminal but the right ones on the
console (or the other way round) is set in the other place.</p>
<p>The fonts are installed with the X sets. <code
class="citerefentry">fc-list(1)</code> lists them and
<code>fc-cache -f</code> refreshes the cache after a font is added.
MCDE's terminal and login screen use Hack; the rest of the desktop uses
the system font, which System Settings changes.</p>
<h2 id="x11-remote">Programs from another machine</h2>
<p>An X program can run on one machine and display on another. SSH
forwards the connection, which is the safe way:</p>
<pre><code>$ ssh -X name@studio.example xterm</code></pre>
<p><code>-X</code> asks for trusted forwarding; <code>-Y</code> is the
older, less restricted form. The remote machine needs an X client and
the local one needs the server, which Makronix has. A program that
refuses to start has usually failed an authorization check; the SSH
connection sets that up for you.</p>
<h1 id="dtinfo">The Information Manager</h1>
<p><code class="citerefentry">dtinfo(1)</code> is MCDE's Information
Manager. It reads information libraries: directories of books, each with
a table of contents and a full-text index. This guide is the book that
is installed in this release. The MCDE programs' own help pages are not
part of the release: the cross build turns the MCDE documentation off,
so the Information Manager has no program help books. The guide is what
is there.</p>
<div class="float" id="dtinfo-fig">
<img src="img/shot-dtinfo.png">
<div class="figcaption">The Information Manager with the Makronix
Guide</div>
</div>
<h2 id="dtinfo-open">Opening the guide</h2>
<p>The Makronix Guide is the default library of the Information Manager,
so <code>dtinfo</code> opens it directly. From a terminal:</p>
<pre><code>$ dtinfo
$ dtinfo -l makronix</code></pre>
<p>The first command opens the default library; the second names the
library explicitly. The library is installed as
<code>/etc/dt/infolib/en_US.UTF-8/makronix.dti</code>. The session
script <code>/etc/dt/config/Xsession.d/0000makronix</code> sets
<code>DTINFOLIBDEFAULT</code> to <code>makronix</code>, which is why the
plain command works.</p>
<h2 id="dtinfo-use">Reading and searching</h2>
<p>The window has a list of the books in the library and the table of
contents of the selected book. A click on a chapter opens it; the
navigation buttons go back and forward in the history, and the table of
contents stays available while you read. The search field searches the
whole library, not only the open chapter; the results are shown with the
book and section they come from, and a click opens the result in
place.</p>
<p>The guide is one book with a chapter for every part of the system.
The chapters are the same text as the manual pages and the PDF; the
Information Manager adds the search and the links between them.</p>
<h2 id="dtinfo-format">What an information library is</h2>
<p>An information library is a directory whose name ends in
<code>.dti</code>. It contains a <code>bookcase.map</code> that names
the library and its bookcases, one directory per bookcase with the
compiled books, and a <code>dtsearch</code> directory with the full-text
index. The books are written in DocBook, the SGML dialect that CDE's
documentation uses, and compiled with
<code>dtdocbook2infolib</code>.</p>
<p>The Makronix Guide is built from <code>docs/guide/book.xml</code> in
the source tree. The same source produces the manual pages, the PDF, the
HTML file and this library; <a href="#building">Building Makronix</a>
explains the build. If you change the guide, rebuild it with:</p>
<pre><code>$ cd /usr/src
$ sh docs/guide/build.sh all
$ sh docs/guide/build.sh install</code></pre>
<p>The first command builds all five forms in
<code>docs/guide/out</code>; the second copies them to the places the
system reads: <code>/usr/share/doc/makronix</code>,
<code>/usr/share/man/man7</code> and <code>/etc/dt/infolib</code>.</p>
<h2 id="dtinfo-add">Adding another library</h2>
<p>A library that someone gives you is a directory ending in
<code>.dti</code>. Put it under the locale directory of the system
library and name it on the command line:</p>
<pre><code># cp -R example.dti /etc/dt/infolib/en_US.UTF-8/
$ dtinfo -l example</code></pre>
<p>The library's own <code>bookcase.map</code> names its bookcases;
<code>dtinfo</code> reads that file, so the directory name and the short
name in the map are what matter. A library for one user can live in
<code>~/.dt/infolib</code>; the search path finds it there as well.</p>
<h2 id="dtinfo-trouble">When the Information Manager is empty</h2>
<p>If <code>dtinfo</code> starts but shows no books, the library was not
found. Check the three things it depends on:</p>
<ul>
<li><p><code>/etc/dt/infolib/en_US.UTF-8/makronix.dti/bookcase.map</code>
exists and is readable.</p></li>
<li><p><code>DTINFOLIBDEFAULT</code> is <code>makronix</code> in the
session (<code>echo $DTINFOLIBDEFAULT</code>).</p></li>
<li><p><code>DTINFOLIBSEARCHPATH</code> contains
<code>/etc/dt/infolib/%L/%I.dti</code>. The command
<code>dtsearchpath</code> prints the assembled path; run it in the
session that has the problem.</p></li>
</ul>
<p>A library that was copied from another machine can have a stale
search index. Rebuilding it with <code>dtdocbook2infolib</code> is
described in the DocBook chapter of the CDE documentation; for the
Makronix Guide, <code>docs/guide/build.sh infolib</code> does it.</p>
<h1 id="shell">The Command Line</h1>
<p>The desktop is where the work starts, but the command line is where a
Unix system is understood and repaired. Makronix uses NetBSD's shell,
NetBSD's tools and NetBSD's manual pages; nothing here is special to
Makronix except the paths of the MCDE programs.</p>
<h2 id="shell-shell">The shell</h2>
<p>The login shell of a new account is <code
class="citerefentry">sh(1)</code>, NetBSD's POSIX shell. It reads
<code>~/.profile</code> at login and <code>~/.shrc</code> for
interactive shells. A user who prefers a Korn shell can use
<code>/usr/pkg/bin/ksh93</code> (installed for MCDE's
<code>dtksh</code>) and change the login shell with <code
class="citerefentry">chsh(1)</code>.</p>
<p>The important environment variables are <code>PATH</code>,
<code>HOME</code>, <code>SHELL</code>, <code>TERM</code> and
<code>LANG</code>. A desktop session gets <code>PATH</code> from the
session configuration, not only from <code>~/.profile</code>; if a
program is found in a terminal but not from the panel, compare the
two:</p>
<pre><code>$ echo $PATH
$ env | sort</code></pre>
<h2 id="shell-basics">Pipes, redirection and jobs</h2>
<p>A pipe sends the output of one program to the input of the next;
redirection sends it to a file. The three that matter every day:</p>
<pre><code>$ dmesg | less
$ grep -i error /var/log/messages &gt; /tmp/errors
$ command 2&gt;&amp;1 | tee log</code></pre>
<p><code>Ctrl</code>+<code>C</code> stops the program in the foreground,
<code>Ctrl</code>+<code>Z</code> suspends it, and <code>bg</code>,
<code>fg</code> and <code>jobs</code> manage it.
<code>command &amp;</code> starts it in the background.</p>
<p>A file's permissions are read with <code>ls -l</code> and changed
with <code class="citerefentry">chmod(1)</code>. The three digits are
the owner, the group and everybody else; the execute bit is what makes a
file a program. A directory needs the execute bit to be entered, and the
write bit to be changed.</p>
<pre><code>$ chmod 644 notes.txt
$ chmod 755 script.sh
$ chown user:wheel script.sh</code></pre>
<h2 id="shell-editing">Editing files</h2>
<p><code class="citerefentry">vi(1)</code> is in the base system and is
the editor to know when the desktop is not running. It has two modes:
command mode, where keys are commands, and insert mode, where they are
text. <code>i</code> enters insert mode, <code>Esc</code> returns to
command mode, <code>:w</code> writes, <code>:q</code> quits and
<code>:wq</code> does both. <code>dd</code> deletes a line,
<code>/text</code> searches, and <code>u</code> undoes.</p>
<p>On the desktop, <code class="citerefentry">dtpad(1)</code> edits
plain text with menus and a search dialog. Configuration files are plain
text either way; keep a copy before a large change
(<code>cp file file.orig</code>) and compare afterwards with <code
class="citerefentry">diff(1)</code>.</p>
<h2 id="shell-man">Finding the documentation</h2>
<p><code class="citerefentry">man(1)</code> reads the manual pages. The
sections are 1 (commands), 2 (system calls), 3 (library functions), 4
(devices), 5 (file formats), 7 (conventions) and 8 (administration). The
useful forms:</p>
<pre><code>$ man ls
$ man 5 rc.conf
$ man -k firewall
$ apropos password</code></pre>
<p><code>man -k</code> searches the one-line descriptions;
<code>apropos</code> is the same. The Makronix Guide is a set of pages
in section 7, starting at <code
class="citerefentry">makronix-guide(7)</code>. The HTML and PDF forms
are under <code>/usr/share/doc/makronix</code>.</p>
<h2 id="shell-root">Becoming the administrator</h2>
<p>Administrative commands run as root. On a desktop, log in as yourself
and use <code class="citerefentry">su(1)</code>:</p>
<pre><code>$ su -
Password:
# </code></pre>
<p>The minus makes it a login shell, with root's <code>PATH</code> and
environment. Your account is in the wheel group, which is what allows
<code>su</code>; a terminal that is left alone returns to your prompt
when you type <code>exit</code>. Log in as yourself rather than as root:
the desktop account is the account for people, and <code>su</code> is
the door to the system.</p>
<h1 id="rc">Services and rc.d</h1>
<p>NetBSD starts services through <code>rc.d</code>: one script per
service, and one configuration file that decides which of them run.
Makronix uses the mechanism unchanged; the services that a desktop needs
are already configured.</p>
<h2 id="rc-conf">/etc/rc.conf</h2>
<p><code>/etc/rc.conf</code> holds one variable per service.
<code>foo=YES</code> starts the service at boot, <code>foo=NO</code>
does not. The file is read by <code class="citerefentry">rc(8)</code>;
the variables are documented in <code
class="citerefentry">rc.conf(5)</code> and in the header of each
script.</p>
<pre><code># grep -v &#39;^#&#39; /etc/rc.conf | grep .</code></pre>
<p>A local addition belongs in <code>/etc/rc.conf</code>, not in a
script: it survives an upgrade, and <code>etcupdate</code> knows how to
merge it. A single service can also be configured in
<code>/etc/rc.conf.d/</code>&lt;service&gt;, which is useful when a
package or an administrator owns one file.</p>
<h2 id="rc-scripts">Starting, stopping and checking a service</h2>
<p>The scripts are in <code>/etc/rc.d</code>. Each takes the verbs
<code>start</code>, <code>stop</code>, <code>restart</code>,
<code>status</code> and <code>onestart</code> (start it now without
changing <code>rc.conf</code>):</p>
<pre><code># /etc/rc.d/dhcpcd status
# /etc/rc.d/dhcpcd restart
# /etc/rc.d/sshd onestart</code></pre>
<p>A service that fails at boot writes its reason to the console and to
<code>/var/log/messages</code>. A script that is not executable, or a
variable with a typo, is the usual cause. The order in which the scripts
run is decided by the <code>REQUIRE</code> and <code>PROVIDE</code>
lines at the top of each script, not by the alphabetical order; <code
class="citerefentry">rcorder(8)</code> prints the order.</p>
<h2 id="rc-desktop">The desktop services</h2>
<p>On a Makronix desktop the relevant entries are:</p>
<dl>
<dt><code>dhcpcd=YES</code></dt>
<dd>
<p>The DHCP client, when the network is configured by DHCP. A machine
with a fixed address sets <code>dhcpcd=NO</code> and configures the
interface in <code>/etc/ifconfig.</code>&lt;if&gt;.</p>
</dd>
<dt><code>sshd=YES</code></dt>
<dd>
<p>The Secure Shell server. The installer enables it; the firewall lets
it in.</p>
</dd>
<dt><code>ntpd=YES</code></dt>
<dd>
<p>Time synchronisation. The server list is
<code>/etc/ntp.conf</code>.</p>
</dd>
<dt><code>npf=YES</code></dt>
<dd>
<p>The firewall. Its rules are in <code>/etc/npf.conf</code>; <a
href="#firewall">The Firewall</a> explains them.</p>
</dd>
<dt><code>dtlogin=YES</code></dt>
<dd>
<p>The graphical login. Without it the machine starts with a text
console; <code>startx</code> is not the same thing, and the MCDE session
is started by <code>dtlogin</code>.</p>
</dd>
<dt><code>cupsd=YES</code></dt>
<dd>
<p>The print service, when printing is set up (<a
href="#printing">Printing, Sound and Power</a>).</p>
</dd>
</dl>
<h2 id="rc-add">Adding a service</h2>
<p>A service that comes from pkgsrc installs its own script in
<code>/usr/pkg/share/examples/rc.d</code> or <code>/etc/rc.d</code>.
Copy it into <code>/etc/rc.d</code> if it is an example, make it
executable, add the variable to <code>/etc/rc.conf</code>, and start it
once to see whether it works before the next boot:</p>
<pre><code># cp /usr/pkg/share/examples/rc.d/foo /etc/rc.d/foo
# chmod 755 /etc/rc.d/foo
# echo &#39;foo=YES&#39; &gt;&gt; /etc/rc.conf
# /etc/rc.d/foo start
# /etc/rc.d/foo status</code></pre>
<p>If the service needs a directory or a user, its package documentation
says so; <code>pkg_info -D foo</code> prints the message that came with
the package.</p>
<h1 id="users">Users and Accounts</h1>
<p>Makronix is a machine for people: the installer creates one account
for the person who uses it, and that account is in the groups a desktop
needs. More accounts are added with NetBSD's user tools, and the same
accounts appear at the login screen and in System Settings.</p>
<h2 id="users-database">Where the accounts live</h2>
<p><code>/etc/master.passwd</code> is the real database;
<code>/etc/passwd</code> is its public view, without the password
hashes. Both are generated from the master file by <code
class="citerefentry">pwd_mkdb(8)</code>. The group database is
<code>/etc/group</code>. Edit them with <code
class="citerefentry">vipw(8)</code> and <code
class="citerefentry">vi(1)</code> rather than with a text editor that
does not know about the locks.</p>
<p>Each account has a home directory, a login shell and a list of
groups. A new account gets the files from <code>/etc/skel</code>, which
is where a site puts its default <code>.profile</code> and desktop
files.</p>
<h2 id="users-add">Adding an account</h2>
<pre><code># useradd -m -G wheel,operator,staff,users,dialer,games,wsrc \
-c &quot;Full Name&quot; -s /bin/sh name
# passwd name</code></pre>
<p><code>useradd</code> creates the home directory with <code>-m</code>,
puts the account in the named groups and sets the shell.
<code>passwd</code> then sets the password; without it the account
cannot log in. The groups are the ones the installer uses:</p>
<dl>
<dt>wheel</dt>
<dd>
<p>May use <code>su</code> to become root.</p>
</dd>
<dt>operator</dt>
<dd>
<p>May use the operator commands (shutdown, and the disk tools that are
marked for it).</p>
</dd>
<dt>staff</dt>
<dd>
<p>The usual group for files that a team shares.</p>
</dd>
<dt>users</dt>
<dd>
<p>The ordinary users of the machine.</p>
</dd>
<dt>dialer</dt>
<dd>
<p>May use the serial ports and the modems.</p>
</dd>
<dt>games</dt>
<dd>
<p>May write the games' score files.</p>
</dd>
<dt>wsrc</dt>
<dd>
<p>May write the source tree under <code>/usr/src</code>.</p>
</dd>
</dl>
<p>The same operation is in System Settings under Users; it asks for the
administrator's password and writes the same files.</p>
<h2 id="users-change">Changing and removing an account</h2>
<pre><code># usermod -G wheel,operator,staff,users,dialer,games,wsrc name
# chsh -s /usr/pkg/bin/ksh93 name
# userdel -r name</code></pre>
<p><code>usermod</code> changes the groups, the shell, the full name or
the home directory; <code>chsh</code> changes the shell of the account
that runs it. <code>userdel -r</code> removes the account and its home
directory; without <code>-r</code> the files stay. A removed account
leaves its files owned by a number; find them with
<code>find / -nouser -print</code> before you delete anything else.</p>
<h2 id="users-password">Passwords</h2>
<p>Passwords are stored as hashes in <code>/etc/master.passwd</code>,
which only root can read. A user changes their own with
<code>passwd</code>; root changes another with <code>passwd name</code>.
The password quality is the administrator's business: a desktop machine
on a home network needs a different policy from a machine that is
reachable from the Internet.</p>
<p>If a password is lost, root sets a new one from a single-user boot or
from another account in the wheel group. The fact that this is possible
is the reason a machine left alone in a public place must be locked, not
only logged out.</p>
<h1 id="disks">Disks and Filesystems</h1>
<p>NetBSD names disks by driver and number: <code>sd0</code> is the
first SCSI or SATA disk, <code>wd0</code> the first IDE disk,
<code>ld0</code> a logical disk, <code>cd0</code> a CD or DVD drive. A
partition is a letter after the disk: <code>sd0a</code> is the first
partition of the first disk. The raw device has an <code>r</code> in
front (<code>rsd0a</code>); the block device is the one you mount.</p>
<h2 id="disks-see">Seeing what is there</h2>
<pre><code>$ dmesg | grep -E &#39;sd|wd|cd&#39;
$ disklabel sd0
$ df -h
$ du -sh /home/*</code></pre>
<p><code class="citerefentry">disklabel(8)</code> prints the partition
table of a disk; <code class="citerefentry">df(1)</code> shows what is
mounted and how full it is. A machine installed with the simple way has
a GPT label and a root partition that uses the whole disk; the full way
can have an MBR label and a NetBSD disklabel inside it, as NetBSD
documents.</p>
<h2 id="disks-add">Adding a disk</h2>
<p>A new disk has no label until one is written. The interactive editor
is the safe way to look first:</p>
<pre><code># disklabel -i sd1
disklabel&gt; p
disklabel&gt; a
partition&gt; a
offset&gt; [Enter]
size&gt; [Enter]
fstype&gt; 4.2BSD
disklabel&gt; w
disklabel&gt; q</code></pre>
<p>The partition table is written by <code>w</code>; nothing happens
before it. A GPT disk can be edited with <code
class="citerefentry">gpt(8)</code> instead. After the label, make a file
system and mount it:</p>
<pre><code># newfs /dev/rsd1e
# mkdir -p /data
# mount /dev/sd1e /data</code></pre>
<p>The raw device is the one for <code>newfs</code>. A file system that
should come back after a reboot belongs in <code>/etc/fstab</code>:</p>
<pre><code>/dev/sd1e /data ffs rw 1 2</code></pre>
<p><code class="citerefentry">newfs(8)</code> destroys what was on the
partition. Check the device name with <code>disklabel</code> before you
type it.</p>
<h2 id="disks-backup">Backing up a file system</h2>
<p><code class="citerefentry">dump(8)</code> and <code
class="citerefentry">restore(8)</code> are the NetBSD pair for a whole
file system. They preserve owners, modes and hard links, which
<code>cp</code> does not:</p>
<pre><code># dump -0 -f /backup/root.dump /
# restore -i -f /backup/root.dump</code></pre>
<p>For a directory, <code class="citerefentry">tar(1)</code> is enough,
and a compressed archive is easier to keep:</p>
<pre><code>$ tar -czf /backup/home.tar.gz /home
$ tar -xzf /backup/home.tar.gz -C /</code></pre>
<p>A backup that has never been restored is a hope. Restore one file
from the archive before you trust it.</p>
<h2 id="disks-encryption">Encrypted disks</h2>
<p>An installation with encryption uses <code
class="citerefentry">cgd(4)</code>. The key is derived from a passphrase
and stored in <code>/etc/cgd/</code>&lt;disk&gt;. The installer writes
it; the boot loader asks for the passphrase before the root file system
is mounted. The unencrypted partition that the loader reads is
<code>/cgdboot</code>.</p>
<p>To encrypt another disk by hand, create the configuration, then the
cgd device, then a file system on it:</p>
<pre><code># cgdconfig -g -k argon2id -o /etc/cgd/sd1e adiantum 256
# cgdconfig cgd0 /dev/sd1e
/dev/sd1e&#39;s passphrase:
# newfs /dev/rcgd0a
# mount /dev/cgd0a /mnt</code></pre>
<p>The exact partition letters and the choice of algorithm are the
administrator's; <code class="citerefentry">cgdconfig(8)</code>
documents the parameters and the verification methods. A lost passphrase
cannot be recovered; keep a copy of the configuration in a safe place,
not the passphrase.</p>
<h2 id="disks-raid-lvm">RAID, LVM and concatenation</h2>
<p>NetBSD has three ways to combine disks. Each has its own manual page
and its own recovery rules, and each is a decision to make before the
data is on it:</p>
<ul>
<li><p><code class="citerefentry">raidctl(8)</code> — RAIDframe,
hardware-independent RAID levels 0, 1, 5 and more. The configuration is
a file; the set must be assembled before the root file system is mounted
if it holds the root.</p></li>
<li><p><code class="citerefentry">lvm(8)</code> — logical volumes:
physical volumes, a volume group, logical volumes that can grow. It is
the flexible choice for a data disk.</p></li>
<li><p><code class="citerefentry">ccdconfig(8)</code> — concatenation
and striping without RAIDframe. Simple, and with no redundancy.</p></li>
</ul>
<p>Whichever you choose, the rule is the same: write the configuration
down, test that it comes back after a reboot, and only then put the data
on it. A RAID set that has never been assembled from a cold boot is not
yet a backup.</p>
<h2 id="disks-check">Checking a file system</h2>
<p><code class="citerefentry">fsck(8)</code> runs at boot on an unclean
file system. A file system that needs it by hand must be unmounted
first:</p>
<pre><code># umount /data
# fsck -f /dev/rsd1e
# mount /data</code></pre>
<p><code>fsck -n</code> only reports; it changes nothing. The output
names every repaired inode, and a file that was open during a crash can
end up in <code>lost+found</code> at the top of the file system.</p>
<h1 id="pkgsrc">Packages and pkgsrc</h1>
<p>Makronix has two kinds of software: what NetBSD's build puts in the
base system, and what pkgsrc installs under <code>/usr/pkg</code>. The
desktop, Firefox, Thunderbird and the games are pkgsrc packages. The
package tools are NetBSD's; the packages on the medium are built for
Makronix or taken from the NetBSD project.</p>
<h2 id="pkgsrc-tools">The package tools</h2>
<p><code class="citerefentry">pkg_add(1)</code> installs, <code
class="citerefentry">pkg_delete(1)</code> removes, and <code
class="citerefentry">pkg_info(1)</code> asks questions. The package
database is <code>/usr/pkg/pkgdb</code>.</p>
<pre><code>$ pkg_info | less
$ pkg_info -L firefox | less
$ pkg_info -D firefox
$ pkg_info -W /usr/pkg/bin/firefox</code></pre>
<p><code>-L</code> lists the files of a package, <code>-D</code> prints
the message that came with it (where its documentation is, which service
to enable), and <code>-W</code> answers which package owns a file.</p>
<h2 id="pkgsrc-install">Installing a package</h2>
<p><code>/etc/pkg_install.conf</code> names the repository in
<code>PKG_PATH</code>. The installer writes it when the machine is
installed; it points at the package repository on the installation
medium or at the NetBSD project's repository for the release the
packages were built for. With the path set, a package is one
command:</p>
<pre><code># pkg_add firefox
# pkg_add -u firefox
# pkg_delete firefox</code></pre>
<p><code>pkg_add -u</code> updates an installed package to the newest
version the repository has. Without an argument it updates everything
that has a newer version:</p>
<pre><code># pkg_add -uu
# pkg_admin rebuild</code></pre>
<p>An update can replace a library that another program needs. Read the
messages <code>pkg_add</code> prints, and keep the previous package
until the new one has started.</p>
<h2 id="pkgsrc-set">The makronix set and the package database</h2>
<p>The packages that Makronix itself ships are in the “makronix” set,
which the installer unpacks as part of the system. They are not
registered in the package database: they change with a Makronix release,
and <code>pkg_add -u</code> does not touch them. A program that is in
the base set or in the “makronix” set is therefore updated by installing
a new Makronix release, not by a package update. The programs that were
installed with <code>pkg_add</code> (Firefox, Thunderbird, QEMU, the
games) are registered and do update.</p>
<p><code>pkg_info</code> shows the registered packages. If it does not
list MCDE, that is not a defect: MCDE came with the release.</p>
<h2 id="pkgsrc-build">Building from source</h2>
<p>The source set carries pkgsrc in <code>/usr/pkgsrc</code>. A package
is built in its own directory with the NetBSD make:</p>
<pre><code># cd /usr/pkgsrc/www/firefox
# make install clean</code></pre>
<p>The build needs the distfiles for the package and its dependencies.
The source set carries the distfiles of the packages Makronix ships, not
the whole pkgsrc archive; a package outside that set fetches what it
needs, which requires a network connection. The authoritative
description of pkgsrc is The pkgsrc Guide, installed with the tree and
available on the NetBSD project's web site.</p>
<p>A build on the installed machine writes into <code>/usr/pkg</code>
and its work directories under <code>/usr/pkgsrc</code>. It needs free
space — a browser can take several gigabytes while it builds — and it is
the wrong thing to do on a machine with a nearly full disk.</p>
<h2 id="pkgsrc-security">Security updates</h2>
<p><code class="citerefentry">pkg_admin(1)</code> can compare the
installed packages with the published vulnerability list:</p>
<pre><code># pkg_admin audit
# pkg_admin fetch-pkg-vulnerabilities</code></pre>
<p>Makronix enables <code>fetch_pkg_vulnerabilities=YES</code> in
<code>/etc/daily.conf</code>, so the list is fetched daily and <code
class="citerefentry">security(8)</code> reports what it finds to root's
mail. The report is only as good as the list; read it, and update the
packages it names.</p>
<h1 id="printing">Printing, Sound and Power</h1>
<p>Three things a desktop is expected to get right, and three things
NetBSD leaves to the administrator: a printer, sound, and what happens
when the machine is idle or the battery is low.</p>
<h2 id="printing-cups">Printing with CUPS</h2>
<p>Makronix uses the Common UNIX Printing System. The packages cups and
cups-filters are on the medium; the service is <code>cupsd</code> in
<code>/etc/rc.conf</code>. With the service running, a printer is added
with <code class="citerefentry">lpadmin(8)</code>:</p>
<pre><code># echo &#39;cupsd=YES&#39; &gt;&gt; /etc/rc.conf
# /etc/rc.d/cupsd start
# lpadmin -p office -E -v ipp://printer.example/ipp/print -m everywhere
# lpadmin -d office
# lpstat -t</code></pre>
<p><code>-m everywhere</code> asks the printer for its own description,
which is the modern way; a printer that does not answer it needs a
driver package and a PPD file. The web interface at
<code>http://localhost:631</code> does the same through a browser, and
<code>lpoptions -p office -l</code> lists the options of the
printer.</p>
<p>Printing a file is <code class="citerefentry">lpr(1)</code>:</p>
<pre><code>$ lpr -P office document.pdf
$ lpq -P office</code></pre>
<p>CUPS keeps its queues and its logs in <code>/var/spool/cups</code>
and <code>/var/log/cups</code>. A job that stays in the queue is usually
a wrong device address or a printer that is off; the error log says
which.</p>
<h2 id="printing-sound">Sound</h2>
<p>NetBSD's audio device is configured with <code
class="citerefentry">audioctl(1)</code> and <code
class="citerefentry">mixerctl(1)</code>; <code
class="citerefentry">audiocfg(1)</code> lists the devices and lets you
test them:</p>
<pre><code>$ audiocfg list
$ audiocfg test 0
$ mixerctl -a
$ mixerctl -w outputs.master=180</code></pre>
<p>MCDE shows the volume in the bar at the top: a slider in the menu, a
mute switch, and the wheel over the speaker. The setting is the same
mixer that <code>mixerctl</code> changes.</p>
<p>The package pulseaudio and its volume control pavucontrol are on the
medium for programs that expect a PulseAudio server; MCDE itself does
not need one. <code class="citerefentry">audioplay(1)</code> plays a WAV
file without a server, and <code class="citerefentry">aucat(1)</code>
records and plays audio and can act as a sound server.</p>
<h2 id="printing-power">Power and temperature</h2>
<p><code class="citerefentry">envstat(8)</code> shows the sensors the
machine has: temperatures, fan speeds, voltages and the battery. <code
class="citerefentry">powerd(8)</code> adjusts the CPU frequency to the
load, which is what keeps a laptop cool and quiet:</p>
<pre><code># echo &#39;powerd=YES&#39; &gt;&gt; /etc/rc.conf
# /etc/rc.d/powerd start
$ envstat
$ sysctl -a | grep -E &#39;cpu.frequency|machdep.cpu&#39;</code></pre>
<p>A desktop machine can run at full speed all the time; a laptop should
not. The MCDE bar shows the battery when the machine has one, and System
Settings has the screen and sleep settings. On a machine that supports
it, <code class="citerefentry">apm(8)</code> reports the battery and the
AC state as well.</p>
<p>A machine that shuts down without warning is usually hot or has a
failing power supply. Read <code>envstat</code> before you blame the
software; the temperatures are the first number to look at.</p>
<h1 id="network">Networking</h1>
<p>NetBSD's network configuration is small and explicit: an interface is
configured with <code>ifconfig</code>, an address can come from DHCP,
and the routes and the resolver are plain files. Makronix's installer
writes the files for the network you chose; this chapter is for changing
them later.</p>
<h2 id="network-interfaces">Interfaces and addresses</h2>
<pre><code>$ ifconfig -a
$ netstat -rn
$ cat /etc/resolv.conf</code></pre>
<p>The name of an interface is the driver's: <code>wm0</code> for an
Intel Ethernet, <code>re0</code> for a Realtek, <code>ath0</code> or
<code>urtwn0</code> for Wi-Fi, <code>lo0</code> for the loopback. An
address from DHCP is requested by <code
class="citerefentry">dhcpcd(8)</code>:</p>
<pre><code># dhcpcd wm0
# /etc/rc.d/dhcpcd restart</code></pre>
<p>The service reads <code>/etc/rc.conf</code>; with
<code>dhcpcd=YES</code> it configures every interface that is not
configured by a fixed file at boot.</p>
<h2 id="network-fixed">A fixed address</h2>
<p>A machine that should have the same address every time does not need
DHCP. The address belongs in
<code>/etc/ifconfig.</code>&lt;interface&gt;:</p>
<pre><code>inet 192.168.1.20/24</code></pre>
<p>The default route is <code>/etc/mygate</code>:</p>
<pre><code>192.168.1.1</code></pre>
<p>and the resolver is <code>/etc/resolv.conf</code>:</p>
<pre><code>nameserver 192.168.1.1
nameserver 9.9.9.9</code></pre>
<p>Set <code>dhcpcd=NO</code> for that interface, or leave the service
off entirely. The name of the machine is in <code>/etc/myname</code>;
the local names are in <code>/etc/hosts</code>:</p>
<pre><code>127.0.0.1 localhost
192.168.1.20 studio.example studio</code></pre>
<h2 id="network-wifi">Wi-Fi</h2>
<p>A Wi-Fi interface needs its network and passphrase before DHCP can
run. <code class="citerefentry">wpa_passphrase(8)</code> writes the
configuration:</p>
<pre><code># wpa_passphrase &quot;network-name&quot; &quot;the passphrase&quot; &gt; /etc/wpa_supplicant.conf
# chmod 600 /etc/wpa_supplicant.conf
# ifconfig ath0 up
# wpa_supplicant -B -i ath0 -c /etc/wpa_supplicant.conf
# dhcpcd ath0</code></pre>
<p>The service configuration is:</p>
<pre><code>wpa_supplicant=YES
wpa_supplicant_flags=&quot;-B -i ath0 -c /etc/wpa_supplicant.conf&quot;
dhcpcd=YES</code></pre>
<p>The MCDE System Settings network pane lists the networks in reach and
asks for the passphrase; it writes the same files. A USB Wi-Fi adapter
is a second interface with its own name; use that name in the commands
above.</p>
<h2 id="network-test">Testing</h2>
<pre><code>$ ping -c 3 192.168.1.1
$ ping -c 3 www.NetBSD.org
$ route -n get default
$ netstat -an | grep LISTEN</code></pre>
<p>If the first ping works and the second does not, the address and the
route are fine and the resolver or the uplink is not. If neither works,
the interface is down or the cable is not in the right port.
<code>dmesg</code> names the interface the driver found, and
<code>ifconfig</code> shows whether it has an address.</p>
<h1 id="services">DNS, DHCP and NTP</h1>
<p>Three small services make a network usable: something that answers
name lookups, something that hands out addresses, and something that
keeps the clock right. A desktop uses all three as a client; a machine
that serves a network runs the first two as a server.</p>
<h2 id="services-dns">Name resolution</h2>
<p>The resolver reads <code>/etc/resolv.conf</code>. It lists the name
servers in the order they are tried, and the domain that short names
belong to:</p>
<pre><code>search example.lan
nameserver 192.168.1.1
nameserver 9.9.9.9</code></pre>
<p><code>/etc/nsswitch.conf</code> decides where a lookup goes first.
Makronix's installer sets <code>hosts: files mdnsd dns</code>, so the
local file answers first, then the local network names, then DNS. The
local name &lt;name&gt;<code>.local</code> is answered by <code
class="citerefentry">mdnsd(8)</code>.</p>
<p>A machine that should answer DNS for a small network can run <code
class="citerefentry">unbound(8)</code> as a caching resolver, or <code
class="citerefentry">nsd(8)</code> as an authoritative server. Both are
packages; both have their own documentation, and both should be
reachable only from the network they serve. The firewall chapter is the
place to decide that.</p>
<h2 id="services-dhcp">DHCP</h2>
<p>A client runs <code class="citerefentry">dhcpcd(8)</code> and needs
no configuration beyond <code>dhcpcd=YES</code>. A server runs <code
class="citerefentry">dhcpd(8)</code> with a lease file and a subnet
declaration:</p>
<pre><code># cat /etc/dhcpd.conf
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.199;
option routers 192.168.1.1;
option domain-name-servers 192.168.1.1;
default-lease-time 86400;
max-lease-time 604800;
}
# echo &#39;dhcpd=YES&#39; &gt;&gt; /etc/rc.conf
# touch /var/db/dhcpd.leases
# /etc/rc.d/dhcpd start</code></pre>
<p>The interface that serves the network must have a fixed address in
the same subnet (<a href="#network-fixed">A fixed address</a>); a DHCP
server with an address from DHCP is a machine that cannot find itself. A
machine that should always get the same address can be pinned by its
Ethernet address:</p>
<pre><code>host printer {
hardware ethernet 00:11:22:33:44:55;
fixed-address 192.168.1.50;
}</code></pre>
<h2 id="services-ntp">Time</h2>
<p>A correct clock matters for TLS, for mail and for the logs of two
machines that are compared. <code class="citerefentry">ntpd(8)</code> is
the daemon; <code>/etc/ntp.conf</code> names the servers:</p>
<pre><code>server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org</code></pre>
<p>With <code>ntpd=YES</code>, the clock is corrected continuously and
slowly. A clock that is wrong by hours is set once by hand before the
daemon starts:</p>
<pre><code># date 202611151200
# /etc/rc.d/ntpd restart
$ ntpq -p</code></pre>
<p><code>ntpq -p</code> lists the servers, the stratum and the offset. A
server marked with an asterisk is the one the daemon is following. If
none of them answers, the network or the firewall is the problem, not
the clock.</p>
<h1 id="sharing">Remote Access and File Sharing</h1>
<p>A Makronix machine is a Unix machine on a network. It can be reached
with SSH, it can serve files with NFS, SMB or AFP, and it can mount the
shares of other machines. MCDE's file manager shows the network places
that the system has been told about; System Settings has the sharing
controls.</p>
<h2 id="sharing-ssh">SSH</h2>
<p>The installer enables <code class="citerefentry">sshd(8)</code> and
the firewall lets it in. Log in from another machine with your
account:</p>
<pre><code>$ ssh name@studio.example
$ ssh name@studio.local</code></pre>
<p>A key is better than a password and is the only way to log in without
typing one. Create it once, then put the public half on the machines you
log in to:</p>
<pre><code>$ ssh-keygen -t ed25519
$ cat ~/.ssh/id_ed25519.pub | ssh name@studio.example \
&#39;mkdir -p ~/.ssh &amp;&amp; cat &gt;&gt; ~/.ssh/authorized_keys&#39;
$ chmod 700 ~/.ssh; chmod 600 ~/.ssh/authorized_keys</code></pre>
<p><code>scp</code> copies a file, <code>sftp</code> is an interactive
file transfer, and a tunnel forwards a port through the connection:</p>
<pre><code>$ scp report.pdf name@studio.example:/home/name/
$ ssh -L 8080:localhost:80 name@studio.example</code></pre>
<p>The server's configuration is <code>/etc/ssh/sshd_config</code>.
Password logins for root are disabled by default; log in as yourself and
use <code>su</code>. After a change, test the configuration and reload
the daemon:</p>
<pre><code># sshd -t
# /etc/rc.d/sshd reload</code></pre>
<h2 id="sharing-nfs">NFS</h2>
<p>NFS is the native Unix file sharing. The server exports a directory
in <code>/etc/exports</code>:</p>
<pre><code>/home -alldirs -maproot=root -network 192.168.1.0 -mask 255.255.255.0</code></pre>
<p>and runs the daemons:</p>
<pre><code># echo &#39;rpcbind=YES&#39; &gt;&gt; /etc/rc.conf
# echo &#39;nfsd=YES&#39; &gt;&gt; /etc/rc.conf
# echo &#39;mountd=YES&#39; &gt;&gt; /etc/rc.conf
# /etc/rc.d/rpcbind start
# /etc/rc.d/mountd start
# /etc/rc.d/nfsd start
# /etc/rc.d/mountd restart</code></pre>
<p>The client mounts it with <code>mount_nfs</code> or
<code>mount -t nfs</code>:</p>
<pre><code># mount -t nfs 192.168.1.20:/home /mnt</code></pre>
<p>An entry in <code>/etc/fstab</code> makes it permanent.
<code>-maproot=root</code> lets root on the client write as root on the
server; without it, root is mapped to nobody. A share that is open to
the whole network should be a decision, not a default.</p>
<h2 id="sharing-smb">SMB and AFP</h2>
<p>Windows and macOS machines speak SMB; older Macs speak AFP. Makronix
ships both servers as packages:</p>
<pre><code># pkg_add samba4 netatalk4
# echo &#39;smbd=YES&#39; &gt;&gt; /etc/rc.conf
# echo &#39;nmbd=YES&#39; &gt;&gt; /etc/rc.conf
# echo &#39;afpd=YES&#39; &gt;&gt; /etc/rc.conf</code></pre>
<p>The Samba configuration is <code>/usr/pkg/etc/samba/smb.conf</code>.
A minimal share that is visible to one user:</p>
<pre><code>[global]
workgroup = HOME
server string = Makronix
security = user
passdb backend = tdbsam
[share]
path = /home/share
valid users = name
read only = no
browseable = yes</code></pre>
<p>Create the Samba user after the system account exists:</p>
<pre><code># smbpasswd -a name
# /etc/rc.d/smbd start
# /etc/rc.d/nmbd start</code></pre>
<p>AFP is configured in <code>/usr/pkg/etc/netatalk/afp.conf</code>; the
package's documentation has the share syntax for the version that is
installed. MCDE's System Settings has the sharing controls for both, and
its file manager shows a share that is mounted or announced on the
network.</p>
<h2 id="sharing-sshfs">Mounting a remote directory</h2>
<p>When the other machine offers only SSH, SSHFS mounts a directory over
it:</p>
<pre><code># pkg_add fuse-sshfs
$ sshfs name@studio.example:/home/name /mnt/studio
$ umount /mnt/studio</code></pre>
<p>The package afpfs-ng does the same for an AFP server. Both need the
FUSE device and the user's permission to mount; the package message says
which group to join.</p>
<h2 id="sharing-security">Before you open a service</h2>
<p>Every service that listens on the network is a door. Open only the
ones you use, restrict them to the network they serve, and read the
firewall chapter before you connect the machine to a network you do not
control. A file share with a weak password is worse than no file
share.</p>
<h1 id="firewall">The Firewall</h1>
<p>Makronix turns on NetBSD's packet filter, <code
class="citerefentry">npf(7)</code>, and installs a rule set that lets
nothing in that the machine did not ask for. Outgoing connections work,
their replies come back, DHCP and IPv6 set-up work, ping works, SSH
works and the local network names work. Everything else is blocked.</p>
<h2 id="firewall-default">The default rule set</h2>
<p><code>/etc/npf.conf</code> on a freshly installed machine is the
following. It is the rule set that the installer writes and that
<code>/usr/src/docs/reference/npf-default.conf</code> records for
validation:</p>
<pre><code>alg &quot;icmp&quot;
group default {
pass final on lo0 all
# out: everything, with the replies
pass stateful out final all
# DHCP replies (a broadcast, so no state) and IPv6 set-up
pass in final proto udp from any port 67 to any port 68
pass final family inet6 proto ipv6-icmp all
# ping
pass stateful in final family inet4 proto icmp all
# remote login
pass stateful in final proto tcp to any port ssh
# mDNS and DNS-SD (mdnsd): the multicast announcements, port 5353
pass in final proto udp to any port 5353
block in final all
}</code></pre>
<p>Read it from the bottom up: everything that arrives is blocked unless
an earlier rule lets it in. The rules above it are the exceptions.
<code>stateful</code> means that the reply to a connection the machine
started is allowed without a rule of its own.</p>
<h2 id="firewall-open">Opening one port</h2>
<p>A service that should be reachable from the network needs a rule
above the final block. For a web server on port 80, add this line before
<code>block in final all</code>:</p>
<pre><code> pass stateful in final proto tcp to any port 80</code></pre>
<p>Then check the file and reload the running rule set. A rule set with
a syntax error must not be loaded; <code>npfctl validate</code> reads
the file without touching the running one:</p>
<pre><code># npfctl validate /etc/npf.conf
# /etc/rc.d/npf reload
# npfctl show
# npfctl stats</code></pre>
<p><code>npfctl show</code> prints the rules that are active, after the
variables and groups have been expanded. If the line you added is not
there, the reload did not happen; the console and
<code>/var/log/messages</code> say why.</p>
<h2 id="firewall-service">The firewall at boot</h2>
<p>The service is enabled in <code>/etc/rc.conf</code>:</p>
<pre><code>npf=YES</code></pre>
<p>At boot, <code>npf</code> loads <code>/etc/npf.conf</code> before the
network is up. A machine that boots without a rule set is a machine that
is open for the time it takes to notice. After a change, reload rather
than restart; the existing connections survive a reload.</p>
<h2 id="firewall-more">NAT and a router</h2>
<p>A machine that routes between two networks needs NAT and forwarding.
The rules are in <code class="citerefentry">npf.conf(5)</code>; the
shape is a <code>map</code> line for the outgoing interface and
<code>pass</code> rules for the two directions. Forwarding itself is a
<code class="citerefentry">sysctl(8)</code> setting:</p>
<pre><code># sysctl -w net.inet.ip.forwarding=1
# echo &#39;net.inet.ip.forwarding=1&#39; &gt;&gt; /etc/sysctl.conf</code></pre>
<p>A router is a machine with two interfaces and a rule set that
describes both directions. Do not enable forwarding on a desktop that
has one interface; it has nothing to forward between.</p>
<h1 id="mailweb">Mail and the Web</h1>
<p>Two services that a small machine often provides: a mail transfer
agent that delivers local mail, and a web server that serves a
directory. Both are NetBSD base services; Makronix ships the clients and
the desktop programs that read the results.</p>
<h2 id="mailweb-mail">Mail</h2>
<p>The base system's mail transfer agent is Postfix. A desktop that only
needs local mail — the daily security report, cron's output, the
messages of the package tools — runs it with the default configuration
and reads the mail with <code>mail</code> or MCDE's <code
class="citerefentry">dtmail(1)</code>:</p>
<pre><code># echo &#39;postfix=YES&#39; &gt;&gt; /etc/rc.conf
# /etc/rc.d/postfix start
$ mail</code></pre>
<p><code>/etc/postfix/main.cf</code> is the configuration. A machine
that should accept mail from the network sets
<code>inet_interfaces</code> and a proper <code>myhostname</code>, and
needs a DNS name with an MX record. That is a mail server, not a
desktop; the NetBSD Guide's mail chapter and the Postfix documentation
describe the decisions, and the firewall chapter describes the port that
has to be opened.</p>
<p>Local mail is delivered to <code>/var/mail/</code>&lt;name&gt;. If
mail does not arrive, read <code>/var/log/maillog</code>; Postfix writes
there, and <code>postfix check</code> reports a configuration that it
cannot use.</p>
<h2 id="mailweb-web">A web server</h2>
<p>The base system's HTTP server is <code
class="citerefentry">bozohttpd(8)</code>, installed as
<code>httpd</code>. It serves one directory, which is enough for a
documentation page or a small site:</p>
<pre><code># echo &#39;httpd=YES&#39; &gt;&gt; /etc/rc.conf
# echo &#39;httpd_flags=&quot;-b /var/www&quot;&#39; &gt;&gt; /etc/rc.conf
# /etc/rc.d/httpd start
$ curl http://localhost/</code></pre>
<p><code>/var/www</code> is the document root; the index file is
<code>index.html</code>. A server that needs CGI, PHP, TLS or virtual
hosts should use a package: nginx or apache, with their own
documentation and their own service scripts.</p>
<p>TLS needs a certificate. For a public name, the certificate
authority's client (for example certbot) obtains and renews it; for a
name that only the local network uses, a self-signed certificate is
enough, and every client has to be told to trust it. A certificate that
has expired is the most common reason a site that worked yesterday does
not work today.</p>
<h2 id="mailweb-clients">The desktop clients</h2>
<p>Firefox reads the web, Thunderbird reads mail and news, and
<code>dtmail</code> reads local mail in the MCDE style. All three are on
the medium as packages; the installer can put them on the machine, and
<code>pkg_add</code> installs them later (<a href="#pkgsrc">Packages and
pkgsrc</a>). Their settings belong to the user, not to the system, and
live under <code>~/.mozilla</code>, <code>~/.thunderbird</code> and
<code>~/.dt</code>.</p>
<h1 id="building">Building Makronix</h1>
<p>Makronix builds itself from its own sources. The installation medium
can carry those sources, so a machine can be rebuilt without a network;
a development machine does the same with more room and more patience.
This chapter is the map: the source layout, the one entry point, and
what each target produces.</p>
<h2 id="building-layout">The source tree</h2>
<dl>
<dt><code>src/</code></dt>
<dd>
<p>Makronix's NetBSD tree: the kernel, the userland, the build system
and the installer. It is edited directly; there is no patch layer
between it and the system. Upstream NetBSD is in
<code>refs/netbsd/src</code>, for reading.</p>
</dd>
<dt><code>xsrc/</code></dt>
<dd>
<p>The X tree, imported the same way. X is part of the base system: the
server, the drivers, the fonts and the clients are built into the X
sets.</p>
</dd>
<dt><code>pkgsrc/</code></dt>
<dd>
<p>The pkgsrc checkout, pinned. It is not edited; a change is a moved
pin or a package in <code>ext/</code> or the local <code>wip</code>.</p>
</dd>
<dt><code>ext/</code></dt>
<dd>
<p>The third-party trees Makronix ships and changes: MCDE, its Motif
build, afpfs-ng and glibc. Each has its own recipe and its own
<code>IMPORT</code> note.</p>
</dd>
<dt><code>tools/</code></dt>
<dd>
<p>Makronix's own POSIX shell tools: the build stamp, the package list
reader, the set generator, the test harnesses and the MCDE helpers.</p>
</dd>
<dt><code>docs/</code> and <code>www/</code></dt>
<dd>
<p>The contracts and the guide, and the web site. The guide's source is
<code>docs/guide/book.xml</code>.</p>
</dd>
</dl>
<h2 id="building-entry">One entry point</h2>
<p>Everything is built from the top-level <code>Makefile</code>. The
interface is deliberately small:</p>
<pre><code>$ make # the distribution (no medium)
$ make release ARCH=amd64 # through to a finished release
$ make iso # the installation CD/DVD image
$ make usb # the bootable USB image
$ make userland # the pkgsrc packages and the makronix set
$ make sourcesets # the source sets for the medium
$ make test # the tool tests, then the installation tests
$ make install # install over a running Makronix</code></pre>
<p><code>make release</code> builds the sets and the kernels;
<code>make iso</code> packages what the release built; it refuses to run
if a source changed since, because the medium would not match its sets.
<code>make usb</code> needs the source sets under
<code>source/sets</code>; <code>make sourcesets</code> writes them.</p>
<p><code>ARCH</code> is the name a person types: amd64, i386, macppc,
evbarm. On a NetBSD host without <code>ARCH</code>, the host decides; on
a cross host it is amd64 unless named. <code>JOBS</code> sets the
parallelism.</p>
<h2 id="building-cross">Cross and native are one build</h2>
<p>The build detects whether the host is NetBSD or not. A NetBSD host
builds natively with its own toolchain; a Linux or another host
cross-builds the same tree with the toolchain that <code>build.sh</code>
builds first. A package that builds only on one of the two is a defect
in the recipe, not a reason to use a virtual machine.</p>
<p>The pkgsrc packages are built for the target with the same toolchain;
<code>tools/pkgsrc-cross.mk.conf</code> is the whole configuration, and
<code>pkgsrc/</code> itself is not patched. The workarounds in that file
are measured; <a href="#cross">Cross-Building and the Source Tree</a>
explains them and when they can go.</p>
<h2 id="building-output">Where the results land</h2>
<p>The build writes to <code>build/obj</code>: the object tree,
<code>destdir.</code>&lt;arch&gt; and the release directory
<code>releasedir</code>. The logs are in <code>build/logs</code>. A
medium is in <code>releasedir/images</code>; the sets are in
<code>releasedir/</code>&lt;arch&gt;<code>/binary/sets</code>.</p>
<p>The gate is <code>checkflist</code>, run the way NetBSD runs it: the
set lists and what the build actually installed must agree. Extra or
missing files fail the build. A build is done when
<code>checkflist</code> reports neither.</p>
<h2 id="building-device">Building on the installed system</h2>
<p>The source set installs the whole tree to <code>/usr/src</code> — the
NetBSD sources under <code>/usr/src/src</code>, X under
<code>/usr/src/xsrc</code>, pkgsrc under <code>/usr/src/pkgsrc</code>.
Build from <code>/usr/src</code> as a user in the wsrc group:</p>
<pre><code>$ cd /usr/src
$ export MAKRONIX_TOP=/usr/src
$ make release ARCH=amd64</code></pre>
<p>A full self-build needs room for the object tree and the distfiles
and takes hours on a laptop; the first build is the slow one. The source
set is not the development history: it carries the files a rebuild
needs, and <code>PINS</code> names the revisions they came from.</p>
<h2 id="building-tests">Tests</h2>
<p><code>make test</code> runs the tests of the tools first, then the
installation tests: a machine is installed from the medium in QEMU and
must reach a login prompt and shut down cleanly. The MCDE tests run
before the release tests, from a native build of the host. A test that
has never failed has not been tested; the harnesses are in
<code>tools/</code> and each can be run alone.</p>
<h1 id="cross">Cross-Building and the Source Tree</h1>
<p>Makronix is built on NetBSD and on other systems. The same tree, the
same packages and the same release come out; the difference is the
toolchain that <code>build.sh</code> builds first. This chapter is for
the person who works on that build, not for the person who installs the
result.</p>
<h2 id="cross-detect">What the build detects</h2>
<p><code>tools/userland.sh</code> looks at <code>uname -s</code>. On
NetBSD it builds natively with the host's pkgsrc and installs into the
host's <code>/usr/pkg</code>; on anything else it cross-builds with the
toolchain and the sysroot in <code>build/obj</code>. The packages are
the same either way; <code>tools/pkgsrc-cross.mk.conf</code> is the only
configuration that is specific to the cross case, and
<code>pkgsrc/</code> is not patched.</p>
<p>The build's paths come from <code>MAKRONIX_TOP</code>. On a
development machine that is the repository root; on an installed system
with the source set it is <code>/usr/src</code>.</p>
<h2 id="cross-workarounds">The cross workarounds, and why they
exist</h2>
<p>Four settings in <code>tools/pkgsrc-cross.mk.conf</code> were each
added after a measured failure. They are documented in
<code>docs/CROSS.md</code> in the source set; in short:</p>
<ul>
<li><p>fonts/Xft2 runs a C++ probe it does not declare. The cross
configuration adds <code>USE_LANGUAGES+= c c++</code>, which gives it a
real compiler instead of pkgsrc's fail wrapper.</p></li>
<li><p>fonts/Xft2 calls <code>FT_GlyphSlot_Embolden</code> without the
header that declares it after FreeType moved it. The build adds
<code>-include freetype/ftsynth.h</code>. This is a GCC-14 strictness
issue, not a cross issue; the native build may need it too.</p></li>
<li><p>pkgtools/x11-links probes <code>/usr</code> for X headers. In a
cross build that is the host's X, not the target's; the configuration
points it at <code>${CROSS_DESTDIR}/usr/X11R7</code>.</p></li>
<li><p>X's configure passes absolute <code>/usr/X11R7/include</code> and
<code>/usr/X11R7/lib</code>, which do not resolve inside the sysroot.
The build adds the sysroot-relative GCC form
<code>-I=/usr/X11R7/include</code> and
<code>-L=/usr/X11R7/lib</code>.</p></li>
</ul>
<p>Each setting has a removal criterion in <code>docs/CROSS.md</code>:
when the package builds without it in both modes, it goes. A workaround
that outlives its cause is a bug with a comment.</p>
<h2 id="cross-forks">Forks and imported trees</h2>
<p>What Makronix changes is a fork in <code>ext/</code>; what it does
not change is imported and left alone. The NetBSD tree is
<code>src/</code> with its base commit in <code>src/BASE</code>; the X
tree is <code>xsrc/</code> with <code>xsrc/BASE</code>; upstream for
reading is <code>refs/netbsd</code> and <code>refs/linux</code>. The
import of a fork is one commit of the upstream archive, and every change
after it is a visible diff.</p>
<p>MCDE is the largest fork. Its build for the host is
<code>make mcde-host</code>; its Linux build is
<code>make mcde-linux</code>. The host build is what produces
<code>dtdocbook2infolib</code> and <code>dtinfo</code> for the
documentation and for testing without a target machine; the cross build
for the release is part of <code>make userland</code>.</p>
<h2 id="cross-rules">The rules that keep it buildable</h2>
<ul>
<li><p>A package that builds only on one host is broken. Fix the recipe,
the configuration in <code>tools/</code>, or the source in
<code>ext/</code>; do not build it in a virtual machine.</p></li>
<li><p><code>pkgsrc/</code> and <code>refs/</code> are not edited. A
change is a moved pin, recorded in <code>PINS</code>, or a package of
our own.</p></li>
<li><p><code>tools/</code> is POSIX shell: no bash, no Python, no
transient units. A tool that only runs on the author's machine is not a
tool.</p></li>
<li><p>The set list is generated, not written:
<code>tools/makronix-set.sh</code> reads the installed tree back and
writes <code>src/distrib/sets/lists/makronix/mi</code>. A file that is
installed but not in the list fails <code>checkflist</code>.</p></li>
</ul>
<h2 id="cross-platforms">Other platforms</h2>
<p><code>make release ARCH=macppc</code> and the other architectures use
the same tree with a different target. A platform is supported when its
installation has been run to a login prompt; the measured state is in
<code>docs/PLATFORMS.md</code>. Cross building makes the compiler for
that platform; it does not test the firmware, the drivers or the desktop
on it. That is what the hardware is for.</p>
<h1 id="updating">Updating the Desktop</h1>
<p>Makronix is one system: the base, the X server, the desktop and the
packages that came with the release move together. The package tools
update the packages that were installed with them; a Makronix release
updates everything else. This chapter is the practical order.</p>
<h2 id="updating-settings">From System Settings</h2>
<p>Open System Settings and choose Software Update. The dialog reads the
source from the first line of <code>/etc/makronix/update</code>, shows
what it found, and asks for the administrator's password before it
changes anything. It runs <code>sysupgrade</code> for the base system
and then <code>pkg_add -uu</code> for the registered packages. The
machine must be rebooted afterwards.</p>
<p>The source is a directory, a <code>file://</code> address or an
<code>https://</code> address. <code>http://</code> and
<code>ftp://</code> are refused: a base system that is fetched over an
unencrypted connection is a base system that can be changed on the way.
An <code>https://</code> source is protected by TLS; a
<code>file://</code> source is as trusted as the medium it is on. This
release does not verify a signature on the sets, so use a source you
control and keep the previous medium until the new system has
started.</p>
<h2 id="updating-command">From the command line</h2>
<pre><code># cat /etc/makronix/update
https://example.invalid/makronix/0.99.10/amd64
# sysupgrade auto &quot;$(cat /etc/makronix/update)&quot;
# postinstall -s /usr/src/etc fix
# etcupdate -s /usr/src/etc
# pkg_add -uu
# reboot</code></pre>
<p>The order matters: the base system first, then the configuration
merge, then the packages, then the reboot. If <code>sysupgrade</code>
fails, stop there; a half-updated base with new packages is harder to
repair than either one alone.</p>
<h2 id="updating-mcde">MCDE and the makronix set</h2>
<p>The desktop is part of the “makronix” set, which the installer
unpacks as part of the system. It is not in the package database, so
<code>pkg_add -u</code> does not update it; a new Makronix release does.
The same is true of the base system's programs (vim, git-base,
sysupgrade) and of the libraries MCDE needs.</p>
<p>A person who builds Makronix from source updates the desktop by
building the new tree and installing its release; the next chapter
describes the build. A person who only uses the desktop updates it with
the release's own update dialog or medium.</p>
<h2 id="updating-guide">The guide itself</h2>
<p>The guide is generated from <code>docs/guide</code> and installed
with the release. After a change to the guide's source, rebuild it and
install the five forms:</p>
<pre><code>$ cd /usr/src
$ sh docs/guide/build.sh all
$ sh docs/guide/build.sh install</code></pre>
<p>The build needs pandoc, xmllint, mandoc, Chrome or Google Chrome for
the PDF, and a host build of MCDE for the information library.
<code>build.sh check</code> verifies that every form was produced; the
details are in <code>docs/guide/AGENTS.md</code>.</p>
<h2 id="updating-rollback">If an update goes wrong</h2>
<p>The old kernel is <code>/netbsd.old</code> and the loader's menu can
start it. The old configuration is in <code>/etc/rc.conf.old</code>
after <code>postinstall</code> or <code>etcupdate</code> replaced it. On
an encrypted system, the kernel the machine starts is the copy in
<code>/cgdboot</code>; <a href="#upgrade-encrypted">An encrypted
system</a> explains how to put the old one back.</p>
<p>A machine that does not start is not a machine that is lost. Start
the medium, mount the root file system and read the logs; the data is
still there, and the source set can rebuild the system around it.</p>
<h1 id="help">Appendix A: Getting Help</h1>
<p>A Unix system documents itself. The order that works is: the manual
page for the command, the file in <code>/usr/share/doc</code>, the
source, then the network. The network is last because it is the only one
that may be wrong about your version.</p>
<h2 id="help-man">The manual pages</h2>
<p><code>man</code> is described in <a href="#shell-man">Finding the
documentation</a>. The pages that are worth reading before anything else
are:</p>
<ul>
<li><p><code class="citerefentry">afterboot(8)</code> — what to do after
the first boot;</p></li>
<li><p><code class="citerefentry">intro(8)</code> — the system
administration commands and how they fit;</p></li>
<li><p><code class="citerefentry">hier(7)</code> — the file system
layout;</p></li>
<li><p><code class="citerefentry">pkgsrc(7)</code> — pkgsrc and the
package tools;</p></li>
<li><p><code class="citerefentry">rc.conf(5)</code> — the
services;</p></li>
<li><p><code class="citerefentry">npf.conf(5)</code> — the
firewall.</p></li>
</ul>
<h2 id="help-online">The web and the source</h2>
<p>The NetBSD project's documentation is the reference for the parts
Makronix inherited: <code>https://www.NetBSD.org/docs/</code>, the
NetBSD Guide and the manual pages online. For Makronix itself, the
source tree is the last word: <code>/usr/src</code> holds the whole
tree, with the guide, the tools, the build contract and the records of
what was measured.</p>
<p>When you ask for help, give the version (<code>uname -a</code>), the
command you ran, what you expected and what happened. The output of
<code>dmesg</code> and the relevant lines of
<code>/var/log/messages</code> are worth more than a description.</p>
<h2 id="help-guide">This guide in its five forms</h2>
<ul>
<li><p><code>man makronix-guide</code> lists the chapters; each chapter
is a page in section 7.</p></li>
<li><p><code>/usr/share/doc/makronix/makronix-guide.pdf</code> is the
printable form.</p></li>
<li><p><code>/usr/share/doc/makronix/makronix-guide.html</code> is one
file and opens in any browser.</p></li>
<li><p><code>guide.html</code> on the Makronix website is the same text
in the site's window.</p></li>
<li><p><code>dtinfo</code> opens the same text in the MCDE Information
Manager, with search.</p></li>
</ul>
<h1 id="glossary">Appendix B: Glossary</h1>
<p>The words this guide uses in a particular sense.</p>
<dl>
<dt>base system</dt>
<dd>
<p>What NetBSD's build produces and Makronix ships in the NetBSD sets:
the kernel, the C library, the userland, the X server and the manual
pages. It is not in the package database.</p>
</dd>
<dt>CDE</dt>
<dd>
<p>The Common Desktop Environment, the Motif desktop that Sun, HP, IBM,
DEC and others shipped. MCDE is its fork.</p>
</dd>
<dt>cgd</dt>
<dd>
<p>NetBSD's cryptographic disk driver. An encrypted installation is a
cgd over the root file system.</p>
</dd>
<dt>cross build</dt>
<dd>
<p>Building for one machine on another. Makronix's build cross-builds
when the host is not NetBSD and builds natively when it is.</p>
</dd>
<dt>disklabel</dt>
<dd>
<p>The partition table NetBSD keeps on a disk. A GPT label is the modern
form; an MBR label with a NetBSD disklabel inside it is the older
one.</p>
</dd>
<dt>dtinfo</dt>
<dd>
<p>The MCDE Information Manager: the program that reads information
libraries and displays their books.</p>
</dd>
<dt>dtlogin</dt>
<dd>
<p>The MCDE login screen. It starts the X server and the session.</p>
</dd>
<dt>information library</dt>
<dd>
<p>A directory ending in <code>.dti</code> that holds a bookcase, its
books and the full-text index. The Makronix Guide is one.</p>
</dd>
<dt>makronix set</dt>
<dd>
<p>The packages that Makronix ships on the medium and unpacks as part of
the system. MCDE is in it. It is not registered with
<code>pkg_add</code>.</p>
</dd>
<dt>MCDE</dt>
<dd>
<p>The Makronix Common Desktop Environment: the fork of CDE that is
Makronix's desktop.</p>
</dd>
<dt>Motif</dt>
<dd>
<p>The widget toolkit CDE and MCDE are written against.</p>
</dd>
<dt>source set</dt>
<dd>
<p>The Makronix source set: the whole tree -- the NetBSD sources, X, the
extensions in <code>ext/</code>, pkgsrc, the tools, the documentation,
the distfiles and the pins -- installed in <code>/usr/src</code>.</p>
</dd>
<dt>npf</dt>
<dd>
<p>NetBSD's packet filter, the firewall Makronix enables by default.</p>
</dd>
<dt>pkgsrc</dt>
<dd>
<p>The package system that supplies <code>/usr/pkg</code>: a tree of
recipes, the package tools, and binary repositories.</p>
</dd>
<dt>release</dt>
<dd>
<p>Everything a version of Makronix consists of: the sets, the kernels,
the media and the name. 0.99.10 is “Camouflage”.</p>
</dd>
<dt>set</dt>
<dd>
<p>A group of files that the installer can select: the base sets, the X
sets, the games and the source sets. The “makronix” set is the desktop
and its programs.</p>
</dd>
<dt>sysinst</dt>
<dd>
<p>The installer. Makronix's fork has a simple way and the full NetBSD
way.</p>
</dd>
<dt>wsrc</dt>
<dd>
<p>The group that may write the source tree, so that a user can rebuild
the system without becoming root.</p>
</dd>
</dl>
<h1 id="license">Appendix C: Licence and Sources</h1>
<p>A guide is a derived work too. This one follows the structure of The
NetBSD Guide and uses its general NetBSD procedures; the Makronix text,
the MCDE chapters and the five output forms are Makronix's.</p>
<h2 id="license-makronix">Makronix: the CNCL 1.0</h2>
<p>The Makronix text and the tools in this tree are under the CNCL 1.0
(Could Not Care Less). The preface explains what it means; this is the
licence itself, exactly as it is in <code>LICENSE</code> at the top of
the tree.</p>
<pre><code># CNCL — Could Not Care Less License
**Version 1.0**
*No rights reserved. No obligations imposed. Couldn&#39;t care less.*
## Preamble
Software is the product of collective human knowledge.
Every idea builds upon ideas that came before. Every invention stands on
the accumulated discoveries, mistakes, experiments, and imagination of
generations.
We do not believe in artificial boundaries around creativity.
We do not believe that creating something grants us the moral authority
to dictate what others may do with it.
We live in an age where knowledge, tools, and artificial intelligence
make creation accessible to everyone. The distinction between author,
user, modifier, and creator is becoming increasingly meaningless.
We are not here to control what happens next.
We are here to create.
## The License
This software is made available to the world.
Do whatever you want with it.
Use it. Copy it. Modify it. Break it. Fix it. Sell it. Give it away.
Incorporate it into something else. Keep your modifications private.
Publish them. Feed it to AI. Build something nobody has thought of yet.
Use it commercially or personally. Combine it with other software.
Release it under another license.
You owe the original author nothing.
No attribution required. No royalties. No source disclosure. No
reciprocal licensing. No contribution requirements. No permission
needed.
There are no conditions attached to your use of this software.
There is no expectation that you will give anything back.
There is no expectation that you will even care.
## Disclaimer
The software is provided &quot;AS IS&quot;, without warranty of any kind.
The authors accept no responsibility for its use, misuse, modification,
distribution, or consequences.
## The CNCL Principle
We acknowledge that everything we create is built upon something that
existed before us.
We do not claim ownership over the collective intelligence of humanity.
We do not expect recognition, compensation, or control.
Take it. Change it. Make it better. Make it worse. Make something
entirely different.
Or don&#39;t.
We Could Not Care Less.
---
**CNCL — Could Not Care Less.**
*Created for everyone. Controlled by no one.*</code></pre>
<p>The paragraph above is the whole licence. It has no conditions beyond
the disclaimer, and the disclaimer is the only sentence that asks
anything of the reader: do not blame the authors. The preface explains
why Makronix uses it and what it does not cover.</p>
<h2 id="license-netbsd">The NetBSD Guide and NetBSD</h2>
<p>The structure of this guide and the general NetBSD procedures follow
The NetBSD Guide, Copyright (c) 1998-2026 The NetBSD Foundation, Inc.,
which is distributed under the BSD 2-clause licence. NetBSD's source,
which Makronix is built from, keeps its BSD licence and its copyright
notices. The NetBSD Guide is at
<code>https://www.NetBSD.org/docs/guide/en/</code>.</p>
<h2 id="license-cde">CDE and MCDE</h2>
<p>MCDE is a fork of CDE, the Common Desktop Environment. CDE is
Copyright (c) 1993-2012 The Open Group and is distributed under the GNU
Lesser General Public License, version 2 or later. The MCDE changes keep
that licence; the MCDE source is in <code>ext/src/mcde</code> in the
source tree.</p>
<p>The Hack font, which MCDE uses for the terminal and the login screen,
is by Source Foundry and is distributed under the MIT licence.</p>
<h2 id="license-docbook">The book format</h2>
<p>The guide's source is DocBook XML 4.5. The DocBook DTD is Copyright
(c) 1992-2006 OASIS and is distributed under the OASIS licence. The MCDE
Information Manager reads the older DocBook SGML dialect that CDE's
tools define; the guide's build converts the XML to that dialect for the
library.</p>
<h2 id="license-sources">The sources of this guide</h2>
<ul>
<li><p><code>docs/guide/book.xml</code> and
<code>docs/guide/chapters/</code> — the text.</p></li>
<li><p><code>docs/guide/build.sh</code> — the build of the five
forms.</p></li>
<li><p><code>docs/guide/tools/docbook-to-cde.lua</code> — the DocBook
XML to CDE SGML writer.</p></li>
<li><p><code>docs/guide/template-web.html</code> — the website form of
the same text.</p></li>
<li><p><code>docs/logo/</code> — the logo.</p></li>
<li><p><code>www/style.css</code> — the Camouflage palette that the
guide's colours follow.</p></li>
</ul>
<p>The Makronix Guide is installed as manual pages from <code
class="citerefentry">makronix-guide(7)</code>, as
<code>/usr/share/doc/makronix/makronix-guide.pdf</code>, as
<code>/usr/share/doc/makronix/makronix-guide.html</code> and as an
information library in
<code>/etc/dt/infolib/en_US.UTF-8/makronix.dti</code>.</p>
</div>
<div class="footer">Makronix is based on <a href="https://www.NetBSD.org/">NetBSD</a>.
MCDE is a fork of <a href="https://sourceforge.net/projects/cdesktopenv/">CDE</a>.
This site: makronix.hiddenbox.org</div>
</div>
</body>
</html>