summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BACKLOG.md1
-rwxr-xr-xdeploy2
-rw-r--r--files/installiso-0.1.0.tar.gzbin0 -> 4733 bytes
-rw-r--r--files/installiso.8-0.1.0.html180
-rw-r--r--posts/first-release-of-installiso.md (renamed from _drafts/first-release-of-installiso.md)26
5 files changed, 189 insertions, 20 deletions
diff --git a/BACKLOG.md b/BACKLOG.md
index 5b7b7f4..5b8bed1 100644
--- a/BACKLOG.md
+++ b/BACKLOG.md
@@ -59,7 +59,6 @@
* SQLite hexastore vs. Neo4j
* Setup a FreeBSD sftp server with basic email notifications from the command-line using bash, ssh, and the DigitalOcean command-line application
* Cloud/VPS provider comparison
-* goaccess log format for OpenBSD httpd
* Practical, cross-platform, append-only backups using restic, rclone, and ssh: ready to use scripts/shortcuts for OpenBSD, Linux, macOS, Windows 10
* nix vs. guix
* Find man(1) pages interactively using fzf(1), see ~/.kshrc
diff --git a/deploy b/deploy
index f748a4e..bd260ac 100755
--- a/deploy
+++ b/deploy
@@ -5,7 +5,7 @@
# Re-generates the static website from source and asserts a clean working tree
# before uploading the website to the server.
#
-# Submits the live sitemap to Google and Bing.
+# Submits the sitemap URL to Google and Bing.
set -o errexit
set -o nounset
diff --git a/files/installiso-0.1.0.tar.gz b/files/installiso-0.1.0.tar.gz
new file mode 100644
index 0000000..e063852
--- /dev/null
+++ b/files/installiso-0.1.0.tar.gz
Binary files differ
diff --git a/files/installiso.8-0.1.0.html b/files/installiso.8-0.1.0.html
new file mode 100644
index 0000000..31c06af
--- /dev/null
+++ b/files/installiso.8-0.1.0.html
@@ -0,0 +1,180 @@
+<!DOCTYPE html>
+<html>
+<!-- This is an automatically generated file. Do not edit.
+ Copyright (c) 2021 Stefan Kreutz <mail@skreutz.com>
+
+ Permission to use, copy, modify, and distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ -->
+<head>
+ <meta charset="utf-8"/>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
+ <style>
+ table.head, table.foot { width: 100%; }
+ td.head-rtitle, td.foot-os { text-align: right; }
+ td.head-vol { text-align: center; }
+ .Nd, .Bf, .Op { display: inline; }
+ .Pa, .Ad { font-style: italic; }
+ .Ms { font-weight: bold; }
+ .Bl-diag > dt { font-weight: bold; }
+ code.Nm, .Fl, .Cm, .Ic, code.In, .Fd, .Fn, .Cd { font-weight: bold;
+ font-family: inherit; }
+ </style>
+ <title>INSTALLISO(8)</title>
+</head>
+<body>
+<table class="head">
+ <tr>
+ <td class="head-ltitle">INSTALLISO(8)</td>
+ <td class="head-vol">System Manager's Manual</td>
+ <td class="head-rtitle">INSTALLISO(8)</td>
+ </tr>
+</table>
+<div class="manual-text">
+<section class="Sh">
+<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
+<p class="Pp"><code class="Nm">installiso</code> &#x2014;
+ <span class="Nd">Customize OpenBSD installation images</span></p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
+<table class="Nm">
+ <tr>
+ <td><code class="Nm">installiso</code></td>
+ <td>[<code class="Fl">-v</code>] <var class="Ar">command</var>
+ [<var class="Ar">arg ...</var>]</td>
+ </tr>
+</table>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
+<p class="Pp">The <code class="Nm">installiso</code> utility facilitates
+ creating custom ISO 9660 installation images for the unattended installation
+ of <span class="Ux">OpenBSD</span>.</p>
+<p class="Pp">The common options are as follows:</p>
+<dl class="Bl-tag">
+ <dt id="v"><a class="permalink" href="#v"><code class="Fl">-v</code></a></dt>
+ <dd>Verbose mode. Causes <code class="Nm">installiso</code> to print
+ informative messages. Multiple <code class="Fl">-v</code> options increase
+ the verbosity. The maximum is 2. By default,
+ <code class="Nm">installiso</code> is quiet.</dd>
+</dl>
+<p class="Pp">The commands are as follows:</p>
+<dl class="Bl-tag">
+ <dt id="fetch"><a class="permalink" href="#fetch"><code class="Cm">fetch</code></a>
+ [<code class="Fl">-f</code>] [<code class="Fl">-m</code>
+ <var class="Ar">mirror</var>] [<code class="Fl">-r</code>
+ <var class="Ar">release</var>] [<code class="Fl">-p</code>
+ <var class="Ar">key</var>] [<code class="Fl">-o</code>
+ <var class="Ar">output</var>]</dt>
+ <dd>Download and verify an official ISO 9660 installation image.
+ <dl class="Bl-tag">
+ <dt id="f"><a class="permalink" href="#f"><code class="Fl">-f</code></a></dt>
+ <dd>Force overwriting existing files. By default,
+ <code class="Cm">fetch</code> will not overwrite existing files.</dd>
+ <dt id="m"><a class="permalink" href="#m"><code class="Fl">-m</code></a>
+ <var class="Ar">mirror</var></dt>
+ <dd>The HTTP(S) <span class="Ux">OpenBSD</span>
+ <var class="Ar">mirror</var> to use. Defaults to the mirror specified
+ by <a class="Xr">installurl(5)</a> or else
+ <a class="Lk" href="https://cdn.openbsd.org/pub/OpenBSD/">https://cdn.openbsd.org/pub/OpenBSD/</a>.</dd>
+ <dt id="r"><a class="permalink" href="#r"><code class="Fl">-r</code></a>
+ <var class="Ar">release</var></dt>
+ <dd>The <span class="Ux">OpenBSD</span> <var class="Ar">release</var>.
+ Defaults to the latest development snapshot of -current.</dd>
+ <dt id="p"><a class="permalink" href="#p"><code class="Fl">-p</code></a>
+ <var class="Ar">key</var></dt>
+ <dd>The public <a class="Xr">signify(1)</a> <var class="Ar">key</var> used
+ to verify the downloaded installation image. Defaults to the key
+ <span class="Pa">/etc/signify/openbsd-*-base.pub</span> corresponding
+ to the downloaded release.</dd>
+ </dl>
+ </dd>
+ <dt id="patch"><a class="permalink" href="#patch"><code class="Cm">patch</code></a>
+ [<code class="Fl">-f</code>] [<code class="Fl">-i</code>
+ <var class="Ar">install_conf</var>] [<code class="Fl">-u</code>
+ <var class="Ar">upgrade_conf</var>] [<code class="Fl">-s</code>
+ <var class="Ar">site_dir</var>] <var class="Ar">input</var>
+ <var class="Ar">output</var></dt>
+ <dd>Patch an ISO 9660 installation image.
+ <dl class="Bl-tag">
+ <dt id="f~2"><a class="permalink" href="#f~2"><code class="Fl">-f</code></a></dt>
+ <dd>Force overwriting existing files. By default,
+ <code class="Cm">patch</code> will not overwrite existing files.</dd>
+ <dt id="i"><a class="permalink" href="#i"><code class="Fl">-i</code></a>
+ <var class="Ar">install_conf</var></dt>
+ <dd>Insert an <a class="Xr">autoinstall(8)</a> response file for
+ unattended installation.</dd>
+ <dt id="u"><a class="permalink" href="#u"><code class="Fl">-u</code></a>
+ <var class="Ar">upgrade_conf</var></dt>
+ <dd>Insert an <a class="Xr">autoinstall(8)</a> response file for
+ unattended upgrade.</dd>
+ <dt id="s"><a class="permalink" href="#s"><code class="Fl">-s</code></a>
+ <var class="Ar">site</var></dt>
+ <dd>Package and insert the directory <var class="Ar">site</var> as a
+ site-specific file set.</dd>
+ <dt><var class="Ar">input</var></dt>
+ <dd>The <var class="Ar">input</var> installation image file.</dd>
+ <dt><var class="Ar">output</var></dt>
+ <dd>The <var class="Ar">output</var> installation image file.</dd>
+ </dl>
+ </dd>
+</dl>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="EXIT_STATUS"><a class="permalink" href="#EXIT_STATUS">EXIT
+ STATUS</a></h1>
+<p class="Pp">The <code class="Nm">installiso</code> utility exits&#x00A0;0 on
+ success, and&#x00A0;&gt;0 if an error occurs.</p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1>
+<p class="Pp">Fetch the latest development snapshot:</p>
+<div class="Bd Pp Bd-indent Li">
+<pre>$ installiso -v fetch</pre>
+</div>
+<p class="Pp">Fetch a specific release:</p>
+<div class="Bd Pp Bd-indent Li">
+<pre>$ installiso -v fetch -r 6.9</pre>
+</div>
+<p class="Pp">Create a custom image for unattended installation:</p>
+<div class="Bd Pp Bd-indent Li">
+<pre>$ doas installiso -v patch -i install.conf install69.iso custom.iso</pre>
+</div>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
+ ALSO</a></h1>
+<p class="Pp"><a class="Xr">autoinstall(8)</a>, <a class="Xr">mkhybrid(8)</a>,
+ <a class="Xr">rdsetroot(8)</a>, <a class="Xr">sysupgrade(8)</a>,
+ <a class="Xr">vnconfig(8)</a></p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
+<p class="Pp"><span class="An">Stefan Kreutz</span>
+ &lt;<a class="Mt" href="mailto:mail@skreutz.com">mail@skreutz.com</a>&gt;</p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="BUGS"><a class="permalink" href="#BUGS">BUGS</a></h1>
+<p class="Pp">The <code class="Nm">installiso</code> utility is currently
+ limited to the amd64 architecture because it wasn't tested on any other
+ architecture.</p>
+</section>
+</div>
+<table class="foot">
+ <tr>
+ <td class="foot-date">July 24, 2021</td>
+ <td class="foot-os">OpenBSD 6.9</td>
+ </tr>
+</table>
+</body>
+</html>
diff --git a/_drafts/first-release-of-installiso.md b/posts/first-release-of-installiso.md
index 7c6537d..c0d5502 100644
--- a/_drafts/first-release-of-installiso.md
+++ b/posts/first-release-of-installiso.md
@@ -4,11 +4,6 @@ description: "A utility to customize OpenBSD installation images for unattended
published: 2021-07-24
---
-<!-- TODO: Test all commands -->
-<!-- TODO: Reset git history, tag release, build tarball, and man page -->
-<!-- TODO: Test all links -->
-<!-- TODO: Update date -->
-
One year ago I [posted](/posts/autoinstall-openbsd-on-qemu/) how to script an unattended installation of OpenBSD on the QEMU virtual machine monitor on Linux.
The script involved setting up a complicated network boot environment because I treated the installation image as a black box.
Of course, I could have mounted the ISO 9660 image and created a modified image using [`mkisofs(8)`](http://cdrtools.sourceforge.net/private/man/cdrecord/mkisofs.8.html).
@@ -86,7 +81,7 @@ Second, we create a site-specific file set.
set -o errexit
# Set OpenBSD mirror server used by pkg_add(1) and other commands.
- echo "https://cdn.openbsd.org/pub/OpenBSD" > /etc/installurl
+ echo "$( grep -v -e '^#' -e '^[:space:]*$' /etc/installurl )" > /etc/installurl
# Permit user group wheel to run any command as root
# without entering their password using doas(1).
@@ -95,6 +90,7 @@ Second, we create a site-specific file set.
# Install packages on the first boot.
echo "pkg_add sqlite3" >> /etc/rc.firsttime
EOF
+ $ chmod +x site/install.site
Third, fetch and patch an installation image as above.
@@ -125,9 +121,9 @@ You can supply a custom disklabel template instead if you need more control.
First, create a disklabel template.
$ cat >disklabel_template <<EOF
- / 5G
- swap 1G
- /home 2G
+ / 5G
+ swap 1G
+ /home 2G
EOF
Second, add a corresponding URL to the response file.
@@ -137,7 +133,7 @@ Second, add a corresponding URL to the response file.
Finally, serve the file during the unattended installation.
$ printf 'HTTP/1.0 200 OK\n\n' |
- cat - disklabel |
+ cat - disklabel_template |
nc -lN 8080
## Inner workings
@@ -147,7 +143,7 @@ The `installiso patch` command used above
$ doas installiso -v \
patch -i install.conf -s site/ install69.iso custom.iso
-boils down to the following commands, excluding error handling, temporary files, options, etc.
+boils down to the following commands -- excluding error handling, temporary files, command-line options, etc.
First, we extract the ISO 9660 image.
@@ -163,7 +159,7 @@ Second, we patch the RAMDISK kernel.
# gzip -d -o bsd.rd cd/6.9/amd64/bsd.rd
# rdsetroot -x bsd.rd disk.fs
# vnconfig vnd0 disk.fs
- # mount /dev/vnd0a" /mnt
+ # mount /dev/vnd0a /mnt
# install -o root -g wheel -m 0644 -C \
install.conf /mnt/auto_install.conf
# umount /mnt
@@ -185,9 +181,3 @@ Finally, we create the bootable ISO 9660 image.
-b 6.9/amd64/cdbr -c 6.9/amd64/boot.catalog \
cd
-[^tmpdir]:
-The `installiso` utility may fail due to not enough space in `/tmp`.
-If so, you can set the `TMPDIR` environment variable of [`mktemp(1)`](https://man.openbsd.org/OpenBSD-6.9/mktemp).
-Remember that [`doas(1)`](https://man.openbsd.org/OpenBSD-6.9/doas) creates a new environment by default, though.
-You can either configure `doas(1)` to keep the `TMPDIR`, or you execute a shell:
-`doas sh -c 'TMPDIR=/path/to/tmp installiso patch ...'`.
Generated by cgit. See skreutz.com for my tech blog and contact information.