NAME
mkusbboot – generate bootable USB or other disk image for PC

SYNOPSIS
mkusbboot [ –b boot ] [ –p proto ] [ –r root ] [ –s size ]

DESCRIPTION
Mkusbboot generates a bootable disk image, called image, from the filesystem at root (by default /n/boot), using the mkfs(8) prototype file proto and files in /sys/lib/sysconfig/usb. The default boot program is /386/9loadusb.

The image will be exactly size*1,000,000 bytes long. By default, it will be 1,900,000,000 bytes long, so it should fit on so–called 2 GB USB devices. When building from /n/sources/plan9, the image defaults to 900,000,000 bytes long, to fit so–called 1 GB USB devices.

The image contains 9fat and fossil(4) file systems and is configured to be bootable as a CPU server with serial console on 386 (with optional VGA) or amd64 machines, when copied to a (possibly USB) disk. There is an nvram partition, initially zeroed.

EXAMPLES
Create a bootable USB flash drive from the local Plan 9 installation.
mkusbboot
pump <image >/dev/sdU0.0/data

Create a bootable disk from the local Plan 9 installation.
mkusbboot –b /386/9load
pump <image >/dev/sdC0/data

FILES
image             the resulting disk image
/sys/lib/sysconfig/usb
plan9.ini
and fossil.conf for the generated system
/sys/lib/sysconfig/proto/stand–usb
default proto
/env/objtype       architecture of the default kernel in the disk image
/tmp/9load         files created while executing
/tmp/9pccpuf.gz
/srv/fossil
/srv/fossil.open
/srv/fscons
/srv/fscons.open

SOURCE
/rc/bin/mkusbboot

SEE ALSO
usb(4), boot(8), 9boot(8), diskparts(8), loadfossil(8), partfs(8), plan9.ini(8), prep(8)

BUGS
Due to name clashes in /srv, should be run only on machines with no running fossil instance named fossil and thus no /srv/fossil, /srv/fossil.open, etc.

Not all BIOSes can reliably read from USB devices. Your mileage may vary.

Copyright © 2024 Plan 9 Foundation. All rights reserved.