update-initramfs: use "set -u"

Support `set -u` in update-initramfs and use it.
This commit is contained in:
Benjamin Drung 2025-06-27 13:25:57 +02:00
parent 27544d4a9c
commit afb3ba3ac6

View File

@ -1,5 +1,5 @@
#!/bin/sh
set -e
set -eu
BOOTDIR=/boot
CONF=/etc/initramfs-tools/update-initramfs.conf
@ -10,7 +10,7 @@ backup_initramfs=no
[ -r ${CONF} ] && . ${CONF}
if [ -n "$DPKG_MAINTSCRIPT_PACKAGE" ] && [ $# = 1 ] && [ "$1" = -u ]; then
if [ -n "${DPKG_MAINTSCRIPT_PACKAGE-}" ] && [ $# = 1 ] && [ "$1" = -u ]; then
if dpkg-trigger --no-await update-initramfs; then
echo "update-initramfs: deferring update (trigger activated)"
# The /run/update-initramfs.dpkg-trigger file is just a workaround.