Re: Bug#1091617: mdadm: broken debian-installer support

Cyril Brulebois <[email protected]>
Newsgroups gmane.linux.debian.devel.cd,gmane.linux.debian.devel.boot
Organization Debian
Message-ID <[email protected]>
Control: tag -1 patch pending

Cyril Brulebois <[email protected]> (2024-12-28):
> Spotted by Steve while testing tentative Trixie Alpha 1 images: mdadm is
> broken, with a systemd-related problem.
> 
> This part of the .config script doesn't seem to work:
> 
>     # if system has root on md
>     if findmnt / 2>/dev/null | grep -qs \/dev\/md && \
>     # and system is not a container
>     ! grep -qs ':cpuset:/$' /proc/1/cgroup && \
>     # and system is not a chroot
>     [ "$(stat -c %d/%i /)" != "$(stat -Lc %d/%i /proc/1/root 2>/dev/null)" ] && \
>     # and systemd is not running
>     [ -z "$(pidof systemd)" ]
>     then
>             db_input high mdadm/init-system-not-systemd || true
>             db_go
>     fi
> 
> The chroot test seems inverted (compared to the intent/comment):
>  - On my laptop I'm getting this: 64770/2 == 64770/2
>  - In my sid devel schroot I'm getting: 64774/1196038 != 64770/2

I've reproduced the “mdadm shows a note that really doesn't make sense
in that context” problem, and confirmed the proposed attached patch
avoids this problem.

> I'm awaiting some feedback from the images team to see if my plan would
> work for them, but my initial reaction would be to confirm the trivial
> bugfix (if it's easy enough to test, within the installer's environment)
> then upload + fast-track mdadm into testing, before respinning images.

What I've seen doesn't exactly quite match the early report, so I'm
still waiting on some more information before a possible upload. What
I've seen locally was a successful installation of mdadm and tasksel
running as usual, but that was just with a dummy RAID0 and a single
device, so maybe there are other problems lurking in the shadows that
I haven't spotted yet.


Cheers,
-- 
Cyril Brulebois ([email protected])            <https://debamax.com/>
D-I release manager -- Release team member -- Freelance Consultant
0001-Fix-chroot-detection-Closes-1091617.patch (text/x-diff, 1.4 KB)
From 10113f6f7b5e66a5e35af6d90df849c104500de4 Mon Sep 17 00:00:00 2001
From: Cyril Brulebois <[email protected]>
Date: Sat, 28 Dec 2024 20:47:46 +0100
Subject: [PATCH] Fix chroot detection (Closes: #1091617).

This avoids displaying the systemd note when mdadm is getting installed
within d-i.
---
 debian/changelog    | 8 ++++++++
 debian/mdadm.config | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 965eeb9..358608f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+mdadm (4.3+20241202-1.1) sid; urgency=high
+
+  * Non-maintainer upload.
+  * Fix chroot detection to avoid displaying the systemd note when mdadm
+    is getting installed within d-i (Closes: #1091617).
+
+ -- Cyril Brulebois <[email protected]>  Sat, 28 Dec 2024 20:46:53 +0100
+
 mdadm (4.3+20241202-1) sid; urgency=medium
 
   * Uploading to sid.
diff --git a/debian/mdadm.config b/debian/mdadm.config
index 848e6b6..2bd3489 100644
--- a/debian/mdadm.config
+++ b/debian/mdadm.config
@@ -37,7 +37,7 @@ if findmnt / 2>/dev/null | grep -qs \/dev\/md && \
 # and system is not a container
 ! grep -qs ':cpuset:/$' /proc/1/cgroup && \
 # and system is not a chroot
-[ "$(stat -c %d/%i /)" != "$(stat -Lc %d/%i /proc/1/root 2>/dev/null)" ] && \
+[ "$(stat -c %d/%i /)" = "$(stat -Lc %d/%i /proc/1/root 2>/dev/null)" ] && \
 # and systemd is not running
 [ -z "$(pidof systemd)" ]
 then
-- 
2.39.5
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEtg6/KYRFPHDXTPR4/5FK8MKzVSAFAmdwYkQACgkQ/5FK8MKz
VSB69g//ZXCuo1KrSVbSby77JiM7eVfGOx2+H4y9ew0ZuOxBBLzhSqv7ytdPUvWj
1LhzVS6f6MiO8FGwHGT6JKu9QfaUUvfQLj4EU6kEbPCH0AOwcLVg0ykVllL2O3QW
fq8EG1yt7RDOSv9HBoU9qVpbKC5lnJRraP2O/PJaHfJv4aNkvyKiC6xvIypDno5e
cLEGusPR0dAvLZf8I38EBjrqXAU+KLfnwmhgOzJZemCWHt6qcBjhQWq5hN3kvjqb
LEo4s616dqBit7IbVBcMbhefqGAq82dUOqqzytgrk4SLiAoUMKtvy/7HMsg63h2I
Ic9lYw8EAw9Pv8hfWkpvfucfCgA2LS+7nEm2pWNgSQGVgIzQZK9hpLFA0V+pBTRX
IxkVUhsg9eoySRiWCiZktqOkUJ5ux7uunJF//y5Njflk0Hc63n6Nz2fgGEu5y5Om
8AK0goLnTNAnLjqDk0HYuZDvJrDkA3WUDH0EbQs6IA8hWII/E3EXvFqzIYdHS7DA
X0AtoqaLkoE9Oxadlid9QpXGBXwKtHZA3txtpe3MwYtt41hQBxKsg8R2ZACzrztg
XXiH7koTyIr7kHO1fxgff4w7RbLwV8imDt5eA7MrubOeJkSW1Tr5c9iPuNhwK5dT
WdFs+nn3k28E3ALDKyy4kQ5rGorHxiryiCXYyAVwe1YuNfO9Dp4=
=w8Sf
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.