Package: release.debian.org
Severity: normal
Tags: bookworm
X-Debbugs-Cc: initramfs-to...@packages.debian.org, 
debian-ker...@lists.debian.org
Control: affects -1 + src:initramfs-tools
User: release.debian....@packages.debian.org
Usertags: pu

[ Reason ]
- Some important drivers are currently not included in the initramfs
  by default.
- If the same file is added to the initramfs and named through
  multiple directory symlinks, it is duplicated in the initramfs.  
  
[ Impact ]
- Currently keyboard input does not work in the initramfs environment
  on some systems.  This prevents entering a decryption password or
  using the panic shell.
- On some systems booting from USB storage, power to the storage may
  be interrupted after it is already mounted.
- If the Nvidia GSP firmware is installed, either from a (planned)
  backport of firmware-nonfree or from upstream linux-firmware.git,
  and plymouth is installed, then the initramfs ends up being huge,
  often filling the /boot partition (bug #1076539).
  - This is a blocker for updating firmware-nonfree in
    bookworm-backports.  An alternative would be to update
    initramfs-tools in bookworm-backports first, but that would
    require also backporting dracut since initramfs-tools-core depends
    on dracut-install.

[ Tests ]
There are autopkgtest test cases that cover various boot
configurations.

The change to symlink handling has been tested together with
firmware-nvidia-graphics from unstable.  I will also test the backport
with reiserfsprogs (not yet done).

[ Risks ]
There is some risk of regression from changes to the handling of
symlinked directories.  The initial fix for this led to breakage
for reiserfsprogs (bug #1079276), but that has been resolved.

[ Checklist ]
  [X] *all* changes are documented in the d/changelog
  [X] I reviewed all changes and I approve them
  [X] attach debdiff against the package in (old)stable
  [X] the issue is verified as fixed in unstable

[ Changes ]
* Get CI passing:
  - d/salsa-ci.yml: Set RELEASE to bookworm
  - Fix/ignore ShellCheck findings
  - test: Fix too small ext2 block count
* Include missing drivers:
  - Add hyper-keyboard module, needed to enter LUKS password in Hyper-V
  - install hid-multitouch module for Surface Pro 4 Keyboard
  - hook-functions: auto_add_modules: Add onboard_usb_hub, onboard_usb_dev
* Fix bug #1076539 for users installing upstream firmware and in
  preparation for a backport of firmware-nonfree:
  - hook_functions: Fix copy_file with source including a directory symlink
  - hook-functions: copy_file: Canonicalise target filename
diff -Nru initramfs-tools-0.142/debian/changelog 
initramfs-tools-0.142+deb12u1/debian/changelog
--- initramfs-tools-0.142/debian/changelog      2022-07-12 23:51:34.000000000 
+0200
+++ initramfs-tools-0.142+deb12u1/debian/changelog      2024-08-23 
15:18:27.000000000 +0200
@@ -1,3 +1,30 @@
+initramfs-tools (0.142+deb12u1) bookworm; urgency=medium
+
+  [ Ben Hutchings ]
+  * [522d475] d/salsa-ci.yml: Set RELEASE to bookworm
+  * [05e5fb9] hook_functions: Fix copy_file with source including a directory
+    symlink
+  * [f52ae2d] hook-functions: copy_file: Canonicalise target filename
+    (Closes: #1079276)
+
+  [ szubersk ]
+  * [d502a7f] Fix/ignore ShellCheck findings
+
+  [ Benjamin Drung ]
+  * [ce185c3] test: Fix too small ext2 block count
+  * [cd5e8e8] install hid-multitouch module for Surface Pro 4 Keyboard
+    (LP: #1772094)
+
+  [ Arnaud Rebillout ]
+  * [4cc2bc7] Add hyper-keyboard module, needed to enter LUKS password in
+    Hyper-V (Closes: #1028511)
+
+  [ Alper Nebi Yasak ]
+  * [5d28dad] hook-functions: auto_add_modules: Add onboard_usb_hub,
+    onboard_usb_dev
+
+ -- Ben Hutchings <b...@debian.org>  Fri, 23 Aug 2024 15:18:27 +0200
+
 initramfs-tools (0.142) unstable; urgency=medium
 
   [ Dan Streetman ]
diff -Nru initramfs-tools-0.142/debian/salsa-ci.yml 
initramfs-tools-0.142+deb12u1/debian/salsa-ci.yml
--- initramfs-tools-0.142/debian/salsa-ci.yml   2022-07-12 23:51:34.000000000 
+0200
+++ initramfs-tools-0.142+deb12u1/debian/salsa-ci.yml   2024-08-22 
20:55:59.000000000 +0200
@@ -3,7 +3,7 @@
   - 
https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml
 
 variables:
-  RELEASE: 'unstable'
+  RELEASE: 'bookworm'
   # We only build arch:all packages
   SALSA_CI_DISABLE_BLHC: 'true'
   SALSA_CI_DISABLE_BUILD_PACKAGE_I386: 'true'
diff -Nru initramfs-tools-0.142/debian/tests/test-common 
initramfs-tools-0.142+deb12u1/debian/tests/test-common
--- initramfs-tools-0.142/debian/tests/test-common      2020-09-13 
20:25:12.000000000 +0200
+++ initramfs-tools-0.142+deb12u1/debian/tests/test-common      2024-08-22 
21:30:14.000000000 +0200
@@ -71,7 +71,7 @@
        local inodes="$(du --summarize --inodes "${dir}" | cut -f 1)"
 
        # Add fudge factor
-       blocks="$((blocks + 20 + blocks / 4))"
+       blocks="$((blocks + 28 + blocks / 4))"
        inodes="$((inodes + 10))"
 
        # genext2fs writes status messages to stderr; hide that from
diff -Nru initramfs-tools-0.142/hook-functions 
initramfs-tools-0.142+deb12u1/hook-functions
--- initramfs-tools-0.142/hook-functions        2022-06-20 22:54:17.000000000 
+0200
+++ initramfs-tools-0.142+deb12u1/hook-functions        2024-08-22 
21:30:14.000000000 +0200
@@ -172,6 +172,10 @@
                target="${target}/${src##*/}"
        fi
 
+       # Canonicalise target to be absolute, so the comparisons below
+       # will work
+       target="$(realpath -ms "/${target}")" || return 2
+
        # Canonicalise usr-merged target directories
        case "${target}" in
        /bin/* | /lib* | /sbin/*) target="/usr${target}" ;;
@@ -182,11 +186,12 @@
 
        mkdir -p "${DESTDIR}/${target%/*}"
 
-       if [ -h "${src}" ]; then
-               # We don't need to replicate a chain of links completely;
-               # just link directly to the ultimate target
-               link_target="$(readlink -f "${src}")" || return $(($? + 1))
-
+       # Check whether source or one of its ancestors is a symlink.
+       # If so, copy the symlink target and make the target a symlink
+       # too.  We don't need to replicate a chain of links completely;
+       # just link directly to the ultimate target.
+       link_target="$(readlink -f "${src}")" || return $(($? + 1))
+       if [ "${link_target}" != "$(realpath -s "$src")" ]; then
                # Update source for the copy
                src="${link_target}"
 
@@ -628,6 +633,10 @@
                        # required to initialize the USB host controllers
                        # on a number of armhf systems
                        modules="$modules axp20x_usb_power"
+                       # Add onboard_usb_hub so it can be probed before
+                       # mounts, otherwise it might reset power to a
+                       # USB disk already mounted as root
+                       modules="$modules onboard_usb_hub onboard_usb_dev"
 
                        # Include all keyboard drivers and all HID drivers
                        # unless we're sure they don't support keyboards.
@@ -638,8 +647,7 @@
                                'hid-*ff.ko' hid-a4tech.ko hid-cypress.ko \
                                hid-dr.ko hid-elecom.ko hid-gyration.ko \
                                hid-icade.ko hid-kensington.ko hid-kye.ko \
-                               hid-lcpower.ko hid-magicmouse.ko \
-                               hid-multitouch.ko hid-ntrig.ko \
+                               hid-lcpower.ko hid-magicmouse.ko hid-ntrig.ko \
                                hid-petalynx.ko hid-picolcd.ko hid-pl.ko \
                                hid-ps3remote.ko hid-quanta.ko \
                                'hid-roccat-ko*.ko' hid-roccat-pyra.ko \
@@ -649,6 +657,9 @@
                                hid-wiimote.ko hid-zydacron.ko
                        # needed to access keyboard on some ChromeOS devices
                        modules="$modules cros_ec_spi"
+                       # needed to access keyboard in Gen2 Hyper-V virtual
+                       # machines (e.g. full disk encryption scenarios)
+                       modules="$modules hyperv-keyboard"
 
                        # Any of these might be needed by other drivers
                        copy_modules_dir kernel/drivers/bus
@@ -885,7 +896,7 @@
                if [ "$ec" -ne 0 ]; then
                        echo "E: ${initdir}/${cs_x} failed with return $ec." >&2
                        # only errexit on mkinitramfs
-                       [ -n "${version}" ] && exit $ec
+                       [ -n "${version}" ] && exit "$ec"
                fi
                # allow boot scripts to modify exported boot parameters
                if [ -e /conf/param.conf ]; then
diff -Nru initramfs-tools-0.142/hooks/fsck 
initramfs-tools-0.142+deb12u1/hooks/fsck
--- initramfs-tools-0.142/hooks/fsck    2022-06-20 16:06:08.000000000 +0200
+++ initramfs-tools-0.142+deb12u1/hooks/fsck    2024-08-22 21:30:14.000000000 
+0200
@@ -52,6 +52,7 @@
                # therefore never used at boot time
                if [ "${MNT_DIR}" = "/" ] || [ "${MNT_TYPE}" = "auto" ]; then
                        MNT_FSNAME="$(resolve_device "${MNT_FSNAME}")"
+                       # shellcheck disable=SC2317
                        fstype() { "/usr/lib/klibc/bin/fstype" "$@"; }
                        if ! get_fstype "${MNT_FSNAME}"; then
                                echo "W: Couldn't identify type of $2 file 
system for fsck hook" >&2
diff -Nru initramfs-tools-0.142/init initramfs-tools-0.142+deb12u1/init
--- initramfs-tools-0.142/init  2022-04-10 21:59:31.000000000 +0200
+++ initramfs-tools-0.142+deb12u1/init  2024-08-22 21:30:14.000000000 +0200
@@ -209,7 +209,7 @@
 mkdir -m 0700 /run/initramfs
 
 if [ -n "$log_output" ]; then
-       exec >$log_output 2>&1
+       exec >"$log_output" 2>&1
        unset log_output
 fi
 
@@ -243,7 +243,7 @@
 # /usr, irrespective of the boot script used to mount the rootfs).
 . /scripts/local
 . /scripts/nfs
-. /scripts/${BOOT}
+. "/scripts/${BOOT}"
 parse_numeric "${ROOT}"
 maybe_break mountroot
 mount_top
diff -Nru initramfs-tools-0.142/lsinitramfs 
initramfs-tools-0.142+deb12u1/lsinitramfs
--- initramfs-tools-0.142/lsinitramfs   2020-09-01 01:59:17.000000000 +0200
+++ initramfs-tools-0.142+deb12u1/lsinitramfs   2024-08-22 21:30:14.000000000 
+0200
@@ -53,5 +53,6 @@
 fi
 
 for initramfs in "$@" ; do
+       # shellcheck disable=SC2086
        unmkinitramfs $umi_opts -- "$initramfs"
 done
diff -Nru initramfs-tools-0.142/mkinitramfs 
initramfs-tools-0.142+deb12u1/mkinitramfs
--- initramfs-tools-0.142/mkinitramfs   2022-07-12 23:50:46.000000000 +0200
+++ initramfs-tools-0.142+deb12u1/mkinitramfs   2024-08-22 21:30:14.000000000 
+0200
@@ -261,6 +261,7 @@
 __TMPCPIOGZ=
 __TMPMAINCPIO=
 __TMPEARLYCPIO=
+# shellcheck disable=SC2317
 clean_on_exit() {
        if [ "${keep}" = "y" ]; then
                echo "Working files in ${DESTDIR:-<not yet created>}," \
diff -Nru initramfs-tools-0.142/scripts/functions 
initramfs-tools-0.142+deb12u1/scripts/functions
--- initramfs-tools-0.142/scripts/functions     2022-04-10 22:59:52.000000000 
+0200
+++ initramfs-tools-0.142+deb12u1/scripts/functions     2024-08-22 
21:30:14.000000000 +0200
@@ -524,7 +524,7 @@
                log_warning_msg "File system check failed but did not detect 
errors"
                sleep 5
        else
-               true > $FSCK_STAMPFILE
+               true >"$FSCK_STAMPFILE"
        fi
        return 0
 }
diff -Nru initramfs-tools-0.142/unmkinitramfs 
initramfs-tools-0.142+deb12u1/unmkinitramfs
--- initramfs-tools-0.142/unmkinitramfs 2020-09-01 01:59:17.000000000 +0200
+++ initramfs-tools-0.142+deb12u1/unmkinitramfs 2024-08-22 21:30:14.000000000 
+0200
@@ -95,7 +95,7 @@
                        test "$magic" = 070701 || test "$magic" = 070702 || 
break
                        namesize=0x$(readhex "$initramfs" $((end + 94)) 8)
                        filesize=0x$(readhex "$initramfs" $((end + 54)) 8)
-                       end=$(((end + 110)))
+                       end=$((end + 110))
                        end=$(((end + namesize + 3) & ~3))
                        end=$(((end + filesize + 3) & ~3))
                done
@@ -121,11 +121,11 @@
                start=$end
        done
 
-       if [ $end -gt 0 ]; then
+       if [ "$end" -gt 0 ]; then
                # Extract to main subdirectory
                subarchive=$(mktemp "${TMPDIR:-/var/tmp}/unmkinitramfs_XXXXXX")
                trap 'rm -f "$subarchive"' EXIT
-               dd < "$initramfs" skip=$end iflag=skip_bytes 2> /dev/null \
+               dd < "$initramfs" skip="$end" iflag=skip_bytes 2> /dev/null \
                        > "$subarchive"
                xcpio "$subarchive" "${dir:+$dir/main}" -i "$@"
        else
diff -Nru initramfs-tools-0.142/update-initramfs 
initramfs-tools-0.142+deb12u1/update-initramfs
--- initramfs-tools-0.142/update-initramfs      2022-04-10 21:59:31.000000000 
+0200
+++ initramfs-tools-0.142+deb12u1/update-initramfs      2024-08-22 
21:30:14.000000000 +0200
@@ -102,7 +102,7 @@
 
        # no backup yet
        if [ ! -r "${initramfs}.bak" ]; then
-               mv -f ${initramfs_bak} "${initramfs}.bak"
+               mv -f "${initramfs_bak}" "${initramfs}.bak"
                verbose "Backup ${initramfs}.bak"
                return 0
        fi
@@ -119,7 +119,7 @@
                return 0
        fi
        verbose "Removing current backup ${initramfs_bak}"
-       rm -f ${initramfs_bak}
+       rm -f "${initramfs_bak}"
 }
 
 # nuke generated copy

Reply via email to