shithub: wiki.9front.org

Download patch

ref: 3d75111b22c57bd7a99c98c37ff99dbd1e7d4166
parent: ee6451c69c83ba28d6d1727909a233a618935050
author: kvik <kvik@a-b.xyz>
date: Sat Aug 1 12:27:26 EDT 2020

kernel-iso: rewrite a bit

--- a/kernel-iso.md
+++ b/kernel-iso.md
@@ -1,28 +1,31 @@
-Building a kernel only 9front ISO
-===================================
+Building a kernel-only 9front ISO
+=================================
 
-For times in which PXE is not avaible, it can be useful
-to have access to an ISO file that just contains a kernel
-for booting machines and then having them tls/tcp boot from
-a file server. 
+In situations where PXE booting is not possible it can be useful to have
+an ISO file containing just the 9front kernel for booting the machine and
+having it continue with TLS/TCP mount of the file server.
 
-This guide will be assuming you have a file and auth server somewhere on your network,
-and that you plan to boot a amd64 kernel on the target machine.
+It is assumed that file and auth servers have already been set up.
 
-Lets start with a plan9.ini for our target system:
+Start with a `plan9.ini` with parameters suitable for the target machine
+and network.
 
-	bootfile=/amd64/9pc64
+`/tmp/plan9.ini`
+
 	cdboot=yes
-	mouseport=ps2
-	monitor=vesa
-	vgasize=1024x768x16
+	bootfile=/amd64/9pc64
 	auth=192.168.1.6
 	fs=192.168.1.5
 	user=moody
 	bootargs=tls
+	#
+	mouseport=ps2
+	monitor=vesa
+	vgasize=1024x768x16
 
+Create a `proto(2)` file describing the resultant ISO file tree:
 
-Next we will need a proto file for disk/mk9660:
+`/tmp/9boottree`
 
 	uid=sys
 	gid=sys
@@ -39,15 +42,18 @@
 	amd64	d775
 		9pc64	664
 
+Populate the source file tree.  This could be done by copying only the
+needed files into a temporary directory, but it is easier to reuse the
+root filesystem, replacing any files that need replacing — `plan9.ini`
+in this case:
 
-For a small script to generate the ISO file itself:
+	bind /tmp/plan9.ini /root/cfg/plan9.ini
 
-	#!/bin/rc
-	rfork n
-	bind /root /n/src9
-	bind plan9.ini /n/src9/cfg/plan9.ini
-	disk/mk9660 -c9j -B 386/9bootiso \
-		-p 9bootproto \
-		-s /n/src9 -v 'Plan 9' kern.iso
+Finally, build the ISO file with `disk/mk9660(8)`:
 
-This results in a `kern.iso` file being created in the current directory.
+	disk/mk9660 -c9j \
+		-B /386/9bootiso \
+		-s /root -p /tmp/9boottree \
+		-v 'Plan 9' kern.iso
+
+Burn the resulting `kern.iso` to a suitable drive.