Commit 1c8ddae0 authored by Ben Hutchings's avatar Ben Hutchings Committed by Michal Marek

deb-pkg: Inhibit initramfs builders if CONFIG_BLK_DEV_INITRD is not set

The kernel postinst hook for initramfs-tools will build an initramfs
on installation unless $INITRD is set to 'No'.  make-kpkg generates a
postinst script that sets this variable appropriately, but we don't.
Set it based on CONFIG_BLK_DEV_INITRD.

This should also work with dracut when <>
is fixed.
Signed-off-by: default avatarBen Hutchings <>
Signed-off-by: default avatarMichal Marek <>
parent 6cf3a6ef
......@@ -172,8 +172,15 @@ fi
# Install the maintainer scripts
# Note: hook scripts under /etc/kernel are also executed by official Debian
# kernel packages, as well as kernel packages built using make-kpkg
# kernel packages, as well as kernel packages built using make-kpkg.
# make-kpkg sets $INITRD to indicate whether an initramfs is wanted, and
# so do we; recent versions of dracut and initramfs-tools will obey this.
for script in postinst postrm preinst prerm ; do
mkdir -p "$tmpdir$debhookdir/$script.d"
cat <<EOF > "$tmpdir/DEBIAN/$script"
......@@ -184,6 +191,9 @@ set -e
# Pass maintainer script parameters to hook scripts
export DEB_MAINT_PARAMS="\$*"
# Tell initramfs builder whether it's wanted
export INITRD=$want_initrd
test -d $debhookdir/$script.d && run-parts --arg="$version" --arg="/$installed_image_path" $debhookdir/$script.d
exit 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment