diff -Nru initramfs-tools-0.142ubuntu1/debian/changelog initramfs-tools-0.142ubuntu2/debian/changelog --- initramfs-tools-0.142ubuntu1/debian/changelog 2022-09-01 20:43:43.000000000 +0800 +++ initramfs-tools-0.142ubuntu2/debian/changelog 2023-03-25 00:38:03.000000000 +0800 @@ -1,3 +1,9 @@ +initramfs-tools (0.142ubuntu2) lunar; urgency=medium + + * Add scripts/init-top/00_mount_efivarfs mounting efivarfs (LP: #1994936) + + -- Cyrus Lien Sat, 25 Mar 2023 00:38:03 +0800 + initramfs-tools (0.142ubuntu1) lunar; urgency=medium * Merge from Debian unstable (LP: #1988418). Remaining changes: diff -Nru initramfs-tools-0.142ubuntu1/hook-functions initramfs-tools-0.142ubuntu2/hook-functions --- initramfs-tools-0.142ubuntu1/hook-functions 2022-09-01 20:43:43.000000000 +0800 +++ initramfs-tools-0.142ubuntu2/hook-functions 2023-03-25 00:38:03.000000000 +0800 @@ -946,7 +946,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.142ubuntu1/hooks/fsck initramfs-tools-0.142ubuntu2/hooks/fsck --- initramfs-tools-0.142ubuntu1/hooks/fsck 2022-09-01 20:43:43.000000000 +0800 +++ initramfs-tools-0.142ubuntu2/hooks/fsck 2023-03-25 00:38:03.000000000 +0800 @@ -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 if ! get_fstype "${MNT_FSNAME}"; then echo "W: Couldn't identify type of $2 file system for fsck hook" >&2 fi diff -Nru initramfs-tools-0.142ubuntu1/init initramfs-tools-0.142ubuntu2/init --- initramfs-tools-0.142ubuntu1/init 2022-09-01 20:43:43.000000000 +0800 +++ initramfs-tools-0.142ubuntu2/init 2023-03-25 00:38:03.000000000 +0800 @@ -254,7 +254,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 @@ -284,7 +284,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.142ubuntu1/lsinitramfs initramfs-tools-0.142ubuntu2/lsinitramfs --- initramfs-tools-0.142ubuntu1/lsinitramfs 2022-09-01 20:43:43.000000000 +0800 +++ initramfs-tools-0.142ubuntu2/lsinitramfs 2023-03-25 00:38:03.000000000 +0800 @@ -53,5 +53,6 @@ fi for initramfs in "$@" ; do + # shellcheck disable=SC2086 unmkinitramfs $umi_opts -- "$initramfs" done diff -Nru initramfs-tools-0.142ubuntu1/mkinitramfs initramfs-tools-0.142ubuntu2/mkinitramfs --- initramfs-tools-0.142ubuntu1/mkinitramfs 2022-09-01 20:43:43.000000000 +0800 +++ initramfs-tools-0.142ubuntu2/mkinitramfs 2023-03-25 00:38:03.000000000 +0800 @@ -270,6 +270,7 @@ __TMPCPIOGZ= __TMPMAINCPIO= __TMPEARLYCPIO= +# shellcheck disable=SC2317 clean_on_exit() { if [ "${keep}" = "y" ]; then echo "Working files in ${DESTDIR:-}," \ @@ -484,6 +485,7 @@ # Remove any looping or broken symbolic links, since they break cpio. [ "${verbose}" = y ] && xargs_verbose="-t" +# shellcheck disable=SC2086 (cd "${DESTDIR}" && find . -type l -printf '%p %Y\n' | sed -n 's/ [LN]$//p' \ | xargs ${xargs_verbose:-} -rL1 rm -f) diff -Nru initramfs-tools-0.142ubuntu1/scripts/functions initramfs-tools-0.142ubuntu2/scripts/functions --- initramfs-tools-0.142ubuntu1/scripts/functions 2022-09-01 20:43:43.000000000 +0800 +++ initramfs-tools-0.142ubuntu2/scripts/functions 2023-03-25 00:38:03.000000000 +0800 @@ -959,7 +959,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.142ubuntu1/scripts/init-top/00_mount_efivarfs initramfs-tools-0.142ubuntu2/scripts/init-top/00_mount_efivarfs --- initramfs-tools-0.142ubuntu1/scripts/init-top/00_mount_efivarfs 1970-01-01 08:00:00.000000000 +0800 +++ initramfs-tools-0.142ubuntu2/scripts/init-top/00_mount_efivarfs 2023-03-25 00:37:58.000000000 +0800 @@ -0,0 +1,19 @@ +#!/bin/sh + +PREREQ="" +prereqs() +{ + echo "$PREREQ" +} +case $1 in +# get pre-requisites +prereqs) + prereqs + exit 0 + ;; +esac + +# shellcheck disable=SC2013 +if [ -d /sys/firmware/efi/efivars ]; then + mount -t efivarfs efivarfs -o nosuid,nodev,noexec /sys/firmware/efi/efivars +fi diff -Nru initramfs-tools-0.142ubuntu1/unmkinitramfs initramfs-tools-0.142ubuntu2/unmkinitramfs --- initramfs-tools-0.142ubuntu1/unmkinitramfs 2022-09-01 20:43:43.000000000 +0800 +++ initramfs-tools-0.142ubuntu2/unmkinitramfs 2023-03-25 00:38:03.000000000 +0800 @@ -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 @@ -122,11 +122,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" # shellcheck disable=SC2030,SC2031 xcpio "$subarchive" "${dir:+$dir/main}" -i "$@" diff -Nru initramfs-tools-0.142ubuntu1/update-initramfs initramfs-tools-0.142ubuntu2/update-initramfs --- initramfs-tools-0.142ubuntu1/update-initramfs 2022-09-01 20:43:43.000000000 +0800 +++ initramfs-tools-0.142ubuntu2/update-initramfs 2023-03-25 00:38:03.000000000 +0800 @@ -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