From: Goetz Bock <bock@blacknet.de>
To: buildroot@busybox.net
Subject: [Buildroot] patch: target/cpio
Date: Mon, 20 Nov 2006 16:44:23 +0100 [thread overview]
Message-ID: <20061120154423.GG3065@priv.blacknet.de> (raw)
Dear list,
this patch adds a simple cpio target, to be used with an initramfs
Index: target/Config.in
===================================================================
--- target/Config.in (revision 16570)
+++ target/Config.in (working copy)
@@ -8,6 +8,7 @@
source "target/jffs2/Config.in"
source "target/squashfs/Config.in"
source "target/tar/Config.in"
+source "target/cpio/Config.in"
source "target/iso9660/Config.in"
comment "bootloader for target device"
diff -urN target/cpio/Config.in target/cpio/Config.in
--- target/cpio/Config.in 1970-01-01 00:00:00.000000000 +0000
+++ target/cpio/Config.in 2006-11-20 11:16:13.000000000 +0000
@@ -0,0 +1,6 @@
+config BR2_TARGET_ROOTFS_CPIO
+ bool "cpio the root filesystem"
+ default n
+ help
+ Build a cpio archive of the root filesystem
+
diff -urN target/cpio/cpioroot.mk target/cpio/cpioroot.mk
--- target/cpio/cpioroot.mk 1970-01-01 00:00:00.000000000 +0000
+++ target/cpio/cpioroot.mk 2006-11-20 12:42:00.000000000 +0000
@@ -0,0 +1,45 @@
+#############################################################
+#
+# cpio to archive target filesystem
+#
+#############################################################
+
+CPIO_TARGET:=$(IMAGE).cpio
+
+cpioroot-init:
+ ln -s sbin/init $(TARGET_DIR)/init
+
+cpioroot: host-fakeroot makedevs cpioroot-init
+ - at find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIP) 2>/dev/null || true;
+ @rm -rf $(TARGET_DIR)/usr/man
+ @rm -rf $(TARGET_DIR)/usr/info
+ -/sbin/ldconfig -r $(TARGET_DIR) 2>/dev/null
+ # Use fakeroot to pretend all target binaries are owned by root
+ rm -f $(STAGING_DIR)/_fakeroot.$(notdir $(TAR_TARGET))
+ touch $(STAGING_DIR)/.fakeroot.00000
+ cat $(STAGING_DIR)/.fakeroot* > $(STAGING_DIR)/_fakeroot.$(notdir $(CPIO_TARGET))
+ echo "chown -R root:root $(TARGET_DIR)" >> $(STAGING_DIR)/_fakeroot.$(notdir $(CPIO_TARGET))
+ # Use fakeroot to pretend to create all needed device nodes
+ echo "$(STAGING_DIR)/bin/makedevs -d $(TARGET_DEVICE_TABLE) $(TARGET_DIR)" \
+ >> $(STAGING_DIR)/_fakeroot.$(notdir $(CPIO_TARGET))
+ # Use fakeroot so tar believes the previous fakery
+ echo "cd $(TARGET_DIR) && find . | cpio --quiet -o -H newc > $(CPIO_TARGET)" \
+ >> $(STAGING_DIR)/_fakeroot.$(notdir $(CPIO_TARGET))
+ chmod a+x $(STAGING_DIR)/_fakeroot.$(notdir $(CPIO_TARGET))
+ $(STAGING_DIR)/usr/bin/fakeroot -- $(STAGING_DIR)/_fakeroot.$(notdir $(CPIO_TARGET))
+ #- at rm -f $(STAGING_DIR)/_fakeroot.$(notdir $(CPIO_TARGET))
+
+cpioroot-source:
+
+cpioroot-clean:
+
+cpioroot-dirclean:
+
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_TARGET_ROOTFS_CPIO)),y)
+TARGETS+=cpioroot
+endif
--
/"\ Goetz Bock at blacknet dot de -- secure mobile Linux everNETting
\ / (c) 2006 Creative Commons, Attribution-ShareAlike 2.0 de
X [ 1. Use descriptive subjects - 2. Edit a reply for brevity - ]
/ \ [ 3. Reply to the list - 4. Read the archive *before* you post ]
next reply other threads:[~2006-11-20 15:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-20 15:44 Goetz Bock [this message]
2006-11-20 17:01 ` [Buildroot] patch: target/cpio Philippe Ney
2006-11-21 9:55 ` Goetz Bock
2006-11-22 7:53 ` Philippe Ney
2006-11-22 18:56 ` Philippe Ney
2006-11-22 19:17 ` Bernhard Fischer
2006-11-22 21:34 ` Philippe Ney
2006-11-23 8:19 ` Goetz Bock
2006-11-22 19:16 ` Bernhard Fischer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061120154423.GG3065@priv.blacknet.de \
--to=bock@blacknet.de \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox