aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2013-11-14 22:03:25 -0500
committerMichal Marek <mmarek@suse.cz>2013-11-18 08:35:49 -0500
commit1c8ddae09f4c102b97c9086cc70347e89468a547 (patch)
tree5348eebcb5b7dd6a3de8bdc639836daa88423910 /scripts
parent6cf3a6eff77273a55b996a5a43f342b150cfba09 (diff)
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 <http://bugs.debian.org/729622> is fixed. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/package/builddeb12
1 files changed, 11 insertions, 1 deletions
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 90e521fde35f..65014e1495bf 100644
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -172,8 +172,15 @@ fi
172 172
173# Install the maintainer scripts 173# Install the maintainer scripts
174# Note: hook scripts under /etc/kernel are also executed by official Debian 174# Note: hook scripts under /etc/kernel are also executed by official Debian
175# kernel packages, as well as kernel packages built using make-kpkg 175# kernel packages, as well as kernel packages built using make-kpkg.
176# make-kpkg sets $INITRD to indicate whether an initramfs is wanted, and
177# so do we; recent versions of dracut and initramfs-tools will obey this.
176debhookdir=${KDEB_HOOKDIR:-/etc/kernel} 178debhookdir=${KDEB_HOOKDIR:-/etc/kernel}
179if grep -q '^CONFIG_BLK_DEV_INITRD=y' $KCONFIG_CONFIG; then
180 want_initrd=Yes
181else
182 want_initrd=No
183fi
177for script in postinst postrm preinst prerm ; do 184for script in postinst postrm preinst prerm ; do
178 mkdir -p "$tmpdir$debhookdir/$script.d" 185 mkdir -p "$tmpdir$debhookdir/$script.d"
179 cat <<EOF > "$tmpdir/DEBIAN/$script" 186 cat <<EOF > "$tmpdir/DEBIAN/$script"
@@ -184,6 +191,9 @@ set -e
184# Pass maintainer script parameters to hook scripts 191# Pass maintainer script parameters to hook scripts
185export DEB_MAINT_PARAMS="\$*" 192export DEB_MAINT_PARAMS="\$*"
186 193
194# Tell initramfs builder whether it's wanted
195export INITRD=$want_initrd
196
187test -d $debhookdir/$script.d && run-parts --arg="$version" --arg="/$installed_image_path" $debhookdir/$script.d 197test -d $debhookdir/$script.d && run-parts --arg="$version" --arg="/$installed_image_path" $debhookdir/$script.d
188exit 0 198exit 0
189EOF 199EOF