Merge branch 'support-missing-kernel-config' into 'master'

Skip compression support check if /boot/config-${version} is missing

See merge request kernel-team/initramfs-tools!104
This commit is contained in:
Ben Hutchings 2024-05-20 22:06:50 +00:00
commit 35711b4412

View File

@ -196,15 +196,20 @@ 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" "${kconfig}"; do
if [ "${compress}" = gzip ]; then
echo "E: gzip compression ($kconfig_sym) not supported by kernel" >&2
exit 1
fi
echo "W: ${compress} compression ($kconfig_sym) not supported by kernel, using gzip" >&2
compress=gzip
kconfig_sym=CONFIG_RD_GZIP
done
if [ -e "${kconfig}" ]; then
while ! grep -q "^$kconfig_sym=y" "${kconfig}"; do
if [ "${compress}" = gzip ]; then
echo "E: gzip compression ($kconfig_sym) not supported by kernel" >&2
exit 1
fi
echo "W: ${compress} compression ($kconfig_sym) not supported by kernel, using gzip" >&2
compress=gzip
kconfig_sym=CONFIG_RD_GZIP
done
else
echo "W: Kernel configuration ${kconfig} is missing, ${compress} compression" \
"support ($kconfig_sym) cannot be checked and is assumed to be available" >&2
fi
if [ -z "${compresslevel:-}" ]; then
compresslevel=${COMPRESSLEVEL:-}