Merge branch 'small-fixes' into 'debian/latest'

Some small fixes

See merge request kernel-team/initramfs-tools!153
This commit is contained in:
Ben Hutchings 2025-01-19 23:07:46 +00:00
commit 731307071d
3 changed files with 31 additions and 2 deletions

View File

@ -24,7 +24,8 @@ if [ -n "$RESUME" ] && [ "$RESUME" != auto ]; then
exit 0
fi
if resume_dev_node="$(resolve_device "$RESUME")" && \
blkid -p -n swap "$resume_dev_node" >/dev/null 2>&1; then
resume_dev_type=$(blkid -p -s TYPE -o value "$resume_dev_node") && \
[ "$resume_dev_type" = swap ]; then
exit 0
fi

5
init
View File

@ -101,7 +101,10 @@ for x in $(cat /proc/cmdline); do
ROOTFLAGS="-o ${x#rootflags=}"
;;
rootfstype=*)
ROOTFSTYPE="${x#rootfstype=}"
# Linux interprets 'rootfstype=*tmpfs*' to control the
# initramfs filesystem; we should remove 'tmpfs' from
# the list
ROOTFSTYPE="$(list_filter_out "${x#rootfstype=}" tmpfs)"
;;
rootdelay=*)
ROOTDELAY="${x#rootdelay=}"

View File

@ -660,6 +660,31 @@ mountfs()
${type}_mount_fs "$1"
}
# Filter matching items out of a comma-separated list.
# $1=list
# $2=pattern to match (may include shell wildcards)
list_filter_out()
{
local pattern="$2"
local item result
local IFS=,
set -f
# shellcheck disable=SC2086
set -- $1
set +f
for item in "$@"; do
# shellcheck disable=SC2254
case "$item" in
$pattern)
;;
*)
result="${result:+$result,}${item}"
;;
esac
done
echo "$result"
}
# Mount the root file system. It should be overridden by all
# boot scripts.
mountroot()