We provide many forms of installation media, but neither floppy nor
iso images are "best" suited for usb drives.  It's pretty easy to make
a hard drive image containing the installer bsd.rd.

I tested this on i386, it should work on amd64 too.  It's just a bunch
of shell commands, save it to makeimage.sh or whatever.  Maybe we
could integrate this into the distrib build makefiles, but I wanted to
get a procedure done first.  I don't know what the best way to get a
disklabel on is, I just dumped a tiny bit of text into a file.

It's actually very similar to what builds the install.iso, but I
didn't do it as a makefile for now so it's easier for standalone users
to run.

It assumes you have a working bsd.rd in /.  If you wanted to build
amd64 on i386, or vice versa, you'll have to fiddle with the files.

#!/bin/sh
set -e
cp /bsd.rd .
gzip -9 bsd.rd
dd if=/dev/zero bs=1k count=3584 of=disk.img
sudo vnconfig vnd0 disk.img
sudo fdisk -y -i vnd0
echo "16 partitions:" > disklabel.txt
echo "#                size           offset  fstype [fsize bsize  cpg]" >> 
disklabel.txt
echo "  a:             6944              128  4.2BSD   2048 16384    1" >> 
disklabel.txt
echo "  c:             7168                0  unused" >> disklabel.txt
disklabel -R vnd0 disklabel.txt
newfs -i 512000 vnd0a
mount /dev/vnd0a /mnt
cp bsd.rd.gz /mnt/bsd
cp /usr/mdec/boot /mnt/boot
/usr/mdec/installboot /mnt/boot /usr/mdec/biosboot vnd0
umount /mnt
vnconfig -u vnd0
rm bsd.rd.gz
rm disklabel.txt

Reply via email to