summaryrefslogtreecommitdiffstats
path: root/debian/extra/kernel-install.d/85-initrd.install
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:35:19 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:35:19 +0000
commitb7e8d5af06ee840cc48217ca4629cf28aeeb3c50 (patch)
tree6aa8dc840b085de50db46e2ad0725eae248fef02 /debian/extra/kernel-install.d/85-initrd.install
parentAdding upstream version 252.22. (diff)
downloadsystemd-debian.tar.xz
systemd-debian.zip
Adding debian version 252.22-1~deb12u1.debian/252.22-1_deb12u1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/extra/kernel-install.d/85-initrd.install')
-rwxr-xr-xdebian/extra/kernel-install.d/85-initrd.install26
1 files changed, 26 insertions, 0 deletions
diff --git a/debian/extra/kernel-install.d/85-initrd.install b/debian/extra/kernel-install.d/85-initrd.install
new file mode 100755
index 0000000..ecbed87
--- /dev/null
+++ b/debian/extra/kernel-install.d/85-initrd.install
@@ -0,0 +1,26 @@
+#!/bin/sh
+set -eu
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+# ex: ts=8 sw=4 sts=4 et filetype=sh
+
+COMMAND="$1"
+KERNEL_VERSION="$2"
+
+INITRD_SRC="/boot/initrd.img-$KERNEL_VERSION"
+
+[ "$COMMAND" = add ] || exit 0
+
+if [ "$#" -ge 5 ]; then
+ # Explicit initrd paths were passed, fall through to default 90-loaderentry.install handling;
+ # we'd be either injecting an unwanted image or, worse, overriding a user-provided one
+ exit 0
+fi
+
+if [ -e "$INITRD_SRC" ]; then
+ [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && echo "Installing '$INITRD_SRC'"
+ ln -fs "$INITRD_SRC" "$KERNEL_INSTALL_STAGING_AREA"
+else
+ echo "$INITRD_SRC does not exist, not installing an initrd"
+fi
+
+exit 0