tested on ubuntu/bionic and slackware14.2
fsck_ext2fs
has been enhanced therefore this is now possible since netbsd-current Sun Mar 31 13:16:52 2019 UTC (revs 1.36 - 1.39)
The script has been tested against XEN/PV, XEN/HVM and bare-metal.
bare-metal
cd ~/
XEN PV or HVM
guest=netbsdext2fs xl des $guest rm -f /data/guests/$guest/ mkdir -p /data/guests/$guest/ cd /data/guests/$guest/
and prepare the script
wget https://pub.nethence.com/bin/bsd/netbsd.install.bash.txt cp netbsd.install.bash.txt netbsd.install.bash chmod +x netbsd.install.bash
point to either previously fetched current or release branch and define network parameters that will be pushed into the guest image
cat ~/.ssh/id_*.pub mkdir $guest/ cd $guest/ vi network.conf sets=/data/kernels/netbsd9 kernel=/data/kernels/netbsd9 #sets=/tftpboot/netbsd9/amd64/binary/sets #kernel=/tftpboot/netbsd9/amd64/binary/kernel pubkey="YOUR-PUBKEY-HERE" #internal network goes to second nic netif=xennet1 host=netbsdext2fs cidr=x.x.x.x/xx #may be empty gw=x.x.x.x #dns="208.67.222.222 208.67.222.222" dns="62.210.16.6 62.210.16.7"
the script will mount and unmuont /mnt/
from either /dev/sda1
./netbsd.install.bash -h #./netbsd.install.bash baremetal
or from <guest>.sparse
../netbsd.install.bash pv $guest #../netbsd.install.bash hvm $guest
MAKEDEV -u
would be enough?/etc/rc.local
(after some daemons have been loaded)?Disk partitioning https://en.wikipedia.org/wiki/Disk_partitioning
Partition type https://en.wikipedia.org/wiki/Partition_type