Skip to content
Snippets Groups Projects
Commit 2de9fc9c authored by Christopher Spinrath's avatar Christopher Spinrath
Browse files

initrd_pack: use xz instead of lzma compression

xz is faster (in particular because it uses multiple cpu cores)
and the resulting initrd has the same size (up to 0.5MB)
parent 9907fc4f
No related branches found
No related tags found
No related merge requests found
...@@ -91,7 +91,7 @@ $(strip $1): image_umount_if ...@@ -91,7 +91,7 @@ $(strip $1): image_umount_if
endef endef
RSYNC=rsync -a --inplace --no-whole-file RSYNC=rsync -a --inplace --no-whole-file
LZMA_FLAGS=-T 0 XZ_LZMA_FLAGS=-T 0
define archdir = define archdir =
$(WORKSPACE)/$(call to_arch,$1) $(WORKSPACE)/$(call to_arch,$1)
...@@ -146,7 +146,7 @@ APT_CACHE_DIR=$(WORKSPACE)/apt_cache ...@@ -146,7 +146,7 @@ APT_CACHE_DIR=$(WORKSPACE)/apt_cache
ROOTFS=/rootfs ROOTFS=/rootfs
INITRD=/initrd INITRD=/initrd
INITRD_TARGET=/initrd.lz INITRD_TARGET=/initrd.xz
STATE_DIR=/state STATE_DIR=/state
LXC_DIR=/lxc_container LXC_DIR=/lxc_container
CHECKSUMS=/rootfs.md5sums CHECKSUMS=/rootfs.md5sums
...@@ -328,7 +328,7 @@ rootfs_common_clean: ...@@ -328,7 +328,7 @@ rootfs_common_clean:
initrd_unpack : $(ARCH_DIR)$(STATE_DIR)/initrd_extracted initrd_unpack : $(ARCH_DIR)$(STATE_DIR)/initrd_extracted
$(call gentargets,$(STATE_DIR)/initrd_extracted) : $(call archdir,%)$(STATE_DIR)/iso_extracted $(call gentargets,$(STATE_DIR)/initrd_extracted) : $(call archdir,%)$(STATE_DIR)/iso_extracted
mkdir -p "$(call archdir,$*)$(INITRD)" mkdir -p "$(call archdir,$*)$(INITRD)"
cd "$(call archdir,$*)$(INITRD)" && lzma $(LZMA_FLAGS) -d < "$(call archdir,$*)$(INITRD_SOURCE)" | cpio -i cd "$(call archdir,$*)$(INITRD)" && lzma $(XZ_LZMA_FLAGS) -d < "$(call archdir,$*)$(INITRD_SOURCE)" | cpio -i
touch "$(call archdir,$*)$(STATE_DIR)/initrd_extracted" touch "$(call archdir,$*)$(STATE_DIR)/initrd_extracted"
initrd_clean: initrd_clean:
...@@ -372,7 +372,7 @@ $(call gentargets,$(STATE_DIR)/initrd_remastered) : $(call archdir,%)$(STATE_DIR ...@@ -372,7 +372,7 @@ $(call gentargets,$(STATE_DIR)/initrd_remastered) : $(call archdir,%)$(STATE_DIR
initrd_pack : $(ARCH_DIR)$(INITRD_TARGET) initrd_pack : $(ARCH_DIR)$(INITRD_TARGET)
$(call gentargets,$(INITRD_TARGET)) : $(call archdir,%)$(STATE_DIR)/initrd_remastered $(call gentargets,$(INITRD_TARGET)) : $(call archdir,%)$(STATE_DIR)/initrd_remastered
cd "$(call archdir,$*)$(INITRD)" && find | cpio -H newc -o | lzma $(LZMA_FLAGS) -z > "$(call archdir,$*)$(INITRD_TARGET)" cd "$(call archdir,$*)$(INITRD)" && find | cpio -H newc -o | xz $(XZ_LZMA_FLAGS) -z > "$(call archdir,$*)$(INITRD_TARGET)"
$(call ensure_unmount,clean_really_all): iso_clean_both rootfs_clean_both rootfs_common_clean initrd_clean_both image_clean $(call ensure_unmount,clean_really_all): iso_clean_both rootfs_clean_both rootfs_common_clean initrd_clean_both image_clean
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment