Skip to content

Commit

Permalink
kbuild: deb-pkg: do not include empty hook directories
Browse files Browse the repository at this point in the history
The linux-image package currently includes empty hook directories
(/etc/kernel/{pre,post}{inst,rm}.d/ by default).

These directories were perhaps intended as a fail-safe in case no
hook scripts exist there.

However, they are really unnecessary because the run-parts command is
already guarded by the following check:

    test -d ${debhookdir}/${script}.d && run-parts ...

The only difference is that the run-parts command either runs for empty
directories (resulting in a no-op) or is skipped entirely.

The maintainer scripts will succeed without these dummy directories.

The linux-image packages from the Debian kernel do not contain
/etc/kernel/*.d/, either.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
  • Loading branch information
Masahiro Yamada committed Jan 10, 2025
1 parent 9d89551 commit d9ecb92
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions scripts/package/builddeb
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ install_maint_scripts () {
# so do we; recent versions of dracut and initramfs-tools will obey this.
debhookdir=${KDEB_HOOKDIR:-/etc/kernel}
for script in postinst postrm preinst prerm; do
mkdir -p "${pdir}${debhookdir}/${script}.d"

mkdir -p "${pdir}/DEBIAN"
cat <<-EOF > "${pdir}/DEBIAN/${script}"
#!/bin/sh
Expand Down

0 comments on commit d9ecb92

Please sign in to comment.