aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Baranov <reagentoo@gmail.com>2024-03-05 23:28:49 +0300
committerBen Kohler <bkohler@gentoo.org>2024-05-20 07:58:59 -0500
commit9d16c25da9935b1b0beb38357fe3c8b4ee2e236b (patch)
tree75d53602738796683ef415c0a76e4708e044e0ac /gen_initramfs.sh
parentgen_initramfs.sh: copy compressed firmwares (diff)
downloadgenkernel-9d16c25da9935b1b0beb38357fe3c8b4ee2e236b.tar.gz
genkernel-9d16c25da9935b1b0beb38357fe3c8b4ee2e236b.tar.bz2
genkernel-9d16c25da9935b1b0beb38357fe3c8b4ee2e236b.zip
gen_initramfs.sh: unpack compressed modules/firmwares to reduce image size
Signed-off-by: Dmitriy Baranov <reagentoo@gmail.com> Signed-off-by: Ben Kohler <bkohler@gentoo.org>
Diffstat (limited to 'gen_initramfs.sh')
-rwxr-xr-xgen_initramfs.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index 486f0e6..aaf108e 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -1806,6 +1806,10 @@ append_firmware() {
cp -rL --parents --target-directory="${TDIR}/lib/firmware" "${fwlist[@]}" 2>/dev/null \
|| gen_die "Failed to copy firmware files to '${TDIR}/lib/firmware'!"
popd &>/dev/null || gen_die "Failed to chdir!"
+
+ pushd "${TDIR}/lib/firmware" &>/dev/null || gen_die "Failed to chdir to '${TDIR}/lib/firmware'!"
+ find_and_unpack xz zstd
+ popd &>/dev/null || gen_die "Failed to chdir!"
fi
cd "${TDIR}" || gen_die "Failed to chdir to '${TDIR}'!"
@@ -1940,6 +1944,10 @@ append_modules() {
cp -ax --parents --target-directory "${modules_dstdir}" modules* 2>/dev/null \
|| gen_die "Failed to copy '${modules_srcdir}/modules*' to '${modules_dstdir}'!"
+ pushd "${modules_dstdir}" &>/dev/null || gen_die "Failed to chdir to '${modules_dstdir}'!"
+ find_and_unpack gz xz zstd
+ popd &>/dev/null || gen_die "Failed to chdir!"
+
print_info 2 "$(get_indent 2)modules: Updating modules.dep ..."
local depmod_cmd=( depmod -a -b "${TDIR}" ${KV} )
print_info 3 "COMMAND: ${depmod_cmd[*]}" 1 0 1