summaryrefslogtreecommitdiffstats
path: root/target/ext2/ext2root.mk
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2005-01-23 10:53:06 +0000
committerEric Andersen <andersen@codepoet.org>2005-01-23 10:53:06 +0000
commit0a87bc7b58258026c51aa479774b33828dccf236 (patch)
treed3c680950932ff9fe962665b7dd8acc1babb1f04 /target/ext2/ext2root.mk
parentceb4d070f9372e1b13273bb9a32c41c61f008a72 (diff)
downloadbuildroot-novena-0a87bc7b58258026c51aa479774b33828dccf236.tar.gz
buildroot-novena-0a87bc7b58258026c51aa479774b33828dccf236.zip
Patch from gtj -- http://bugs.uclibc.org/view.php?id=39
0000039: Adds options to ext2 filesystem creation Adds ability to specify block and inode counts, reserved blocks, permissions squash and device table in the configuration. Also adds capability to gzip output and to copy the resulting image to a secondary location like a tftp server's root directory.
Diffstat (limited to 'target/ext2/ext2root.mk')
-rw-r--r--target/ext2/ext2root.mk58
1 files changed, 54 insertions, 4 deletions
diff --git a/target/ext2/ext2root.mk b/target/ext2/ext2root.mk
index e4e77ca0a..8dfa513e1 100644
--- a/target/ext2/ext2root.mk
+++ b/target/ext2/ext2root.mk
@@ -47,11 +47,61 @@ GENEXT2_SIZE=$(shell expr $(GENEXT2_REALSIZE) + $(GENEXT2_ADDTOROOTSIZE) + 200)
GENEXT2_INODES=$(shell expr $(shell find $(TARGET_DIR) | wc -l) + 400)
#GENEXT2_SIZE=100000
-ext2root: genext2fs
- #-@find $(TARGET_DIR)/lib -type f -name \*.so\* | xargs $(STRIP) --strip-unneeded 2>/dev/null || true;
+EXT2_OPTS :=
+
+ifeq ($(strip $(BR2_TARGET_ROOTFS_EXT2_BLOCKS)),0)
+EXT2_OPTS += -b $(GENEXT2_SIZE)
+else
+EXT2_OPTS += -b $(strip $(BR2_TARGET_ROOTFS_EXT2_BLOCKS))
+endif
+
+ifeq ($(strip $(BR2_TARGET_ROOTFS_EXT2_INODES)),0)
+EXT2_OPTS += -i $(GENEXT2_INODES)
+else
+EXT2_OPTS += -i $(strip $(BR2_TARGET_ROOTFS_EXT2_INODES))
+endif
+
+ifeq ($(strip $(BR2_TARGET_ROOTFS_EXT2_SQUASH)),y)
+EXT2_OPTS += -q
+endif
+
+ifneq ($(strip $(BR2_TARGET_ROOTFS_EXT2_RESBLKS)),0)
+EXT2_OPTS += -r $(strip $(BR2_TARGET_ROOTFS_EXT2_RESBLKS))
+endif
+
+EXT2_DEVFILE := $(strip $(subst ",,$(BR2_TARGET_ROOTFS_EXT2_DEVFILE)))
+ifneq ($(EXT2_DEVFILE),)
+EXT2_OPTS += -D $(EXT2_DEVFILE)
+endif
+
+EXT2_BASE := $(subst ",,$(BR2_TARGET_ROOTFS_EXT2_OUTPUT))
+
+ifeq ($(strip $(BR2_TARGET_ROOTFS_EXT2_GZ)),y)
+EXT2_TARGET := $(EXT2_BASE).gz
+else
+EXT2_TARGET := $(EXT2_BASE)
+endif
+
+$(EXT2_BASE): genext2fs
-@find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIP) 2>/dev/null || true;
- $(GENEXT2_DIR)/genext2fs -i $(GENEXT2_INODES) -b $(GENEXT2_SIZE) \
- -d $(TARGET_DIR) -q -D target/default/device_table.txt $(IMAGE).ext2
+ @rm -rf $(TARGET_DIR)/usr/man
+ @rm -rf $(TARGET_DIR)/usr/share/man
+ @rm -rf $(TARGET_DIR)/usr/info
+ $(GENEXT2_DIR)/genext2fs \
+ -d $(TARGET_DIR) \
+ $(EXT2_OPTS) \
+ $(EXT2_BASE)
+
+$(EXT2_BASE).gz: $(EXT2_BASE)
+ @gzip --best -fv $(EXT2_BASE)
+
+EXT2_COPYTO := $(strip $(subst ",,$(BR2_TARGET_ROOTFS_EXT2_COPYTO)))
+
+ext2root: $(EXT2_TARGET)
+ @ls -l $(EXT2_TARGET)
+ifneq ($(EXT2_COPYTO),)
+ @cp -f $(EXT2_TARGET) $(EXT2_COPYTO)
+endif
ext2root-source: $(DL_DIR)/$(GENEXT2_SOURCE)