* [Buildroot] patch: target/cpio
@ 2006-11-20 15:44 Goetz Bock
2006-11-20 17:01 ` Philippe Ney
2006-11-22 19:16 ` Bernhard Fischer
0 siblings, 2 replies; 9+ messages in thread
From: Goetz Bock @ 2006-11-20 15:44 UTC (permalink / raw)
To: buildroot
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 ]
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] patch: target/cpio
2006-11-20 15:44 [Buildroot] patch: target/cpio Goetz Bock
@ 2006-11-20 17:01 ` Philippe Ney
2006-11-21 9:55 ` Goetz Bock
2006-11-22 19:16 ` Bernhard Fischer
1 sibling, 1 reply; 9+ messages in thread
From: Philippe Ney @ 2006-11-20 17:01 UTC (permalink / raw)
To: buildroot
> 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"
Hi,
In my application, as I also use cpio on the target, then I added a cpio
package that provide target and host cpio.
I use it to update the initramfs and have a simple dynamic RIM system w/o
use of cramfs/unionfs.
If this could be useful, I will make a patch.
Philippe
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] patch: target/cpio
2006-11-20 17:01 ` Philippe Ney
@ 2006-11-21 9:55 ` Goetz Bock
2006-11-22 7:53 ` Philippe Ney
2006-11-22 18:56 ` Philippe Ney
0 siblings, 2 replies; 9+ messages in thread
From: Goetz Bock @ 2006-11-21 9:55 UTC (permalink / raw)
To: buildroot
On Mon, Nov 20 '06 at 18:01, Philippe Ney wrote:
> > this patch adds a simple cpio target, to be used with an initramfs
> In my application, as I also use cpio on the target, then I added a cpio
> package that provide target and host cpio.
> I use it to update the initramfs and have a simple dynamic RIM system w/o
> use of cramfs/unionfs.
>
> If this could be useful, I will make a patch.
Shure, please provide a patch.
BTW: I wonder why there are hundrets^Wdozens of buildroot forkes, all
with more up to date/additional packages and noone ever seams to
provide patches on their own.
Do they think that buildroot is to unmodular that additional stuff
would make it to bloated for the rest? Or is the addition just a
hack, they always wanted to clean up, just never found the time to
do so? Or do they simply not care?
- Just wondering.
--
/"\ 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 ]
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] patch: target/cpio
2006-11-21 9:55 ` Goetz Bock
@ 2006-11-22 7:53 ` Philippe Ney
2006-11-22 18:56 ` Philippe Ney
1 sibling, 0 replies; 9+ messages in thread
From: Philippe Ney @ 2006-11-22 7:53 UTC (permalink / raw)
To: buildroot
> > > this patch adds a simple cpio target, to be used with an initramfs
>
> > In my application, as I also use cpio on the target, then I added a cpio
> > package that provide target and host cpio.
> > I use it to update the initramfs and have a simple dynamic RIM system w/o
> > use of cramfs/unionfs.
> >
> > If this could be useful, I will make a patch.
>
> Shure, please provide a patch.
>
> BTW: I wonder why there are hundrets^Wdozens of buildroot forkes, all
> with more up to date/additional packages and noone ever seams to
> provide patches on their own.
> Do they think that buildroot is to unmodular that additional stuff
> would make it to bloated for the rest? Or is the addition just a
> hack, they always wanted to clean up, just never found the time to
> do so? Or do they simply not care?
> - Just wondering.
I use a old version of buildroot that I modified/simplified for my own
needs. I don't know at this time if my additional stuff works with the
current one.
It's mainly hack that often don't build automatically but need manual
action. Which is sufficient for my own needs but I think it's not for
beeing added in the buildroot trunk. It is also only tested on an i386
target which seems not sufficient for me to be added in buildroot, isn't
it ?
For example I worked on porting perl but I didn't succeeded on having it
working with dynamic loading (for modules). I have a working static perl
(with static modules built-in) but it need to have a special config file
that contains the static built-in modules whereas this should be more
flexible. The Crypt:SSLay module need the path to OpenSSL and I give it
manually, et coetera.
Philippe
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] patch: target/cpio
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
1 sibling, 1 reply; 9+ messages in thread
From: Philippe Ney @ 2006-11-22 18:56 UTC (permalink / raw)
To: buildroot
> Shure, please provide a patch.
Et voil?.
Philippe
diff -Naur a/package/Config.in b/package/Config.in
--- a/package/Config.in 2006-11-22 08:55:57.000000000 +0100
+++ b/package/Config.in 2006-11-22 19:50:43.000000000 +0100
@@ -34,6 +34,7 @@
source "package/bison/Config.in"
source "package/boa/Config.in"
source "package/bridge/Config.in"
+source "package/cpio/Config.in"
source "package/customize/Config.in"
source "package/dhcp/Config.in"
source "package/dialog/Config.in"
diff -Naur a/package/cpio/Config.in b/package/cpio/Config.in
--- a/package/cpio/Config.in 1970-01-01 01:00:00.000000000 +0100
+++ b/package/cpio/Config.in 2006-11-22 19:49:40.000000000 +0100
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_CPIO
+ bool "cpio"
+ default n
+ help
+ Archiver that handles various types of cpio and tar archives
+ (Busybox cpio doesn't support archive generation)
+
+ http://www.gnu.org/software/cpio/
diff -Naur a/package/cpio/cpio.mk b/package/cpio/cpio.mk
--- a/package/cpio/cpio.mk 1970-01-01 01:00:00.000000000 +0100
+++ b/package/cpio/cpio.mk 2006-11-22 19:49:40.000000000 +0100
@@ -0,0 +1,101 @@
+#############################################################
+#
+# cpio
+#
+#############################################################
+
+CPIO_VER:=2.6
+CPIO_SOURCE:=cpio-$(CPIO_VER).tar.gz
+CPIO_SITE:=ftp://ftp.gnu.org/pub/gnu/cpio
+CPIO_DIR1:=$(TOOL_BUILD_DIR)/cpio-$(CPIO_VER)
+CPIO_DIR2:=$(BUILD_DIR)/cpio-$(CPIO_VER)
+CPIO_CAT:=zcat
+CPIO_BINARY:=src/cpio
+CPIO_TARGET_BINARY:=usr/bin/cpio
+
+CPIO:=$(STAGING_DIR)/$(CPIO_TARGET_BINARY)
+
+#------------------------------------------------------------
+$(DL_DIR)/$(CPIO_SOURCE):
+ $(WGET) -P $(DL_DIR) $(CPIO_SITE)/$(CPIO_SOURCE)
+
+#############################################################
+#
+# Build cpio for use on the host system
+#
+#############################################################
+$(CPIO_DIR1)/.unpacked: $(DL_DIR)/$(CPIO_SOURCE)
+ $(CPIO_CAT) $(DL_DIR)/$(CPIO_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
+ touch $(CPIO_DIR1)/.unpacked
+
+$(CPIO_DIR1)/.configured: $(CPIO_DIR1)/.unpacked
+ (cd $(CPIO_DIR1); rm -rf config.cache; \
+ CPPFLAGS=-DHAVE_LSTAT=1 \
+ ./configure \
+ --prefix=$(STAGING_DIR)/usr \
+ --exec-prefix=$(STAGING_DIR)/usr \
+ );
+ touch $(CPIO_DIR1)/.configured
+
+$(CPIO_DIR1)/$(CPIO_BINARY): $(CPIO_DIR1)/.configured
+ $(MAKE) -C $(CPIO_DIR1)
+
+$(STAGING_DIR)/$(CPIO_TARGET_BINARY): $(CPIO_DIR1)/$(CPIO_BINARY)
+ $(MAKE) -C $(CPIO_DIR1) install
+
+cpio-host: $(STAGING_DIR)/$(CPIO_TARGET_BINARY)
+
+cpio-host-clean:
+ $(MAKE) -C $(CPIO_DIR1) clean
+
+cpio-host-dirclean:
+ rm -rf $(CPIO_DIR1)
+
+#############################################################
+#
+# Build cpio for use on the target system
+#
+#############################################################
+$(CPIO_DIR2)/.unpacked: $(DL_DIR)/$(CPIO_SOURCE)
+ $(CPIO_CAT) $(DL_DIR)/$(CPIO_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
+ touch $(CPIO_DIR2)/.unpacked
+
+$(CPIO_DIR2)/.configured: $(CPIO_DIR2)/.unpacked
+ (cd $(CPIO_DIR2); rm -rf config.cache; \
+ $(TARGET_CONFIGURE_OPTS) CC_FOR_BUILD=$(HOSTCC) \
+ CFLAGS="$(TARGET_CFLAGS)" \
+ CPPFLAGS=-DHAVE_LSTAT=1 \
+ ./configure \
+ --target=$(GNU_TARGET_NAME) \
+ --host=$(GNU_TARGET_NAME) \
+ --build=$(GNU_HOST_NAME) \
+ --prefix=/usr \
+ --disable-rpath \
+ $(DISABLE_NLS) \
+ $(DISABLE_LARGEFILE) \
+ );
+ touch $(CPIO_DIR2)/.configured
+
+$(CPIO_DIR2)/$(CPIO_BINARY): $(CPIO_DIR2)/.configured
+ $(TARGET_CONFIGURE_OPTS) $(MAKE) CC=$(TARGET_CC) -C $(CPIO_DIR2)
+
+$(TARGET_DIR)/$(CPIO_TARGET_BINARY): $(CPIO_DIR2)/$(CPIO_BINARY)
+ install -D $(CPIO_DIR2)/$(CPIO_BINARY) $(TARGET_DIR)/$(CPIO_TARGET_BINARY)
+
+cpio: uclibc $(TARGET_DIR)/$(CPIO_TARGET_BINARY)
+
+cpio-clean:
+ rm -f $(TARGET_DIR)/$(CPIO_TARGET_BINARY)
+ -$(MAKE) -C $(CPIO_DIR2) clean
+
+cpio-dirclean:
+ rm -rf $(CPIO_DIR2)
+
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_CPIO)),y)
+TARGETS+=cpio
+endif
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] patch: target/cpio
2006-11-20 15:44 [Buildroot] patch: target/cpio Goetz Bock
2006-11-20 17:01 ` Philippe Ney
@ 2006-11-22 19:16 ` Bernhard Fischer
1 sibling, 0 replies; 9+ messages in thread
From: Bernhard Fischer @ 2006-11-22 19:16 UTC (permalink / raw)
To: buildroot
On Mon, Nov 20, 2006 at 04:44:23PM +0100, Goetz Bock wrote:
>Dear list,
>
>this patch adds a simple cpio target, to be used with an initramfs
Merged, thanks
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] patch: target/cpio
2006-11-22 18:56 ` Philippe Ney
@ 2006-11-22 19:17 ` Bernhard Fischer
2006-11-22 21:34 ` Philippe Ney
0 siblings, 1 reply; 9+ messages in thread
From: Bernhard Fischer @ 2006-11-22 19:17 UTC (permalink / raw)
To: buildroot
On Wed, Nov 22, 2006 at 07:56:46PM +0100, Philippe Ney wrote:
>+config BR2_PACKAGE_CPIO
>+ bool "cpio"
>+ default n
>+ help
>+ Archiver that handles various types of cpio and tar archives
>+ (Busybox cpio doesn't support archive generation)
We should rather add write support to busybox's ar/cpio et al, IMO.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] patch: target/cpio
2006-11-22 19:17 ` Bernhard Fischer
@ 2006-11-22 21:34 ` Philippe Ney
2006-11-23 8:19 ` Goetz Bock
0 siblings, 1 reply; 9+ messages in thread
From: Philippe Ney @ 2006-11-22 21:34 UTC (permalink / raw)
To: buildroot
> >+config BR2_PACKAGE_CPIO
> >+ bool "cpio"
> >+ default n
> >+ help
> >+ Archiver that handles various types of cpio and tar archives
> >+ (Busybox cpio doesn't support archive generation)
>
> We should rather add write support to busybox's ar/cpio et al, IMO.
>
Yes sure. It was just more simple for me to use the cpio sources rather
than working on Busybox ones.
As this seems to be of interests for Goetz Bock, I posted.
Philippe
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Buildroot] patch: target/cpio
2006-11-22 21:34 ` Philippe Ney
@ 2006-11-23 8:19 ` Goetz Bock
0 siblings, 0 replies; 9+ messages in thread
From: Goetz Bock @ 2006-11-23 8:19 UTC (permalink / raw)
To: buildroot
On Wed, Nov 22 '06 at 22:34, Philippe Ney wrote:
> > >+config BR2_PACKAGE_CPIO
> > >+ bool "cpio"
> > >+ default n
> > >+ help
> > >+ Archiver that handles various types of cpio and tar archives
> > >+ (Busybox cpio doesn't support archive generation)
> >
> > We should rather add write support to busybox's ar/cpio et al, IMO.
> >
>
> Yes sure. It was just more simple for me to use the cpio sources rather
> than working on Busybox ones.
>
> As this seems to be of interests for Goetz Bock, I posted.
And I appreciated it, thanks.
--
/"\ 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 ]
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2006-11-23 8:19 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-20 15:44 [Buildroot] patch: target/cpio Goetz Bock
2006-11-20 17:01 ` 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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox