From 4d631a509d067c2695a396983cb12f58d92d4e04 Mon Sep 17 00:00:00 2001 From: Umer Saleem Date: Fri, 28 Oct 2022 03:38:45 +0500 Subject: Add native Debian Packaging for Linux Currently, the Debian packages are generated from ALIEN that converts RPMs to Debian packages. This commit adds native Debian packaging for Debian based systems. This packaging is a fork of Debian zfs-linux 2.1.6-2 release. (source: https://salsa.debian.org/zfsonlinux-team/zfs) Some updates have been made to keep the footprint minimal that include removing the tests, translation files, patches directory etc. All credits go to Debian ZFS on Linux Packaging Team. For copyright information, please refer to contrib/debian/copyright. scripts/debian-packaging.sh can be used to invoke the build. Reviewed-by: Mo Zhou Reviewed-by: Ryan Moeller Signed-off-by: Umer Saleem Closes #13451 --- .../usr/share/initramfs-tools/conf.d/zfs | 8 +++ .../usr/share/initramfs-tools/hooks/zdev | 67 ++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 contrib/debian/tree/zfs-initramfs/usr/share/initramfs-tools/conf.d/zfs create mode 100755 contrib/debian/tree/zfs-initramfs/usr/share/initramfs-tools/hooks/zdev (limited to 'contrib/debian/tree') diff --git a/contrib/debian/tree/zfs-initramfs/usr/share/initramfs-tools/conf.d/zfs b/contrib/debian/tree/zfs-initramfs/usr/share/initramfs-tools/conf.d/zfs new file mode 100644 index 000000000..5103cc450 --- /dev/null +++ b/contrib/debian/tree/zfs-initramfs/usr/share/initramfs-tools/conf.d/zfs @@ -0,0 +1,8 @@ +for x in $(cat /proc/cmdline) +do + case $x in + root=ZFS=*) + BOOT=zfs + ;; + esac +done diff --git a/contrib/debian/tree/zfs-initramfs/usr/share/initramfs-tools/hooks/zdev b/contrib/debian/tree/zfs-initramfs/usr/share/initramfs-tools/hooks/zdev new file mode 100755 index 000000000..0cf21a421 --- /dev/null +++ b/contrib/debian/tree/zfs-initramfs/usr/share/initramfs-tools/hooks/zdev @@ -0,0 +1,67 @@ +#!/bin/sh +# +# Add udev rules for ZoL to the initrd. +# + +PREREQ="udev" +PREREQ_UDEV_RULES="60-zvol.rules 69-vdev.rules" +COPY_EXEC_LIST="/lib/udev/zvol_id /lib/udev/vdev_id" + +# Generic result code. +RC=0 + +case $1 in +prereqs) + echo "$PREREQ" + exit 0 + ;; +esac + +for ii in $COPY_EXEC_LIST +do + if [ ! -x "$ii" ] + then + echo "Error: $ii is not executable." + RC=2 + fi +done + +if [ "$RC" -ne 0 ] +then + exit "$RC" +fi + +. /usr/share/initramfs-tools/hook-functions + +mkdir -p "$DESTDIR/lib/udev/rules.d/" +for ii in $PREREQ_UDEV_RULES +do + if [ -e "/etc/udev/rules.d/$ii" ] + then + cp -p "/etc/udev/rules.d/$ii" "$DESTDIR/lib/udev/rules.d/" + elif [ -e "/lib/udev/rules.d/$ii" ] + then + cp -p "/lib/udev/rules.d/$ii" "$DESTDIR/lib/udev/rules.d/" + else + echo "Error: Missing udev rule: $ii" + echo " This file must be in the /etc/udev/rules.d or /lib/udev/rules.d directory." + exit 1 + fi +done + +for ii in $COPY_EXEC_LIST +do + copy_exec "$ii" +done + +if [ -f '/etc/default/zfs' -a -r '/etc/default/zfs' ] +then + mkdir -p "$DESTDIR/etc/default" + cp -a '/etc/default/zfs' "$DESTDIR/etc/default/" +fi + +if [ -d '/etc/zfs' -a -r '/etc/zfs' ] +then + mkdir -p "$DESTDIR/etc" + cp -a '/etc/zfs' "$DESTDIR/etc/" +fi -- cgit v1.2.3