Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various Packaging issues on Debian (Stretch/Buster) and likely Ubuntu #6606

Closed
jwittlincohen opened this issue Sep 6, 2017 · 3 comments · Fixed by #7158
Closed

Various Packaging issues on Debian (Stretch/Buster) and likely Ubuntu #6606

jwittlincohen opened this issue Sep 6, 2017 · 3 comments · Fixed by #7158
Labels
Component: Packaging custom packages

Comments

@jwittlincohen
Copy link
Contributor

jwittlincohen commented Sep 6, 2017

Type Version/Name
Distribution Name Debian
Distribution Version Stretch (9.1) and Buster (Testing)
Linux Kernel Stretch (4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u3) and Buster (4.12.0-1-amd64 #1 SMP Debian 4.12.6-1)
Architecture AMD64
ZFS Version 0.7.0-1
SPL Version 0.7.0-1

Note: I'm not using ZFS 0.7.1 because of #6577.

Describe the problem you're observing

I've experienced multiple packaging issues building custom kmod packages on Debian which are not documented on either the custom build howto or in the Debian-specific section.

  1. systemd unit files are not packaged by default, and ./configure --enable-systemd is ignored ZFS does not package systemd unit files in Debian even with --enable-systemd #6591. The default directory, /usr/lib/systemd/ is not used by Debian or Ubuntu. Rather, both distributions use /lib/systemd/ While this should be trivial to change manually with a ./configure option, it's not clear whether the option is respected, given that the systemd unit files aren't packaged at all.

  2. The systemd unit files won't work on Debian (they shouldn't work on Ubuntu either) because the paths for the binaries and cache files are different.

For example, the systemd files reference /usr/local/etc/zfs/zpool.cache, /usr/local/sbin/zpool, /usr/local/sbin/zfs, and /usr/local/zed. The corresponding locations on Debian are /etc/zfs/zpool.cache, /sbin/zpool, /sbin/zfs, and /usr/sbin/zed.

  1. The ZoL packages do not include /usr/share/initramfs-tools/conf.d/zfs which is required to provide ZFS support in the initramfs.

Workaround

Use the following guide to compile and install the SPL and ZFS packages. However, prior to running ./configure for SPL and ZFS, run autoreconf --force --install to regenerate the configure script using Debian's version of libtool. This resolves Issue #6577.

  1. Copy systemd unit files and config files from Debian's zfsutils-linux package. Specifically, I copied the unit files to /lib/systemd/system, the default configuration to /lib/systemd/system-preset and the module config to /lib/modules-load.d/. The paths are the same as indicated here.

  2. Unmask all the systemd services with systemctl unmask

  3. To boot off a ZFS root pool, create /usr/share/initramfs-tools/conf.d/zfs with the following content:

for x in $(cat /proc/cmdline)
do
    case $x in
        root=ZFS=*)
            BOOT=zfs
            ;;
    esac
done

Then update the initramfs by running update-initramfs -u -k all

It would be nice to include these workarounds either on the Custom Build Howto page or on a separate page related to Debian/Ubuntu specifically, at least until these issues are resolved.

@MyPod-zz
Copy link

MyPod-zz commented Sep 6, 2017

The paths for the cache file and binaries is different in the systemd file because when not specified otherwise, --prefix is implicitly pointed to /usr/local. You might specify --prefix=/usr --sbindir=/sbin --sysconfdir=/etc in the configure call to get them right.

@jwittlincohen
Copy link
Contributor Author

jwittlincohen commented Sep 7, 2017

If --prefix defaults to /usr/local, why are zfs, zpool, and zed located in /sbin? I compiled with simply ./configure.

root@debian-vm:/tmp/zfs/lib/systemd/system# which zfs
/sbin/zfs
root@debian-vm:/tmp/zfs/lib/systemd/system# which zed
/sbin/zed
root@debian-vm:/tmp/zfs/lib/systemd/system# which zpool
/sbin/zpool

I rebuilt the binaries with the following ./configure options:

./configure --enable-systemd --with-systemdunitdir=/lib/systemd/system --with-systemdpresetdir=/lib/systemd/system-preset --with-systemdmodulesloaddir=/lib/modules-load.d --prefix=/usr --sbindir=/sbin --sysconfdir=/etc

As noted above, the resulting *.deb files do not contain systemd unit files despite using --enable-systemd. Moreover, when I manually make install to /tmp/zfs, the systemd files still refer to the binaries at /usr/local/sbin and the configuration files at /usr/local/etc/zfs. Thus, it doesn't seem like the ./configure options are doing anything.

@almoondsllc
Copy link

I confirm that systemd is not installed even with --enable-systemd option. I've to run following command to install systemd zfs/zpool service and be able to import zfs pool on boot:

cd zfs/etc/systemd/
make install
systemctl preset zfs-import-cache zfs-import-scan zfs-mount zfs-share zfs-zed zfs.target
systemctl enable zfs-import-cache.service

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Packaging custom packages
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants