allow users to generate tarballs of the target filesystem
authorMike Frysinger <vapier@gentoo.org>
Wed, 9 Feb 2005 16:06:06 +0000 (16:06 -0000)
committerMike Frysinger <vapier@gentoo.org>
Wed, 9 Feb 2005 16:06:06 +0000 (16:06 -0000)
target/Config.in
target/tar/Config.in [new file with mode: 0644]
target/tar/Makefile.in [new file with mode: 0644]
target/tar/tarroot.mk [new file with mode: 0644]

index cd67a718f5a8408505844528ab7112ced5321b1b..6ba3e43df6bf8d251de3659b588f3227676a49f4 100644 (file)
@@ -1,11 +1,9 @@
-#
-
 menu "Target Options"
 
 source "target/cramfs/Config.in"
 source "target/ext2/Config.in"
 source "target/jffs2/Config.in"
 source "target/squashfs/Config.in"
+source "target/tar/Config.in"
 
 endmenu
-
diff --git a/target/tar/Config.in b/target/tar/Config.in
new file mode 100644 (file)
index 0000000..8cce507
--- /dev/null
@@ -0,0 +1,14 @@
+menuconfig BR2_TARGET_ROOTFS_TAR
+       bool "tar the root filesystem for the target device"
+       default n
+       help
+         Build a tar archive of the root filesystem
+
+config BR2_TARGET_ROOTFS_TAR_OPTIONS
+       string "random options to pass to tar"
+       depends on BR2_TARGET_ROOTFS_TAR
+       default ""
+       help
+         Common options:
+          j - compress with bzip2
+          z - compress with gzip
diff --git a/target/tar/Makefile.in b/target/tar/Makefile.in
new file mode 100644 (file)
index 0000000..d5f1308
--- /dev/null
@@ -0,0 +1,3 @@
+ifeq ($(strip $(BR2_TARGET_ROOTFS_TAR)),y)
+TARGETS+=tarroot
+endif
diff --git a/target/tar/tarroot.mk b/target/tar/tarroot.mk
new file mode 100644 (file)
index 0000000..a7627bf
--- /dev/null
@@ -0,0 +1,25 @@
+#############################################################
+#
+# tar to archive target filesystem
+#
+#############################################################
+
+TAR_OPTS := $(strip $(BR2_TARGET_ROOTFS_TAR_OPTIONS))
+
+TAR_TARGET := $(IMAGE).tar
+
+$(TAR_TARGET):
+       -@find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIP) 2>/dev/null || true;
+       @rm -rf $(TARGET_DIR)/usr/man
+       @rm -rf $(TARGET_DIR)/usr/share/man
+       @rm -rf $(TARGET_DIR)/usr/info
+       tar -c$(TAR_OPTS)f $(TAR_TARGET) -C $(TARGET_DIR) .
+               
+tarroot: $(TAR_TARGET)
+       @ls -l $(TAR_TARGET)
+
+tarroot-source:
+
+tarroot-clean:
+
+tarroot-dirclean: