mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] images: cpio: add xz packing
@ 2015-11-07 14:34 Wolfram Sang
  2015-12-18 11:45 ` Michael Olbrich
  0 siblings, 1 reply; 2+ messages in thread
From: Wolfram Sang @ 2015-11-07 14:34 UTC (permalink / raw)
  To: ptxdist; +Cc: Wolfram Sang

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---
 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
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ptxdist] [PATCH] images: cpio: add xz packing
  2015-11-07 14:34 [ptxdist] [PATCH] images: cpio: add xz packing Wolfram Sang
@ 2015-12-18 11:45 ` Michael Olbrich
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Olbrich @ 2015-12-18 11:45 UTC (permalink / raw)
  To: ptxdist

Hi,

I don't want to extend the old image rules. Take a look at
rules/image-root-cpio-gz.make  / platforms/image-root-cpio-gz.in

Duplicate this for xz. Or you could merge image-root-cpio and
image-root-cpio-gz and add a choice for the compression mode (none/gz/xz).
Unless someone can think of a use-case where both images are needed?

Michael

On Sat, Nov 07, 2015 at 03:34:45PM +0100, Wolfram Sang wrote:
> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
> ---
>  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
> ptxdist@pengutronix.de

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-12-18 11:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-07 14:34 [ptxdist] [PATCH] images: cpio: add xz packing Wolfram Sang
2015-12-18 11:45 ` Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox