diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-03 13:54:25 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-03 13:54:25 +0000 |
commit | 613b5479a576e8b54bc261055d341466fa57a937 (patch) | |
tree | 4e8f56ead3c83759cf5c9005d350926275370f66 /debian/kernel | |
parent | Adding upstream version 060+5. (diff) | |
download | dracut-613b5479a576e8b54bc261055d341466fa57a937.tar.xz dracut-613b5479a576e8b54bc261055d341466fa57a937.zip |
Adding debian version 060+5-1.debian/060+5-1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/kernel')
-rwxr-xr-x | debian/kernel/postinst.d/dracut | 36 | ||||
-rwxr-xr-x | debian/kernel/postrm.d/dracut | 25 |
2 files changed, 61 insertions, 0 deletions
diff --git a/debian/kernel/postinst.d/dracut b/debian/kernel/postinst.d/dracut new file mode 100755 index 0000000..b202df4 --- /dev/null +++ b/debian/kernel/postinst.d/dracut @@ -0,0 +1,36 @@ +#!/bin/sh + +version="$1" +bootdir=/boot + +[ -x /usr/bin/dracut ] || exit 0 + +# passing the kernel version is required +[ -z "${version}" ] && exit 0 + +# exit if custom kernel does not need an initramfs +[ "$INITRD" = 'No' ] && exit 0 + +# absolute file name of kernel image may be passed as a second argument; +# create the initrd in the same directory +if [ -n "$2" ]; then + bootdir=$(dirname "$2") +fi + +# avoid running multiple times +if [ -n "$DEB_MAINT_PARAMS" ]; then + eval set -- "$DEB_MAINT_PARAMS" + if [ -z "$1" ] || [ "$1" != "configure" ]; then + exit 0 + fi +fi + +# check if modules.dep already exists. If not create it +# maybe this problem could also be solved via Debian triggers +if [ ! -f $bootdir/../lib/modules/$version/modules.dep ]; then + depmod -a -F $bootdir/System.map-$version $version +fi + +# we're good - create initramfs +echo "dracut: Generating $bootdir/initrd.img-${version}" +dracut -q --force $bootdir/initrd.img-${version} "${version}" >&2 diff --git a/debian/kernel/postrm.d/dracut b/debian/kernel/postrm.d/dracut new file mode 100755 index 0000000..ab1c86c --- /dev/null +++ b/debian/kernel/postrm.d/dracut @@ -0,0 +1,25 @@ +#!/bin/sh + +version="$1" +bootdir=/boot + +# passing the kernel version is required +[ -z "${version}" ] && exit 0 + +# absolute file name of kernel image may be passed as a second argument; +# remove the initrd from the same directory +if [ -n "$2" ]; then + bootdir=$(dirname "$2") +fi + +# avoid running multiple times +if [ -n "$DEB_MAINT_PARAMS" ]; then + eval set -- "$DEB_MAINT_PARAMS" + if [ -z "$1" ] || [ "$1" != "remove" ]; then + exit 0 + fi +fi + + +# delete initramfs +rm -f "$bootdir/initrd.img-${version}" |