mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-29 04:03:01 +02:00
Reduce /var image size to 128M (resized at first boot anyway) and tune mke2fs options for faster mounting. Set ext4 'uninit_bg' feature and use '-m 0 -i 4096' extraargs in genimage to optimize filesystem creation and reduce overhead. The genimage tool has several tweaks enabled by default already, the 'uninit_bg' feature speeds up the time to check the file system. Disable periodic fsck with tune2fs at boot while keeping safety checks intact. Adjust mount options in fstab to reduce journal syncs and improve boot time. Fix severe performance regression in find_partition_by_label() that was calling sgdisk on every block device including virtual devices (ram, loop, dm-mapper). This caused boot delays of up to 24 seconds on systems with many block devices. Now skip virtual devices that don't have GPT tables, reducing the delay to ~2 seconds. Also clean up is_mmc() function to use cached result. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
41 lines
923 B
Bash
Executable File
41 lines
923 B
Bash
Executable File
#!/bin/sh
|
|
|
|
rootdir=$BUILD_DIR/genimage.root
|
|
tempdir=$BUILD_DIR/genimage.tmp
|
|
|
|
cat <<EOF > /tmp/mkaux.cfg
|
|
image aux.ext4 {
|
|
mountpoint = "/aux"
|
|
size = 16M
|
|
|
|
ext4 {
|
|
label = "aux"
|
|
use-mke2fs = true
|
|
features = "^metadata_csum,^metadata_csum_seed,uninit_bg"
|
|
extraargs = "-m 0 -i 4096"
|
|
}
|
|
}
|
|
|
|
# Silence genimage warnings
|
|
config {}
|
|
EOF
|
|
|
|
rm -rf "$rootdir/aux"
|
|
mkdir -p "$rootdir/aux"
|
|
cp -f "$BINARIES_DIR/rootfs.itbh" "$rootdir/aux/primary.itbh"
|
|
cp -f "$BINARIES_DIR/rootfs.itbh" "$rootdir/aux/secondary.itbh"
|
|
cp -f "$BINARIES_DIR/rauc.status" "$rootdir/aux/rauc.status"
|
|
|
|
mkenvimage -s 0x4000 -o "$rootdir/aux/uboot.env" \
|
|
"$BR2_EXTERNAL_INFIX_PATH/board/common/uboot/aux-env.txt"
|
|
|
|
rm -rf "$BINARIES_DIR/aux.ext4"
|
|
rm -rf "$tempdir"
|
|
|
|
genimage \
|
|
--rootpath "$rootdir" \
|
|
--tmppath "$tempdir" \
|
|
--inputpath "$BINARIES_DIR" \
|
|
--outputpath "$BINARIES_DIR" \
|
|
--config "/tmp/mkaux.cfg"
|