diff options
| -rw-r--r-- | scripts/package/builddeb | 12 |
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. | ||
| 176 | debhookdir=${KDEB_HOOKDIR:-/etc/kernel} | 178 | debhookdir=${KDEB_HOOKDIR:-/etc/kernel} |
| 179 | if grep -q '^CONFIG_BLK_DEV_INITRD=y' $KCONFIG_CONFIG; then | ||
| 180 | want_initrd=Yes | ||
| 181 | else | ||
| 182 | want_initrd=No | ||
| 183 | fi | ||
| 177 | for script in postinst postrm preinst prerm ; do | 184 | for 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 |
| 185 | export DEB_MAINT_PARAMS="\$*" | 192 | export DEB_MAINT_PARAMS="\$*" |
| 186 | 193 | ||
| 194 | # Tell initramfs builder whether it's wanted | ||
| 195 | export INITRD=$want_initrd | ||
| 196 | |||
| 187 | test -d $debhookdir/$script.d && run-parts --arg="$version" --arg="/$installed_image_path" $debhookdir/$script.d | 197 | test -d $debhookdir/$script.d && run-parts --arg="$version" --arg="/$installed_image_path" $debhookdir/$script.d |
| 188 | exit 0 | 198 | exit 0 |
| 189 | EOF | 199 | EOF |
