Use compressed squashfs for kernel (#1418)
* Add squashfs with LZ4 and LZO compression to Barebox * Add squashfs with LZO compression to U-Boot * Use squashfs for Linux kernel partition Generate a squashfs image with LZO compression for the Linux kernel partition. Adjust the boot scripts to be file system independent commands to boot from squashfs.
This commit is contained in:
@@ -89,14 +89,7 @@ function create_kernel_image() {
|
||||
|
||||
# Make image
|
||||
rm -f "${kernel_img}"
|
||||
truncate --size="${KERNEL_SIZE}" "${kernel_img}"
|
||||
mkfs.ext4 -L "hassos-kernel" -E lazy_itable_init=0,lazy_journal_init=0 -O ^64bit "${kernel_img}"
|
||||
|
||||
# Mount / init file structs
|
||||
sudo mkdir -p /mnt/data/
|
||||
sudo mount -o loop "${kernel_img}" /mnt/data
|
||||
sudo cp "${kernel}" /mnt/data/
|
||||
sudo umount /mnt/data
|
||||
mksquashfs "${kernel}" "${kernel_img}" -comp lzo
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ function path_spl_img() {
|
||||
}
|
||||
|
||||
function path_kernel_img() {
|
||||
echo "${BINARIES_DIR}/kernel.ext4"
|
||||
echo "${BINARIES_DIR}/kernel.img"
|
||||
}
|
||||
|
||||
function path_boot_img() {
|
||||
|
||||
@@ -5,7 +5,7 @@ function create_ota_update() {
|
||||
local ota_file="$(hassos_image_name raucb)"
|
||||
local rauc_folder="${BINARIES_DIR}/rauc"
|
||||
local boot="${BINARIES_DIR}/boot.vfat"
|
||||
local kernel="${BINARIES_DIR}/kernel.ext4"
|
||||
local kernel="${BINARIES_DIR}/kernel.img"
|
||||
local rootfs="${BINARIES_DIR}/rootfs.squashfs"
|
||||
local spl="${BINARIES_DIR}/spl.img"
|
||||
local key="/build/key.pem"
|
||||
@@ -21,7 +21,7 @@ function create_ota_update() {
|
||||
rm -rf "${rauc_folder}" "${ota_file}"
|
||||
mkdir -p "${rauc_folder}"
|
||||
|
||||
cp -f "${kernel}" "${rauc_folder}/kernel.ext4"
|
||||
cp -f "${kernel}" "${rauc_folder}/kernel.img"
|
||||
cp -f "${boot}" "${rauc_folder}/boot.vfat"
|
||||
cp -f "${rootfs}" "${rauc_folder}/rootfs.img"
|
||||
cp -f "${BR2_EXTERNAL_HASSOS_PATH}/ota/rauc-hook" "${rauc_folder}/hook"
|
||||
@@ -37,7 +37,7 @@ function create_ota_update() {
|
||||
echo "filename=boot.vfat"
|
||||
echo "hooks=install"
|
||||
echo "[image.kernel]"
|
||||
echo "filename=kernel.ext4"
|
||||
echo "filename=kernel.img"
|
||||
echo "[image.rootfs]"
|
||||
echo "filename=rootfs.img"
|
||||
) > "${rauc_folder}/manifest.raucm"
|
||||
|
||||
@@ -43,7 +43,7 @@ function _write_rauc_system() {
|
||||
(
|
||||
echo "[slot.kernel.${slot_num}]"
|
||||
echo "device=/dev/disk/by-partlabel/hassos-kernel${slot_num}"
|
||||
echo "type=ext4"
|
||||
echo "type=raw"
|
||||
echo "bootname=${slot_name}"
|
||||
|
||||
echo "[slot.rootfs.${slot_num}]"
|
||||
|
||||
Reference in New Issue
Block a user