Linux kbuild/kconfig development
 help / color / mirror / Atom feed
* [PATCH] kbuild: deb-pkg: propagate hook script failures in builddeb
@ 2026-04-22 18:30 Jill Ravaliya
  2026-04-22 22:06 ` Nathan Chancellor
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Jill Ravaliya @ 2026-04-22 18:30 UTC (permalink / raw)
  To: masahiroy; +Cc: linux-kbuild, Nathan Chancellor, nicolas

From 1d7c7d8bf70c3d2b2abbb5ead3c654978ead419a Mon Sep 17 00:00:00 2001
From: jillravaliya <jillravaliya@gmail.com>
Date: Wed, 22 Apr 2026 23:37:39 +0530
Subject: [PATCH] kbuild: deb-pkg: propagate hook script failures in builddeb

The 'builddeb' script generates maintainer scripts for Debian-based
distributions. Currently, it invokes post-installation hooks via
run-parts but unconditionally exits with code 0. This masks failures
from downstream hooks (e.g., initramfs generation or DKMS).

On systems with modular storage drivers (CONFIG_BLK_DEV_NVME=m), an
unnoticed failure in an early hook can prevent the initrd from being
correctly updated. This results in a successful package installation
exit code despite a broken boot configuration, leading to a
'VFS: unknown-block(0,0)' panic on reboot.

This patch ensures that failures in 'run-parts' are correctly
propagated, allowing the package manager to abort the installation
upon hook failure.

Signed-off-by: jillravaliya <jillravaliya@gmail.com>
Link: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2141741
---
 scripts/package/builddeb | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 3627ca227..6ea768f08 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -98,7 +98,12 @@ install_maint_scripts () {
  hookdirs="\$hookdirs \$dir/${script}.d"
  done
  hookdirs="\${hookdirs# }"
- test -n "\$hookdirs" && run-parts --arg="${KERNELRELEASE}"
--arg="/${installed_image_path}" \$hookdirs
+ if [ -n "\$hookdirs" ]; then
+                    if ! run-parts --arg="\${KERNELRELEASE}"
--arg="/\${installed_image_path}" \$hookdirs; then
+                         echo "E: Post-install hooks failed." >&2
+                         exit 1
+                    fi
+                fi
  exit 0
  EOF
  chmod 755 "${pdir}/DEBIAN/${script}"
-- 
2.51.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread
* Re: [PATCH] kbuild: deb-pkg: propagate hook script failures in builddeb
@ 2026-05-08 10:18 Jill Ravaliya
  0 siblings, 0 replies; 8+ messages in thread
From: Jill Ravaliya @ 2026-05-08 10:18 UTC (permalink / raw)
  To: nathan.chancellor; +Cc: Jill Ravaliya, linux-kbuild, linux-kernel

Hi Nathan,

Just following up on the v3 patch I sent on May 1st.
Wanted to make sure it did not get lost.

Happy to make any further changes if needed.

Thanks,
Jill Ravaliya

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: [PATCH] kbuild: deb-pkg: propagate hook script failures in builddeb
@ 2026-05-08 10:27 Jill Ravaliya
  2026-05-08 12:01 ` Nathan Chancellor
  0 siblings, 1 reply; 8+ messages in thread
From: Jill Ravaliya @ 2026-05-08 10:27 UTC (permalink / raw)
  To: nathan; +Cc: Jill Ravaliya, linux-kbuild, linux-kernel

Hi Nathan,

Just following up on the v3 patch I sent on May 1st.
Wanted to make sure it did not get lost.

Happy to make any further changes if needed.

Thanks,
Jill Ravaliya

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-05-08 12:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-22 18:30 [PATCH] kbuild: deb-pkg: propagate hook script failures in builddeb Jill Ravaliya
2026-04-22 22:06 ` Nathan Chancellor
2026-04-30  8:54 ` Jill Ravaliya
2026-04-30 22:52   ` Nathan Chancellor
2026-05-01  1:20 ` Jill Ravaliya
  -- strict thread matches above, loose matches on Subject: below --
2026-05-08 10:18 Jill Ravaliya
2026-05-08 10:27 Jill Ravaliya
2026-05-08 12:01 ` Nathan Chancellor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox