kbuild: deb-pkg: do not include empty hook directories
authorMasahiro Yamada <masahiroy@kernel.org>
Tue, 3 Dec 2024 13:59:58 +0000 (22:59 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Fri, 10 Jan 2025 14:01:21 +0000 (23:01 +0900)
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>
scripts/package/builddeb

index ad7aba0f268e1ff3b6f4d723d8284b9f8fba8768..85fe8f56bb9badf41bfc7b71c56f74884a47e019 100755 (executable)
@@ -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