apt-get install -y \
	libsort-versions-perl\
       	libyaml-pp-perl \
       	libboolean-perl \
       	mbuffer \
       	kexec-tools \
	fzf

# https://raw.githubusercontent.com/zbm-dev/zfsbootmenu/master/etc/zfsbootmenu/config.yaml
cat <<-EOF | sudo tee "/etc/zfsbootmenu/config.yaml"
	Global:
	  ManageImages: false
	  BootMountPoint: /boot/efi
	  DracutConfDir: /etc/zfsbootmenu/dracut.conf.d
	  PreHooksDir: /etc/zfsbootmenu/generate-zbm.pre.d
	  PostHooksDir: /etc/zfsbootmenu/generate-zbm.post.d
	  InitCPIOConfig: /etc/zfsbootmenu/mkinitcpio.conf
	Components:
	  ImageDir: /boot/efi/EFI/zbm
	  Versions: 3
	  Enabled: true
	EFI:
	  ImageDir: /boot/efi/EFI/zbm
	  Versions: false
	  Enabled: false
	Kernel:
	  CommandLine: ro quiet loglevel=0
EOF

# example syslinux.cfg
cat <<-EOF
	UI menu.c32
	PROMPT 0

	MENU TITLE ZFSBootMenu
	TIMEOUT 50

	DEFAULT zfsbootmenu

	LABEL zfsbootmenu
	  MENU LABEL ZFSBootMenu
	  KERNEL /zfsbootmenu/vmlinuz-bootmenu
	  INITRD /zfsbootmenu/initramfs-bootmenu.img
	  APPEND zfsbootmenu quiet loglevel=0

	LABEL zfsbootmenu-backup
	  MENU LABEL ZFSBootMenu (Backup)
	  KERNEL /zfsbootmenu/vmlinuz-bootmenu-backup
	  INITRD /zfsbootmenu/initramfs-bootmenu-backup.img
	  APPEND zfsbootmenu quiet loglevel=0
EOF
