Commit baa45841 authored by Josua Mayer's avatar Josua Mayer

support booting from gzip compressed kernel image

U-Boot "booti" command can decompress gzip-compressed kernel
automatically, if a memory region has been specified as decompression
workspace through kernel_comp_addr_r & kernel_comp_size variables.

Switching generated images to include Image.gz frees up some space in
the 350MB initial rootfs and helps with journal errors during fist boot.
parent 850cda09
From 133c1f2434a6b8583feff488afda3dad10b1031c Mon Sep 17 00:00:00 2001
From: Josua Mayer <josua@solid-run.com>
Date: Wed, 14 Jun 2023 19:31:49 +0300
Subject: [PATCH] lx2160a_common: add kernel decompress workspace to default
environment
Signed-off-by: Josua Mayer <josua@solid-run.com>
---
include/configs/lx2160a_common.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/configs/lx2160a_common.h b/include/configs/lx2160a_common.h
index 556879375a..d0342b94a1 100644
--- a/include/configs/lx2160a_common.h
+++ b/include/configs/lx2160a_common.h
@@ -248,6 +248,8 @@ int select_i2c_ch_pca9547_n(int busnum, unsigned char ch);
#define EXTRA_ENV_SETTINGS \
DEFAULT_FDT_FILE_ENV \
"hwconfig=fsl_ddr:bank_intlv=auto\0" \
+ "kernel_comp_addr_r=0x9f000000\0" \
+ "kernel_comp_size=0x10000000\0" \
"ramdisk_addr=0x85100000\0" \
"ramdisk_addr_r=0x85100000\0" \
"ramdisk_size=0x2000000\0" \
--
2.35.3
......@@ -544,6 +544,7 @@ mkdir -p $ROOTDIR/images/tmp/
mkdir -p $ROOTDIR/images/tmp/boot
make INSTALL_MOD_PATH=$ROOTDIR/images/tmp/ INSTALL_MOD_STRIP=1 modules_install
cp $ROOTDIR/build/linux/arch/arm64/boot/Image $ROOTDIR/images/tmp/boot
cp $ROOTDIR/build/linux/arch/arm64/boot/Image.gz $ROOTDIR/images/tmp/boot
cp $ROOTDIR/build/linux/arch/arm64/boot/dts/freescale/fsl-lx216*.dtb $ROOTDIR/images/tmp/boot
......@@ -570,7 +571,7 @@ cat > $ROOTDIR/images/tmp/extlinux/extlinux.conf << EOF
menu title linux-lx2160a boot options
label primary
menu label primary kernel
linux /boot/Image
linux /boot/Image.gz
fdtdir /boot/
APPEND console=ttyAMA0,115200 earlycon=pl011,mmio32,0x21c0000 default_hugepagesz=1024m hugepagesz=1024m hugepages=2 pci=pcie_bus_perf root=PARTUUID=30303030-01 rw rootwait
EOF
......@@ -579,7 +580,7 @@ cp $ROOTDIR/build/$ROOTFS.ext4 $ROOTDIR/images/tmp/
e2mkdir -G 0 -O 0 $ROOTDIR/images/tmp/$ROOTFS.ext4:extlinux
e2cp -G 0 -O 0 $ROOTDIR/images/tmp/extlinux/extlinux.conf $ROOTDIR/images/tmp/$ROOTFS.ext4:extlinux/
e2mkdir -G 0 -O 0 $ROOTDIR/images/tmp/$ROOTFS.ext4:boot
e2cp -G 0 -O 0 $ROOTDIR/images/tmp/boot/Image $ROOTDIR/images/tmp/$ROOTFS.ext4:boot/
e2cp -G 0 -O 0 $ROOTDIR/images/tmp/boot/Image.gz $ROOTDIR/images/tmp/$ROOTFS.ext4:boot/
e2cp -G 0 -O 0 $ROOTDIR/images/tmp/boot/fsl-lx216*.dtb $ROOTDIR/images/tmp/$ROOTFS.ext4:boot/
# Copy over kernel image
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment