Hi folks!
I'm trying to install FreeBSD on an SD card, but with the /cfg stored on a zpool. Here is my approach:
I know it's very ugly, but simply creating a ZFS automounted under /cfg didn't work because of the zpool.cache file missing. With this /cfg/rc.conf, at least the network is being configured, however the hostname(1) NOT being set:
Questions:
Greetings,
/dev
I'm trying to install FreeBSD on an SD card, but with the /cfg stored on a zpool. Here is my approach:
Code:
FlashDevice generic 2g
NANO_BOOTLOADER="/boot/boot0"
NANO_MODULES="default"
NANO_LABEL="nanobsd"
cust_zfs_load () (
touch ${NANO_WORLDDIR}/boot/loader.conf
echo "zfs_load=\"YES\"" >> ${NANO_WORLDDIR}/boot/loader.conf
rm -r ${NANO_WORLDDIR}/boot/zfs
ln -s /etc/zfs ${NANO_WORLDDIR}/boot/zfs
sed -i '' -e ',/cfg,d' ${NANO_WORLDDIR}/etc/fstab
echo "nanobsd/cfg /cfg zfs rw 0 0" >> ${NANO_WORLDDIR}/etc/fstab
sed -i '' -e 's,mount -a -t,zpool import nanobsd; cp -R /cfg/* /etc; mount -a -t,' ${NANO_WORLDDIR}/etc/rc.d/mountcritlocal
)
cust_root () (
echo $PASSWORD | chroot ${NANO_WORLDDIR} pw usermod root -h 0
)
customize_cmd cust_zfs_load
customize_cmd cust_root
customize_cmd cust_allow_ssh_root
Code:
hostname="nanobsd.local"
ifconfig_em0="DHCP"
Questions:
- Why doesn't setting the hostname work this way while setting up networking works? (The hostname variable is simply ignored)
- How can this be done without changing code under /etc/rc.d and so that it works?
- I had to set NANO_BOOTLOADER and NANO_MODULES to restore default behavior. Are there other things I need to revert to make NanoBSD behave like plain FreeBSD (besides the read-only stuff, which of course still should be the case)?
- Is there a way to make /var persistent? How can I remove the /var md(4) (and use /var from zpool)?
Greetings,
/dev