Skip to content
Snippets Groups Projects
Commit d90e805f authored by Gabor Juhos's avatar Gabor Juhos
Browse files

build: Add TARGET_ROOTFS_RESERVED_PCT option to reduce wasted space


The genext2fs tool will 'reserve' 5% of the image size by default,
apparently by creating a huge lost+found directory. In fact it seemed to
be much more than 5% in practice — I saw an image with 8MiB used, and
recovered about 2MiB of it by deleting the 'empty' lost+found directory:

/dev/loop0         48377  8482     37438  19% /mnt/spare
 # rmdir lost+found/
/dev/loop0         48377  6014     39906  14% /mnt/spare

This makes it configurable, but leaves it at the genext2fs default
of 5% for now. It should probably be changed to default to zero, but
that can be a separate patch.

Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: default avatarGabor Juhos <juhosg@openwrt.org>

SVN-Revision: 34408
parent 44131bd7
No related branches found
No related tags found
No related merge requests found
...@@ -125,6 +125,13 @@ menu "Target Images" ...@@ -125,6 +125,13 @@ menu "Target Images"
help help
Allows you to change the maximum number of inodes in the root filesystem Allows you to change the maximum number of inodes in the root filesystem
config TARGET_ROOTFS_RESERVED_PCT
int "Percentage of reserved blocks in root filesystem"
depends TARGET_ROOTFS_EXT4FS
default 5
help
Allows you to change the percentage of reserved blocks in the root filesystem
endmenu endmenu
menu "Global build settings" menu "Global build settings"
......
...@@ -124,7 +124,7 @@ ifneq ($(CONFIG_TARGET_ROOTFS_EXT4FS),) ...@@ -124,7 +124,7 @@ ifneq ($(CONFIG_TARGET_ROOTFS_EXT4FS),)
define Image/mkfs/ext4 define Image/mkfs/ext4
# generate an ext2 fs # generate an ext2 fs
$(STAGING_DIR_HOST)/bin/genext2fs -U -b $(E2SIZE) -N $(CONFIG_TARGET_ROOTFS_MAXINODE) -d $(TARGET_DIR)/ $(KDIR)/root.ext4 $(STAGING_DIR_HOST)/bin/genext2fs -U -b $(E2SIZE) -N $(CONFIG_TARGET_ROOTFS_MAXINODE) -d $(TARGET_DIR)/ $(KDIR)/root.ext4 -m $(CONFIG_TARGET_ROOTFS_RESERVED_PCT)
# convert it to ext4 # convert it to ext4
$(STAGING_DIR_HOST)/bin/tune2fs -O extents,uninit_bg,dir_index $(KDIR)/root.ext4 $(STAGING_DIR_HOST)/bin/tune2fs -O extents,uninit_bg,dir_index $(KDIR)/root.ext4
# fix it up # fix it up
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment