2006-11-22 20:10:59 +01:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# cpio to archive target filesystem
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
|
|
|
|
CPIO_TARGET:=$(IMAGE).cpio
|
|
|
|
|
|
|
|
cpioroot-init:
|
2006-11-22 22:24:58 +01:00
|
|
|
rm -f $(TARGET_DIR)/init
|
2006-11-22 20:58:35 +01:00
|
|
|
ln -s sbin/init $(TARGET_DIR)/init
|
2006-11-22 20:10:59 +01:00
|
|
|
|
|
|
|
cpioroot: host-fakeroot makedevs cpioroot-init
|
2006-11-22 21:21:24 +01:00
|
|
|
-@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))
|
2007-03-20 17:52:44 +01:00
|
|
|
echo "chown -R 0:0 $(TARGET_DIR)" >> $(STAGING_DIR)/_fakeroot.$(notdir $(CPIO_TARGET))
|
2007-02-15 17:49:39 +01:00
|
|
|
ifneq ($(TARGET_DEVICE_TABLE),)
|
2006-11-22 21:21:24 +01:00
|
|
|
# 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))
|
2007-02-15 17:49:39 +01:00
|
|
|
endif
|
2006-11-22 21:21:24 +01:00
|
|
|
# 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))
|
|
|
|
#-@rm -f $(STAGING_DIR)/_fakeroot.$(notdir $(CPIO_TARGET))
|
2006-11-22 20:10:59 +01:00
|
|
|
|
|
|
|
cpioroot-source:
|
|
|
|
|
|
|
|
cpioroot-clean:
|
|
|
|
|
|
|
|
cpioroot-dirclean:
|
|
|
|
|
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# Toplevel Makefile options
|
|
|
|
#
|
|
|
|
#############################################################
|
|
|
|
ifeq ($(strip $(BR2_TARGET_ROOTFS_CPIO)),y)
|
|
|
|
TARGETS+=cpioroot
|
|
|
|
endif
|