initramfs-tools update

This commit is contained in:
aliriza committed 2023-02-10 13:35:11 +00:00
1 parent f5ee81daee
commit 94e8b22eff
5 files changed
+37 -4

No files matched your search

@@ -0,0 +1,30 @@
diff --git a/hook-functions b/hook-functions
index 95bd584..1909e8d 100644
--- a/hook-functions
+++ b/hook-functions
@@ -200,7 +200,7 @@ copy_file() {
# Create a relative link so it always points
# to the right place
- ln -rs "${DESTDIR}/${link_target}" "${DESTDIR}/${target}"
+ ln -s "${DESTDIR}/${link_target}" "${DESTDIR}/${target}"
fi
# Copy the link target if it doesn't already exist
@@ -863,7 +863,7 @@ cache_run_scripts()
[ ! -d "${initdir}" ] && return
true > "${initdir}/ORDER"
- runlist=$(get_prereq_pairs | tsort)
+ runlist=$(get_prereq_pairs | sort)
for crs_x in ${runlist}; do
[ -f "${initdir}/${crs_x}" ] || continue
echo "${scriptdir}/${crs_x} \"\$@\"" >> "${initdir}/ORDER"
@@ -901,6 +901,6 @@ run_scripts()
initdir=${1}
[ ! -d "${initdir}" ] && return
- runlist=$(get_prereq_pairs | tsort)
+ runlist=$(get_prereq_pairs | sort)
call_scripts "$scriptdir"
}
@@ -0,0 +1,53 @@
diff --git a/hooks/resume b/hooks/resume
index 8ff84dd..439fe18 100755
--- a/hooks/resume
+++ b/hooks/resume
@@ -50,7 +50,7 @@ report_verbose "Configuration sets RESUME=$RESUME"
# Try to autodetect the RESUME partition, using biggest swap device that
# is not ephemeral. We need to be able to read the listed swap partitions.
resume_auto=
-if ! ischroot && [ -r /proc/swaps ]; then
+if ! [ `stat -c %d:%i /proc/$$/root/` == `stat -c %d:%i /` ] && [ -r /proc/swaps ]; then
# shellcheck disable=SC2013
for resume_auto in $(grep ^/dev/ /proc/swaps | sort -rnk3 | cut -d " " -f 1); do
report_verbose "Checking swap device $resume_auto"
diff --git a/mkinitramfs b/mkinitramfs
index df1b940..bdd71e4 100755
--- a/mkinitramfs
+++ b/mkinitramfs
@@ -284,7 +284,21 @@ __TMPCPIOGZ="$(mktemp "${TMPDIR:-/var/tmp}/mkinitramfs-OL_XXXXXX")" || exit 1
__TMPMAINCPIO="$(mktemp "${TMPDIR:-/var/tmp}/mkinitramfs-MAIN_XXXXXX")" || exit 1
__TMPEARLYCPIO="$(mktemp "${TMPDIR:-/var/tmp}/mkinitramfs-FW_XXXXXX")" || exit 1
-DPKG_ARCH=$(dpkg --print-architecture)
+get_dpkg_arch(){
+ case `uname -m` in
+ x86_64)
+ echo amd64
+ ;;
+ i686)
+ echo i386
+ ;;
+ aarch64)
+ echo arm64
+ ;;
+ esac
+}
+
+DPKG_ARCH=$(get_dpkg_arch)
# Export environment for hook scripts.
#
diff --git a/update-initramfs b/update-initramfs
index 746a6c1..0047670 100755
--- a/update-initramfs
+++ b/update-initramfs
@@ -167,7 +167,7 @@ run_bootloader()
ro_boot_check()
{
# check irrelevant inside of a chroot
- if [ ! -r /proc/mounts ] || ischroot; then
+ if [ ! -r /proc/mounts ] || [ `stat -c %d:%i /proc/$$/root/` == `stat -c %d:%i /` ]; then
return 0
fi
@@ -0,0 +1,20 @@
diff --git a/scripts/functions b/scripts/functions
index ae11b96..ec4e793 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -496,13 +496,13 @@ _checkfs_once()
then
log_begin_msg "Will now check $NAME file system"
# shellcheck disable=SC2086
- logsave -a -s $FSCK_LOGFILE fsck $spinner $force $fix -V -t "$TYPE" "$DEV"
+ fsck $spinner $force $fix -V -t "$TYPE" "$DEV" >> $FSCK_LOGFILE
FSCKCODE=$?
log_end_msg
else
log_begin_msg "Checking $NAME file system"
# shellcheck disable=SC2086
- logsave -a -s $FSCK_LOGFILE fsck $spinner $force $fix -T -t "$TYPE" "$DEV"
+ fsck $spinner $force $fix -T -t "$TYPE" "$DEV" >> $FSCK_LOGFILE
FSCKCODE=$?
log_end_msg
fi
@@ -0,0 +1,82 @@
diff --git a/conf/initramfs.conf b/conf/initramfs.conf
index aa561bd..bf80786 100644
--- a/conf/initramfs.conf
+++ b/conf/initramfs.conf
@@ -38,10 +38,10 @@ BUSYBOX=auto
KEYMAP=n
#
-# COMPRESS: [ gzip | bzip2 | lz4 | lzma | lzop | xz | zstd ]
+# COMPRESS: [ gzip | bzip2 | lz4 | lzma | lzop | xz ]
#
-COMPRESS=zstd
+COMPRESS=gzip
#
# COMPRESSLEVEL: ...
@@ -52,7 +52,6 @@ COMPRESS=zstd
# Valid values are:
# 1 - 9 for gzip|bzip2|lzma|lzop
# 0 - 9 for lz4|xz
-# 0 - 19 for zstd
#
# COMPRESSLEVEL=3
diff --git a/mkinitramfs b/mkinitramfs
index df1b940..166bffb 100755
--- a/mkinitramfs
+++ b/mkinitramfs
@@ -188,7 +188,6 @@ lzma) kconfig_sym=CONFIG_RD_LZMA ;;
xz) kconfig_sym=CONFIG_RD_XZ ;;
lzop) kconfig_sym=CONFIG_RD_LZO ;;
lz4) kconfig_sym=CONFIG_RD_LZ4 ;;
-zstd) kconfig_sym=CONFIG_RD_ZSTD ;;
esac
while ! grep -q "^$kconfig_sym=y" "/boot/config-${version}"; do
if [ "${compress}" = gzip ]; then
@@ -205,7 +204,6 @@ if [ -z "${compresslevel:-}" ]; then
fi
case "${compress}" in
lz4) compresslevel="-${compresslevel:-9}" ;;
-zstd) compresslevel="-${compresslevel:-9}" ;;
#gzip|xz|bzip2|lzma|lzop included
*)
# We're not using a compression level by default
@@ -227,10 +225,6 @@ gzip) # If we're doing a reproducible build, use gzip -n
fi
;;
lz4) compress="lz4 ${compresslevel} -l" ;;
-zstd) compress="zstd -q ${compresslevel}"
- # If we're not doing a reproducible build, enable multithreading
- test -z "${SOURCE_DATE_EPOCH}" && compress="$compress -T0"
- ;;
xz) compress="xz ${compresslevel} --check=crc32"
# If we're not doing a reproducible build, enable multithreading
test -z "${SOURCE_DATE_EPOCH}" && compress="$compress --threads=0"
@@ -426,12 +420,6 @@ find "${DESTDIR}/${MODULESDIR}" -name '*.ko.*' | while read -r ko; do
fi
xz -d "${ko}"
;;
- *.zst)
- if ! command -v zstd >/dev/null 2>&1; then
- break
- fi
- zstd -q -d --rm "${ko}"
- ;;
esac
done
diff --git a/unmkinitramfs b/unmkinitramfs
index d1226c3..3f8c75d 100755
--- a/unmkinitramfs
+++ b/unmkinitramfs
@@ -31,8 +31,6 @@ xcpio()
if gzip -t "$archive" >/dev/null 2>&1 ; then
gzip -c -d "$archive"
- elif zstd -q -c -t "$archive" >/dev/null 2>&1 ; then
- zstd -q -c -d "$archive"
elif xzcat -t "$archive" >/dev/null 2>&1 ; then
xzcat "$archive"
elif lz4cat -t < "$archive" >/dev/null 2>&1 ; then