Bug#1071182: dracut: requires changes for systemd 256; boot fails otherwise

2024-05-31 Thread Holger Weiß

Control: reopen -1
Control: tags -1 patch

Just to clarify, the original report mentiones two changes required for 
systemd 256:


| 1. systemd 256 makes /usr read-only in initrd:
|- https://github.com/systemd/systemd/issues/32511
|- https://github.com/dracut-ng/dracut-ng/issues/253
| 
| 2. libkmod.so.2 might need to be installed manually:

|- https://github.com/systemd/systemd/issues/32508#issuecomment-2080063182

As far as I can see, dracut 060+5-8 fixes issue (2), but not issue (1).  
That's what my above patch does.




Bug#1071182: dracut: requires changes for systemd 256; boot fails otherwise

2024-05-30 Thread Holger Weiß

Source: dracut
Version: 060+5-8
Followup-For: Bug #1071182
Tags: patch

The following patch addresses the case where /usr and possibly /etc are 
mounted read-only in the initrd, and therefore fixes the error messsages 
mentioned in my previous email.


From: Holger Weiss 
Date: Thu, 30 May 2024 21:14:59 +0200
Subject: [PATCH] Cope with /usr and/or /etc being mounted read-only

This fixes the remaining systemd 256 compatiblity issues mentioned in:

https://github.com/dracut-ng/dracut-ng/issues/253
---
 debian/changelog|   6 +
 debian/patches/move-hooks-to-var.patch  |  66 +
 debian/patches/move-modprobe.d-to-run.patch | 156 
 debian/patches/series   |   2 +
 4 files changed, 230 insertions(+)
 create mode 100644 debian/patches/move-hooks-to-var.patch
 create mode 100644 debian/patches/move-modprobe.d-to-run.patch

diff --git a/debian/changelog b/debian/changelog
index ac35fdaf..905feb14 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+dracut (060+5-9) unstable; urgency=low
+
+  * cope with /usr and/or /etc being mounted read-only in the initrd
+
+ -- Holger Weiss   Thu, 30 May 2024 21:08:24 +0200
+
 dracut (060+5-8) unstable; urgency=low
 
   * control: adjust breaks, replaces, Closes: #1071208, #1071244

diff --git a/debian/patches/move-hooks-to-var.patch 
b/debian/patches/move-hooks-to-var.patch
new file mode 100644
index ..7388726f
--- /dev/null
+++ b/debian/patches/move-hooks-to-var.patch
@@ -0,0 +1,66 @@
+Description: Move hooks directory from /usr/lib to /var/lib
+ Since https://github.com/systemd/systemd/commit/ffc1ec73, /usr is mounted as
+ read-only in the initramfs by default.
+Author: Laszlo Gombos 
+Origin: upstream, https://github.com/dracut-ng/dracut-ng
+Bug: https://github.com/dracutdevs/dracut/issues/2588
+Applied-Upstream: 
https://github.com/dracut-ng/dracut-ng/commit/a45048b80c27ee5a45a380052a6d29ab1925f7f9
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/dracut-init.sh
 b/dracut-init.sh
+@@ -630,7 +630,7 @@
+ dfatal "No such hook type $1. Aborting initrd creation."
+ exit 1
+ fi
+-hook="/lib/dracut/hooks/${1}/${2}-${3##*/}"
++hook="/var/lib/dracut/hooks/${1}/${2}-${3##*/}"
+ inst_simple "$3" "$hook"
+ chmod u+x "$initdir/$hook"
+ }
+--- a/dracut.sh
 b/dracut.sh
+@@ -1882,7 +1882,11 @@
+ 
+ if [[ $kernel_only != yes ]]; then

+ mkdir -p "${initdir}/etc/cmdline.d"
+-mkdir -m 0755 "${initdir}"/lib/dracut/hooks
++mkdir -m 0755 -p "${initdir}"/var/lib/dracut/hooks
++
++# symlink to old hooks location for compatibility
++ln_r /var/lib/dracut/hooks /lib/dracut/hooks
++
+ for _d in $hookdirs; do
+ # shellcheck disable=SC2174
+ mkdir -m 0755 -p "${initdir}/lib/dracut/hooks/$_d"
+--- a/modules.d/99base/module-setup.sh
 b/modules.d/99base/module-setup.sh
+@@ -45,7 +45,10 @@
+ 
+ [ -e "${initdir}/lib" ] || mkdir -m 0755 -p "${initdir}"/lib

+ mkdir -m 0755 -p "${initdir}"/lib/dracut
+-mkdir -m 0755 -p "${initdir}"/lib/dracut/hooks
++mkdir -m 0755 -p "${initdir}"/var/lib/dracut/hooks
++
++# symlink to old hooks location for compatibility
++ln_r /var/lib/dracut/hooks /lib/dracut/hooks
+ 
+ mkdir -p "${initdir}"/tmp
+ 
+--- a/modules.d/99shutdown/module-setup.sh

 b/modules.d/99shutdown/module-setup.sh
