Package: dracut
Version: 105-2
Severity: critical
1. Some error is reported when we build the package.
This issue was found originally on version 059, but I check the latest
codes and build it, found it still exists, so report this and attached
a fix patch.
# lintian --tag-display-limit 0 dracut-core_105-2_amd64.deb
running with root privileges is not recommended!
E: dracut-core: service-file-is-not-a-file
[lib/systemd/system/dracut-cmdline.service]
E: dracut-core: service-file-is-not-a-file
[lib/systemd/system/dracut-initqueue.service]
E: dracut-core: service-file-is-not-a-file
[lib/systemd/system/dracut-mount.service]
E: dracut-core: service-file-is-not-a-file
[lib/systemd/system/dracut-pre-mount.service]
E: dracut-core: service-file-is-not-a-file
[lib/systemd/system/dracut-pre-pivot.service]
E: dracut-core: service-file-is-not-a-file
[lib/systemd/system/dracut-pre-trigger.service]
E: dracut-core: service-file-is-not-a-file
[lib/systemd/system/dracut-pre-udev.service]
E: dracut-core: service-file-is-not-a-file
[lib/systemd/system/dracut-shutdown-onfailure.service]
E: dracut-core: service-file-is-not-a-file
[lib/systemd/system/dracut-shutdown.service]
E: dracut-core: service-file-is-not-a-file
[lib/systemd/system/initrd.target.wants/dracut-cmdline.service]
E: dracut-core: service-file-is-not-a-file
[lib/systemd/system/initrd.target.wants/dracut-initqueue.service]
E: dracut-core: service-file-is-not-a-file
[lib/systemd/system/initrd.target.wants/dracut-mount.service]
E: dracut-core: service-file-is-not-a-file
[lib/systemd/system/initrd.target.wants/dracut-pre-mount.service]
E: dracut-core: service-file-is-not-a-file
[lib/systemd/system/initrd.target.wants/dracut-pre-pivot.service]
E: dracut-core: service-file-is-not-a-file
[lib/systemd/system/initrd.target.wants/dracut-pre-trigger.service]
E: dracut-core: service-file-is-not-a-file
[lib/systemd/system/initrd.target.wants/dracut-pre-udev.service]
E: dracut-core: service-file-is-not-a-file
[lib/systemd/system/sysinit.target.wants/dracut-shutdown.service]
2. We found dracut cannot regenerate initramfs on the system with
ostree, the cause is it cannot correctly find the location of the
initramfs on the system with ostree, so I also attached a patch to fix it.
From 592ae0c18e7a90f4153e49339421df9df4ffe247 Mon Sep 17 00:00:00 2001
From: Wenlin Kang <wenlin.k...@windriver.com>
Date: Sun, 1 Dec 2024 23:30:11 -0800
Subject: [PATCH 3/3] debian: fixed lintian error and add support for system
with ostree
1. debian/lintian: silence lintian error systemd-service-file
2. postinst: add support for system with ostree
Signed-off-by: Wenlin Kang <wenlin.k...@windriver.com>
---
debian/changelog | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index d1aa7c13..f65fbef7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+dracut (105-2) unstable; urgency=medium
+
+ * debian/lintian: silence lintian error systemd-service-file
+ * postinst: add support for ostree system
+
+ -- Wenlin Kang <wenlin.k...@windriver.com> Sun, 01 Dec 2024 23:26:47 -0800
+
dracut (105-2) unstable; urgency=medium
* autopkgtest:
--
2.42.0
From 01a20100740f2fcf7358e5de4fdc984c3fac02d3 Mon Sep 17 00:00:00 2001
From: Wenlin Kang <wenlin.k...@windriver.com>
Date: Sun, 1 Dec 2024 23:13:46 -0800
Subject: [PATCH 2/3] postinst: add support for system with ostree
In gerenal, dracut work is good, but on the system with ostree, it
cannot correctly find the location of the initramfs and regenerate
it, the patch gives it a chance to find the location on the system
with ostree.
Meanwhile, also replace linux-version with ls, the cause is linux-version
only find kernel image from /boot, but on the system with ostree, the
kernel image usually is in /boot/ostree/${osname}-${bootcsum}.
Signed-off-by: Wenlin Kang <wenlin.k...@windriver.com>
---
debian/dracut.postinst | 19 ++++++++++++++-----
debian/kernel/postinst.d/dracut | 12 +++++++++---
2 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/debian/dracut.postinst b/debian/dracut.postinst
index c435bc58..3662fb8a 100644
--- a/debian/dracut.postinst
+++ b/debian/dracut.postinst
@@ -4,11 +4,20 @@ set -e
mk_initrd() {
- local latest_version
- latest_version=$(linux-version list | linux-version sort | tail -n 1)
- linux-version list | while read -r kversion; do
- if test "$kversion" = "$latest_version" || ! test -e "/boot/initrd.img-$kversion"; then
- /etc/kernel/postinst.d/dracut "$kversion"
+ local bootdir=/boot
+ local ostree="$(cat /proc/cmdline | grep -o 'ostree=[^ ]*' | cut -d'=' -f2)"
+ if [ -n "${ostree}" ]; then
+ osname="$(echo ${ostree} | awk -F/ '{print $4}')"
+ bootcsum="$(echo ${ostree} | awk -F/ '{print $5}')"
+ bootdir=${bootdir}/ostree/${osname}-${bootcsum}
+ fi
+
+ local version_list="`ls ${bootdir}/vmlinu[zx]-* 2>/dev/null | sed -e "s#${bootdir}/vmlinu.-##"`"
+ local latest_version="`ls ${bootdir}/vmlinu[zx]-* 2>/dev/null | sed -e "s#${bootdir}/vmlinu.-##" | sort -V | tail -n 1`"
+ echo ${version_list} | while read -r kversion; do
+ local initrd="${bootdir}/initrd.img-$kversion"
+ if test "$kversion" = "$latest_version" || ! test -e "${initrd}"; then
+ /etc/kernel/postinst.d/dracut $kversion ${initrd}
fi
done
}
diff --git a/debian/kernel/postinst.d/dracut b/debian/kernel/postinst.d/dracut
index b202df4d..126bcad1 100755
--- a/debian/kernel/postinst.d/dracut
+++ b/debian/kernel/postinst.d/dracut
@@ -27,10 +27,16 @@ 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
+if [ ! -f $bootdir/../lib/modules/$version/modules.dep ] &&
+ [ ! -f /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
+# keep original name if it exists
+initrd="$(ls ${bootdir}/initr*-${version}* 2>/dev/null)"
+if [ -z "${initrd}" ]; then
+ initrd=$bootdir/initrd.img-${version}
+fi
+echo "dracut: Generating ${initrd}"
+dracut -q --force ${initrd} "${version}" >&2
--
2.42.0
From 62f350064c5e05e71775c16eec9fa93dbb78d660 Mon Sep 17 00:00:00 2001
From: Wenlin Kang <wenlin.k...@windriver.com>
Date: Sun, 1 Dec 2024 22:43:11 -0800
Subject: [PATCH 1/3] debian/lintian: silence lintian error
systemd-service-file
Silence lintian error:
E: dracut-core: service-file-is-not-a-file [lib/systemd/system/dracut-cmdline.service]
E: dracut-core: service-file-is-not-a-file [lib/systemd/system/dracut-initqueue.service]
E: dracut-core: service-file-is-not-a-file [lib/systemd/system/dracut-mount.service]
E: dracut-core: service-file-is-not-a-file [lib/systemd/system/dracut-pre-mount.service]
E: dracut-core: service-file-is-not-a-file [lib/systemd/system/dracut-pre-pivot.service]
E: dracut-core: service-file-is-not-a-file [lib/systemd/system/dracut-pre-trigger.service]
E: dracut-core: service-file-is-not-a-file [lib/systemd/system/dracut-pre-udev.service]
E: dracut-core: service-file-is-not-a-file [lib/systemd/system/dracut-shutdown-onfailure.service]
E: dracut-core: service-file-is-not-a-file [lib/systemd/system/dracut-shutdown.service]
E: dracut-core: service-file-is-not-a-file [lib/systemd/system/initrd.target.wants/dracut-cmdline.service]
E: dracut-core: service-file-is-not-a-file [lib/systemd/system/initrd.target.wants/dracut-initqueue.service]
E: dracut-core: service-file-is-not-a-file [lib/systemd/system/initrd.target.wants/dracut-mount.service]
E: dracut-core: service-file-is-not-a-file [lib/systemd/system/initrd.target.wants/dracut-pre-mount.service]
E: dracut-core: service-file-is-not-a-file [lib/systemd/system/initrd.target.wants/dracut-pre-pivot.service]
E: dracut-core: service-file-is-not-a-file [lib/systemd/system/initrd.target.wants/dracut-pre-trigger.service]
E: dracut-core: service-file-is-not-a-file [lib/systemd/system/initrd.target.wants/dracut-pre-udev.service]
E: dracut-core: service-file-is-not-a-file [lib/systemd/system/sysinit.target.wants/dracut-shutdown.service]
In previous commit 5758070954831072438dd9061febc332072057b1, it has
fixed one, but some are still existing, this patch fixes them.
Signed-off-by: Wenlin Kang <wenlin.k...@windriver.com>
---
debian/dracut-core.lintian-overrides | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/debian/dracut-core.lintian-overrides b/debian/dracut-core.lintian-overrides
index 3e612dfe..06756bdb 100644
--- a/debian/dracut-core.lintian-overrides
+++ b/debian/dracut-core.lintian-overrides
@@ -2,3 +2,20 @@
dracut-core: executable-in-usr-lib [usr/lib/dracut/*]
# These services run in the initrd and are allowed to linger until the very end of shutdown sequence
dracut-core: systemd-service-file-shutdown-problems [usr/lib/systemd/system/*dracut-*.service]
+dracut-core: service-file-is-not-a-file [lib/systemd/system/dracut-cmdline.service]
+dracut-core: service-file-is-not-a-file [lib/systemd/system/dracut-initqueue.service]
+dracut-core: service-file-is-not-a-file [lib/systemd/system/dracut-mount.service]
+dracut-core: service-file-is-not-a-file [lib/systemd/system/dracut-pre-mount.service]
+dracut-core: service-file-is-not-a-file [lib/systemd/system/dracut-pre-pivot.service]
+dracut-core: service-file-is-not-a-file [lib/systemd/system/dracut-pre-trigger.service]
+dracut-core: service-file-is-not-a-file [lib/systemd/system/dracut-pre-udev.service]
+dracut-core: service-file-is-not-a-file [lib/systemd/system/dracut-shutdown-onfailure.service]
+dracut-core: service-file-is-not-a-file [lib/systemd/system/dracut-shutdown.service]
+dracut-core: service-file-is-not-a-file [lib/systemd/system/initrd.target.wants/dracut-cmdline.service]
+dracut-core: service-file-is-not-a-file [lib/systemd/system/initrd.target.wants/dracut-initqueue.service]
+dracut-core: service-file-is-not-a-file [lib/systemd/system/initrd.target.wants/dracut-mount.service]
+dracut-core: service-file-is-not-a-file [lib/systemd/system/initrd.target.wants/dracut-pre-mount.service]
+dracut-core: service-file-is-not-a-file [lib/systemd/system/initrd.target.wants/dracut-pre-pivot.service]
+dracut-core: service-file-is-not-a-file [lib/systemd/system/initrd.target.wants/dracut-pre-trigger.service]
+dracut-core: service-file-is-not-a-file [lib/systemd/system/initrd.target.wants/dracut-pre-udev.service]
+dracut-core: service-file-is-not-a-file [lib/systemd/system/sysinit.target.wants/dracut-shutdown.service]
--
2.42.0