mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-30 06:36:34 +00:00
Allow compression of cpio targets
This commit is contained in:
parent
7d8c2838ef
commit
90b4498219
@ -5,3 +5,38 @@ config BR2_TARGET_ROOTFS_CPIO
|
|||||||
help
|
help
|
||||||
Build a cpio archive of the root filesystem
|
Build a cpio archive of the root filesystem
|
||||||
|
|
||||||
|
choice
|
||||||
|
prompt "Compression method"
|
||||||
|
default BR2_TARGET_ROOTFS_CPIO_NONE
|
||||||
|
depends on BR2_TARGET_ROOTFS_CPIO
|
||||||
|
help
|
||||||
|
Select compressor for cpio filesystem of the root filesystem
|
||||||
|
|
||||||
|
config BR2_TARGET_ROOTFS_CPIO_NONE
|
||||||
|
bool "no compression"
|
||||||
|
help
|
||||||
|
Do not compress the cpio filesystem.
|
||||||
|
|
||||||
|
config BR2_TARGET_ROOTFS_CPIO_GZIP
|
||||||
|
bool "gzip"
|
||||||
|
help
|
||||||
|
Do compress the cpio filesystem with gzip.
|
||||||
|
Note that you either have to have gzip installed on your host
|
||||||
|
or select to build a gzip for your host. See the packages submenu.
|
||||||
|
|
||||||
|
config BR2_TARGET_ROOTFS_CPIO_BZIP2
|
||||||
|
bool "bzip2"
|
||||||
|
help
|
||||||
|
Do compress the cpio filesystem with bzip2.
|
||||||
|
Note that you either have to have bzip2 installed on your host
|
||||||
|
or select to build a bzip2 for your host. See the packages submenu.
|
||||||
|
|
||||||
|
config BR2_TARGET_ROOTFS_CPIO_LZMA
|
||||||
|
bool "lzma"
|
||||||
|
help
|
||||||
|
Do compress the cpio filesystem with lzma.
|
||||||
|
Note that you either have to have lzma installed on your host
|
||||||
|
or select to build a lzma for your host. See the packages submenu.
|
||||||
|
|
||||||
|
endchoice
|
||||||
|
|
||||||
|
@ -4,13 +4,39 @@
|
|||||||
#
|
#
|
||||||
#############################################################
|
#############################################################
|
||||||
|
|
||||||
CPIO_TARGET:=$(IMAGE).cpio
|
CPIO_BASE:=$(IMAGE).cpio
|
||||||
|
|
||||||
|
CPIO_ROOTFS_COMPRESSOR:=
|
||||||
|
CPIO_ROOTFS_COMPRESSOR_EXT:=
|
||||||
|
CPIO_ROOTFS_COMPRESSOR_PREREQ:=
|
||||||
|
ifeq ($(BR2_TARGET_ROOTFS_CPIO_GZIP),y)
|
||||||
|
CPIO_ROOTFS_COMPRESSOR:=gzip -9 -c
|
||||||
|
CPIO_ROOTFS_COMPRESSOR_EXT:=gz
|
||||||
|
#CPIO_ROOTFS_COMPRESSOR_PREREQ:= gzip-host
|
||||||
|
endif
|
||||||
|
ifeq ($(BR2_TARGET_ROOTFS_CPIO_BZIP2),y)
|
||||||
|
CPIO_ROOTFS_COMPRESSOR:=bzip2 -9 -c
|
||||||
|
CPIO_ROOTFS_COMPRESSOR_EXT:=bz2
|
||||||
|
#CPIO_ROOTFS_COMPRESSOR_PREREQ:= bzip2-host
|
||||||
|
endif
|
||||||
|
ifeq ($(BR2_TARGET_ROOTFS_CPIO_LZMA),y)
|
||||||
|
CPIO_ROOTFS_COMPRESSOR:=lzma -9 -c
|
||||||
|
CPIO_ROOTFS_COMPRESSOR_EXT:=lzma
|
||||||
|
CPIO_ROOTFS_COMPRESSOR_PREREQ:= lzma-host
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(CPIO_ROOTFS_COMPRESSOR),)
|
||||||
|
CPIO_TARGET := $(CPIO_BASE).$(CPIO_ROOTFS_COMPRESSOR_EXT)
|
||||||
|
else
|
||||||
|
CPIO_TARGET := $(CPIO_BASE)
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
cpioroot-init:
|
cpioroot-init:
|
||||||
rm -f $(TARGET_DIR)/init
|
rm -f $(TARGET_DIR)/init
|
||||||
ln -s sbin/init $(TARGET_DIR)/init
|
ln -s sbin/init $(TARGET_DIR)/init
|
||||||
|
|
||||||
cpioroot: host-fakeroot makedevs cpioroot-init
|
$(CPIO_BASE): host-fakeroot makedevs cpioroot-init
|
||||||
-@find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIP) 2>/dev/null || true;
|
-@find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIP) 2>/dev/null || true;
|
||||||
@rm -rf $(TARGET_DIR)/usr/man
|
@rm -rf $(TARGET_DIR)/usr/man
|
||||||
@rm -rf $(TARGET_DIR)/usr/info
|
@rm -rf $(TARGET_DIR)/usr/info
|
||||||
@ -18,19 +44,26 @@ cpioroot: host-fakeroot makedevs cpioroot-init
|
|||||||
# Use fakeroot to pretend all target binaries are owned by root
|
# Use fakeroot to pretend all target binaries are owned by root
|
||||||
rm -f $(STAGING_DIR)/_fakeroot.$(notdir $(TAR_TARGET))
|
rm -f $(STAGING_DIR)/_fakeroot.$(notdir $(TAR_TARGET))
|
||||||
touch $(STAGING_DIR)/.fakeroot.00000
|
touch $(STAGING_DIR)/.fakeroot.00000
|
||||||
cat $(STAGING_DIR)/.fakeroot* > $(STAGING_DIR)/_fakeroot.$(notdir $(CPIO_TARGET))
|
cat $(STAGING_DIR)/.fakeroot* > $(STAGING_DIR)/_fakeroot.$(notdir $(CPIO_BASE))
|
||||||
echo "chown -R 0:0 $(TARGET_DIR)" >> $(STAGING_DIR)/_fakeroot.$(notdir $(CPIO_TARGET))
|
echo "chown -R 0:0 $(TARGET_DIR)" >> $(STAGING_DIR)/_fakeroot.$(notdir $(CPIO_BASE))
|
||||||
ifneq ($(TARGET_DEVICE_TABLE),)
|
ifneq ($(TARGET_DEVICE_TABLE),)
|
||||||
# Use fakeroot to pretend to create all needed device nodes
|
# Use fakeroot to pretend to create all needed device nodes
|
||||||
echo "$(STAGING_DIR)/bin/makedevs -d $(TARGET_DEVICE_TABLE) $(TARGET_DIR)" \
|
echo "$(STAGING_DIR)/bin/makedevs -d $(TARGET_DEVICE_TABLE) $(TARGET_DIR)" \
|
||||||
>> $(STAGING_DIR)/_fakeroot.$(notdir $(CPIO_TARGET))
|
>> $(STAGING_DIR)/_fakeroot.$(notdir $(CPIO_BASE))
|
||||||
endif
|
endif
|
||||||
# Use fakeroot so tar believes the previous fakery
|
# Use fakeroot so tar believes the previous fakery
|
||||||
echo "cd $(TARGET_DIR) && find . | cpio --quiet -o -H newc > $(CPIO_TARGET)" \
|
echo "cd $(TARGET_DIR) && find . | cpio --quiet -o -H newc > $(CPIO_BASE)" \
|
||||||
>> $(STAGING_DIR)/_fakeroot.$(notdir $(CPIO_TARGET))
|
>> $(STAGING_DIR)/_fakeroot.$(notdir $(CPIO_BASE))
|
||||||
chmod a+x $(STAGING_DIR)/_fakeroot.$(notdir $(CPIO_TARGET))
|
chmod a+x $(STAGING_DIR)/_fakeroot.$(notdir $(CPIO_BASE))
|
||||||
$(STAGING_DIR)/usr/bin/fakeroot -- $(STAGING_DIR)/_fakeroot.$(notdir $(CPIO_TARGET))
|
$(STAGING_DIR)/usr/bin/fakeroot -- $(STAGING_DIR)/_fakeroot.$(notdir $(CPIO_BASE))
|
||||||
#-@rm -f $(STAGING_DIR)/_fakeroot.$(notdir $(CPIO_TARGET))
|
#-@rm -f $(STAGING_DIR)/_fakeroot.$(notdir $(CPIO_BASE))
|
||||||
|
|
||||||
|
ifneq ($(CPIO_ROOTFS_COMPRESSOR),)
|
||||||
|
$(CPIO_BASE).$(CPIO_ROOTFS_COMPRESSOR_EXT): $(CPIO_ROOTFS_COMPRESSOR_PREREQ) $(CPIO_BASE)
|
||||||
|
$(CPIO_ROOTFS_COMPRESSOR) $(CPIO_BASE) > $(CPIO_TARGET)
|
||||||
|
endif
|
||||||
|
|
||||||
|
cpioroot: $(CPIO_TARGET)
|
||||||
|
|
||||||
cpioroot-source:
|
cpioroot-source:
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user