From 920aa1a21d27c4fd808035136c391b42c813f80e Mon Sep 17 00:00:00 2001
From: nrbffs <38812627+nrbffs@users.noreply.github.com>
Date: Fri, 27 Dec 2019 15:09:26 +0100
Subject: [PATCH] patches/openwrt: add set TARGET_ROOTFS_PARTSIZE to make
 combined image fit in 128MB

---
 ...-to-make-combined-image-fit-in-128MB.patch | 27 +++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 patches/openwrt/0006-build-set-TARGET_ROOTFS_PARTSIZE-to-make-combined-image-fit-in-128MB.patch

diff --git a/patches/openwrt/0006-build-set-TARGET_ROOTFS_PARTSIZE-to-make-combined-image-fit-in-128MB.patch b/patches/openwrt/0006-build-set-TARGET_ROOTFS_PARTSIZE-to-make-combined-image-fit-in-128MB.patch
new file mode 100644
index 000000000..773b28008
--- /dev/null
+++ b/patches/openwrt/0006-build-set-TARGET_ROOTFS_PARTSIZE-to-make-combined-image-fit-in-128MB.patch
@@ -0,0 +1,27 @@
+From: Matthias Schiffer <mschiffer@universe-factory.net>
+Date: Sat, 21 Sep 2019 13:21:36 +0200
+Subject: build: set TARGET_ROOTFS_PARTSIZE to make combined image fit in 128MB
+
+Change TARGET_ROOTFS_PARTSIZE from 128 to 104 MiB, so the whole image
+(bootloader + boot + root) will fit on a 128MB CF card by default.
+
+With these settings, the generated images (tested on x86-generic and
+x86-64) have 126,353,408 bytes; the smallest CF card marketed as "128MB"
+that I found a datasheet for (a Transcend TS128MCF80) has 126,959,616
+bytes.
+
+Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
+
+diff --git a/config/Config-images.in b/config/Config-images.in
+index 8548c7cd24742daad4fb1c64e58bad82590795c2..dc7a9cbd54ffbe3c78a7fdbd124f389c102ef6c1 100644
+--- a/config/Config-images.in
++++ b/config/Config-images.in
+@@ -274,7 +274,7 @@ menu "Target Images"
+ 	config TARGET_ROOTFS_PARTSIZE
+ 		int "Root filesystem partition size (in MB)"
+ 		depends on GRUB_IMAGES || USES_ROOTFS_PART || TARGET_ROOTFS_EXT4FS || TARGET_omap || TARGET_rb532 || TARGET_sunxi || TARGET_uml
+-		default 256
++		default 104
+ 		help
+ 		  Select the root filesystem partition size.
+ 
-- 
GitLab