zbm-dev/zfsbootmenu

generate-zbm fails with non-standard PREFIX

Closed this issue · 1 comments

drbawb commented

Hi, I recently tried to update zfsbootmenu and ran into a small problem.

  1. I built zfsbootmenu from source using commit fabe14ebecbaf4a77fb1db545c6dafbf8d26f146 with PREFIX=/usr/local.
  2. I'm using Arch Linux Linux nagato 6.2.10-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 07 Apr 2023 02:10:43 +0000 x86_64 GNU/Linux
  3. dracut --version is dracut 056
  4. I subsequently ran generate-zbm with my existing config:
Global:
  ManageImages: true
  BootMountPoint: /boot/efi_44k
  DracutConfDir: /etc/zfsbootmenu/dracut.conf.d
Components:
  ImageDir: /boot/efi_44k/EFI/zbm
  Versions: 3
  Enabled: true
  syslinux:
    Config: /boot/syslinux/syslinux.cfg
    Enabled: false
EFI:
  ImageDir: /boot/efi_44k/EFI/zbm
  Versions: false
  Enabled: false
Kernel:
  CommandLine: rw quiet loglevel=0 spl.spl_hostid=0x2a0a6b80
  Version: '%{current}'
  Path: /boot/vmlinuz-linux

I receive the following error:

/usr/lib/dracut/modules.d/90zfsbootmenu/module-setup.sh: line 35: /usr/share/zfsbootmenu/install-helpers.sh: No such file or directory
dracut: Unable to source /usr/share/zfsbootmenu/install-helpers.sh
Failed to create /tmp/luf9Z1bJ9i/zfsbootmenu.img

The issue seems to be that on line 32 of the new /usr/lib/dracut/modules.d/90zfsbootmenu/module-setup.sh that was installed on my system it does not include the prefix I passed to make. The fix was to manually patch that from

install() {
  : "${zfsbootmenu_module_root:=/usr/share/zfsbootmenu}"

to:

install() {
  : "${zfsbootmenu_module_root:=/usr/local/share/zfsbootmenu}"

Apart from this I'm very pleased to report that I had no other issues with a pretty substantial upgrade of ZBM on my system.

The easiest non-patching solution is to add zfsbootmenu_module_root="/usr/local/share/zfsbootmenu" to a file in /etc/zfsbootmenu/dracut.conf.d . I'll see if we can automate setting that based on a custom PREFIX value set during install time.