+@@ -17,9 +17,11 @@
+ inst_multiple umount poweroff reboot halt losetup stat sleep timeout
+ inst_multiple -o kexec
+ inst "$moddir/shutdown.sh" "$prefix/shutdown"
+-[ -e "${initdir}/lib" ] || mkdir -m 0755 -p "${initdir}"/lib
+-mkdir -m 0755 -p "${initdir}"/lib/dracut
+-mkdir -m 0755 -p "${initdir}"/lib/dracut/hooks
++mkdir -m 0755 -p "${initdir}"/var/lib/dracut/hooks
++
++# symlink to old hooks location for compatibility
++ln_r /var/lib/dracut/hooks /lib/dracut/hooks
++
+ for _d in $hookdirs shutdown shutdown-emergency; do
+ mkdir -m 0755 -p "${initdir}"/lib/dracut/hooks/"$_d"
+ done
diff --git a/debian/patches/move-modprobe.d-to-run.patch 
b/debian/patches/move-modprobe.d-to-run.patch
new file mode 100644
index ..17295491
--- /dev/null
+++ b/debian/patches/move-modprobe.d-to-run.patch
@@ -0,0 +1,156 @@
+Description: Move /etc/modprobe.d to /run/modprobe.d
+ Change /etc/modprobe.d path to /run/modprobe.d in hooks, as /etc might be
+ mounted as read-only.
+Author: Laszlo Gombos 
+Origin: upstream, https://github.com/dracut-ng/dracut-ng
+Applied-Upstream: 
https://github.com/dracut-ng/dracut-ng/commit/424717af8e0a86dac7a9898bf161f04e35abd2c2
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/man/dracut.modules.7.asc
 b/man/dracut.modules.7.asc
+@@ -181,7 +181,7 @@
+ _parse-insmodpost.sh_:
+ 
+ for p in $(getargs rd.driver.post=); do
+-echo "blacklist $p" >> /etc/modprobe.d/initramfsblacklist.conf
++echo "blacklist $p" >> 

Bug#1071182: dracut: requires changes for systemd 256; boot fails otherwise

2024-05-28 Thread Holger Weiss
Package: dracut
Followup-For: Bug #1071182

After updating to systemd 256~rc3-2 and dracut 060+5-8, these two
messages are logged from initrd:

| /bin/dracut-cmdline: 28: //lib/dracut/hooks/cmdline/00-parse-root.sh: cannot 
create 
/lib/dracut/hooks/initqueue/finished/devexists-\x2fdev\x2fdisk\x2fby-uuid\x2f3acb9d7b-dede-44f9-bf8b-2039ab084aa8.sh:
 Read-only file system
| /bin/dracut-cmdline: 33: //lib/dracut/hooks/cmdline/00-parse-root.sh: cannot 
create 
/lib/dracut/hooks/emergency/80-\x2fdev\x2fdisk\x2fby-uuid\x2f3acb9d7b-dede-44f9-bf8b-2039ab084aa8.sh:
 Read-only file system

However, the system boots fine, I didn't notice any actual problems.

-- System Information:
Debian Release: trixie/sid
  APT prefers testing-debug
  APT policy: (500, 'testing-debug'), (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 6.7.12-amd64 (SMP w/6 CPU threads; PREEMPT)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages dracut depends on:
ii  dracut-core  060+5-8

dracut recommends no packages.

Versions of packages dracut suggests:
pn  dracut-network  

-- no debconf information



Bug#1071182: dracut: requires changes for systemd 256; boot fails otherwise

2024-05-17 Thread Thomas Lange
The related systemd bug is #1071278
-- 
regards Thomas



Bug#1071182: dracut: requires changes for systemd 256; boot fails otherwise

2024-05-17 Thread Thomas Lange
I also filed a bug against systemd because this problem can be solved
by both packages and there are plans to replace dracut by dracut-ng.
But that will need more time.


regards Thomas



Bug#1071182: dracut: requires changes for systemd 256; boot fails otherwise

2024-05-17 Thread Simon Pilkington
I believe this should be Severity: critical.  With the current set of packages
in unstable all it takes is one apt upgrade to instantly get an unbootable
system with no warning.

To get a working dracut I packaged version 101 of the dracut-ng fork and
included this commit as a patch:
https://github.com/dracut-ng/dracut-ng/commit/04b362d713235459cff1f370efb4cd5e36e4a358

The result produced bootable initramfs images with systemd 256-rc2 in a VM.

Regards,
Simon



Bug#1071182: dracut: requires changes for systemd 256; boot fails otherwise

2024-05-15 Thread Ansgar
Source: dracut
Version: 060+5-1
Severity: serious
Tags: upstream
X-Debbugs-Cc: Debian systemd Maintainers 


Hi,

dracut requires two changes for systemd 256:

1. systemd 256 makes /usr read-only in initrd:
   - https://github.com/systemd/systemd/issues/32511
   - https://github.com/dracut-ng/dracut-ng/issues/253

2. libkmod.so.2 might need to be installed manually:
   - https://github.com/systemd/systemd/issues/32508#issuecomment-2080063182

systemd should get a `Breaks: dracut (<< fixed-version-goes-here)`
once a fixed version is uploaded.

Ansgar

-- System Information:
Debian Release: trixie/sid
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 
'testing'), (500, 'stable'), (300, 'buildd-unstable'), (300, 'unstable'), (1, 
'buildd-experimental'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 6.7.12-amd64 (SMP w/16 CPU threads; PREEMPT)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

-- no debconf information