DISTRO_NAME is based on the partition names in /boot.
For example debianjessie for the partitionn boot_debianjessie.
+For a system without libreboot, which is failing completely to
+boot on one distro, here is how I did a chboot for it:
+# arch-pxe had been run previously
+pxe-server treetowl arch
+# reboot treetowl into arch live env
+pxe-server # disable pxe server
+ssh root@treetowl
+lsblk # identify boot dev. if boot dev is a raid, this could be repeated on all boot devs.
+mount /dev/sdd3 /mnt
+mount_point=/mnt/boot_debiantesting # the subvol i want to chboot to
+boot_disk=/dev/sdd
+grub-bios-setup -d $mount_point/grub/i386-pc -s -m $mount_point/grub/device.map $boot_disk
+reboot
+
+todo: figure out if it's possible to make a multi-distro grub like I have with libreboot
+for non-libreboot systems
+
-r Do not reboot.
-d Enable debug output.
-h|--help Print help and exit.
# https://www.gnu.org/software/grub/manual/html_node/Device-map.html
e grub-bios-setup -d $mount_point/grub/i386-pc -s -m $mount_point/grub/device.map $boot_disk
-# todo, mount_point needs subvolid=0
-
e umount $mount_point
-e mount $boot_disk$grub_extn $mount_point
+# i don't change the default subvolid, so the arg here is just being cautious
+e mount -o subvolid=0 $boot_disk$grub_extn $mount_point
e grub-editenv $mount_point/grubenv set last_boot=/boot_$distro
e grub-editenv $mount_point/grubenv set did_fai_check=true
e umount $mount_point
usage() {
cat <<EOF
Usage: ${0##*/} [OPTIONS] [HOST TYPE]
-One line description
+Configure dnsmasq pxe server options and fai-chboot if appropriate.
+
Without HOST TYPE, disable pxe server and fai server.
TYPE is one of arch, plain, fai.
HOST is a hostname known to the dhcp server, or default for all
+Note, when switching between plain and arch, you will need to
+do something like:
+ssh wrt
+cd /mnt/usb
+rm tftpboot
+ln -s <arch/debian iso dir> tftpboot
+
-r Don't redeploy fai config. For example, if there is a different host
that is mid-install.