public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Jill Ravaliya <jillravaliya@gmail.com>
Cc: masahiroy@kernel.org, linux-kbuild@vger.kernel.org, nicolas@fjasle.eu
Subject: Re: [PATCH] kbuild: deb-pkg: propagate hook script failures in builddeb
Date: Wed, 22 Apr 2026 15:06:32 -0700	[thread overview]
Message-ID: <20260422220632.GA1448493@ax162> (raw)
In-Reply-To: <CAHr0PbumU-Y4G9rmuffd3crfOpqgxvQii0cVEYFC_sdjjNEZRw@mail.gmail.com>

Hi Jill,

Thanks for the patch!

On Thu, Apr 23, 2026 at 12:00:12AM +0530, Jill Ravaliya wrote:
> >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

Unfortunately, this patch is malformed so it cannot be applied. Please
see

  https://docs.kernel.org/process/submitting-patches.html#no-mime-no-links-no-compression-no-attachments-just-plain-text
  https://git-send-email.io/
  https://docs.kernel.org/process/email-clients.html

for information on using git send-email (the traditional way) or

  https://b4.docs.kernel.org/en/latest/contributor/overview.html
  https://github.com/ClangBuiltLinux/linux/issues/2093#issuecomment-2932754317

for information on using b4 (the new way).

Otherwise, the premise of this patch seems reasonable and I would be
happy to test it properly once it can be properly applied to the tree.

>   exit 0
>   EOF
>   chmod 755 "${pdir}/DEBIAN/${script}"
> -- 
> 2.51.1
> 

      reply	other threads:[~2026-04-22 22:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-22 18:30 [PATCH] kbuild: deb-pkg: propagate hook script failures in builddeb Jill Ravaliya
2026-04-22 22:06 ` Nathan Chancellor [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260422220632.GA1448493@ax162 \
    --to=nathan@kernel.org \
    --cc=jillravaliya@gmail.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=nicolas@fjasle.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox