Signed-off-by: Wolfram Sang <[email protected]>
---
 platforms/image_cpio.in    | 10 +++++++++-
 rules/post/image_cpio.make | 10 ++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/platforms/image_cpio.in b/platforms/image_cpio.in
index afe8a43..b654bba 100644
--- a/platforms/image_cpio.in
+++ b/platforms/image_cpio.in
@@ -13,4 +13,12 @@ config IMAGE_CPIO_GZ
        select IMAGE_CPIO
        help
          Build the traditionally initrd RAM disk to be used
-         as initramfs by the kernel.
+         as initramfs by the kernel, packed with gzip.
+
+config IMAGE_CPIO_XZ
+       bool
+       prompt "Generate images/root.cpio.xz"
+       select IMAGE_CPIO
+       help
+         Build the traditionally initrd RAM disk to be used
+         as initramfs by the kernel, packed with xz.
diff --git a/rules/post/image_cpio.make b/rules/post/image_cpio.make
index 573faee..3f20c4e 100644
--- a/rules/post/image_cpio.make
+++ b/rules/post/image_cpio.make
@@ -31,4 +31,14 @@ $(IMAGEDIR)/root.cpio.gz: $(IMAGEDIR)/root.cpio
        @echo "done."
 endif
 
+SEL_ROOTFS-$(PTXCONF_IMAGE_CPIO_XZ) += $(IMAGEDIR)/root.cpio.xz
+
+# '--best' is not suitable here. Check xz manpage for details.
+ifdef PTXCONF_IMAGE_CPIO_XZ
+$(IMAGEDIR)/root.cpio.xz: $(IMAGEDIR)/root.cpio
+       @echo -n "Creating '$(notdir $(@))' from '$(notdir $(^))'..."
+       @cat "$(^)" | xz > "$(@)"
+       @echo "done."
+endif
+
 # vim: syntax=make
-- 
2.1.4


_______________________________________________
ptxdist mailing list
[email protected]

Reply via email to