From 89be70a498ec448a638184ed9f6f5c66351c6beb Mon Sep 17 00:00:00 2001 From: Tomaz Zaman Date: Mon, 10 Aug 2026 19:52:22 +0200 Subject: [PATCH 19/72] mono: shrink shipped rootfs to 256M (grow target 384M) Installed content is ~100MB and the filesystem expands to the full eMMC on first boot regardless, so the shipped size is pure transport cost: raw eMMC image drops 1.7G -> ~0.6G, sysupgrade tar to 470MB (halving its /tmp RAM footprint during upgrades). Ignore the release-staging directory so mono-update.sh's own output never trips its clean-tree guard. Co-Authored-By: Claude Fable 5 --- .gitignore | 1 + configs/mono_gateway-dk.seed | 2 +- target/linux/layerscape/base-files/lib/upgrade/platform.sh | 2 +- target/linux/layerscape/image/armv8_64b.mk | 2 +- target/linux/layerscape/image/gen_mono_emmc_img.sh | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index ad04755919..89fd0befd8 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,4 @@ git-src .cproject .ccache .vscode* +/releases diff --git a/configs/mono_gateway-dk.seed b/configs/mono_gateway-dk.seed index 5995bf150f..e30b76a5ec 100644 --- a/configs/mono_gateway-dk.seed +++ b/configs/mono_gateway-dk.seed @@ -48,4 +48,4 @@ CONFIG_PACKAGE_trusted-firmware-a-ls1046a-rdb-sdboot=y CONFIG_PACKAGE_u-boot-fsl_ls1046a-rdb-sdboot=y # CONFIG_PACKAGE_umdns is not set # CONFIG_TARGET_IMAGES_GZIP is not set -CONFIG_TARGET_ROOTFS_PARTSIZE=1024 +CONFIG_TARGET_ROOTFS_PARTSIZE=256 diff --git a/target/linux/layerscape/base-files/lib/upgrade/platform.sh b/target/linux/layerscape/base-files/lib/upgrade/platform.sh index 4a2b41ac25..991e973c06 100644 --- a/target/linux/layerscape/base-files/lib/upgrade/platform.sh +++ b/target/linux/layerscape/base-files/lib/upgrade/platform.sh @@ -80,7 +80,7 @@ platform_do_upgrade_mono() { tar xf $tar_file ${board_dir}/kernel -O | dd of=/dev/mmcblk0p1 bs=1M conv=fsync 2>/dev/null echo "Writing rootfs..." tar xf $tar_file ${board_dir}/root -O | dd of=/dev/mmcblk0p2 bs=1M conv=fsync 2>/dev/null - # rootfs ships at 1.5G; the uci-defaults script in it re-expands + # rootfs ships at 384M; the uci-defaults script in it re-expands # to the full partition on first boot } diff --git a/target/linux/layerscape/image/armv8_64b.mk b/target/linux/layerscape/image/armv8_64b.mk index 38e5727736..7998633562 100644 --- a/target/linux/layerscape/image/armv8_64b.mk +++ b/target/linux/layerscape/image/armv8_64b.mk @@ -431,7 +431,7 @@ endef define Build/mono-sysupgrade cp $(IMAGE_ROOTFS) $@.rootfs e2fsck -fy $@.rootfs || true - truncate -s 1536M $@.rootfs + truncate -s 384M $@.rootfs resize2fs $@.rootfs sh $(TOPDIR)/scripts/sysupgrade-tar.sh \ --board $(subst _,$(comma),$(DEVICE_NAME)) \ diff --git a/target/linux/layerscape/image/gen_mono_emmc_img.sh b/target/linux/layerscape/image/gen_mono_emmc_img.sh index f921cae2c0..215cba8230 100755 --- a/target/linux/layerscape/image/gen_mono_emmc_img.sh +++ b/target/linux/layerscape/image/gen_mono_emmc_img.sh @@ -32,7 +32,7 @@ ROOTFSPARTSIZE="$5" # after that the first-boot online resize works. Verified via loop mount. cp "$ROOTFS" "$OUTPUT.rootfs" e2fsck -fy "$OUTPUT.rootfs" || [ $? -le 2 ] -truncate -s 1536M "$OUTPUT.rootfs" +truncate -s 384M "$OUTPUT.rootfs" resize2fs "$OUTPUT.rootfs" ROOTFS="$OUTPUT.rootfs" -- 2.47.3