mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] image-root-squashfs: add rules for generic squashfs image
@ 2018-07-30 11:39 Baeuerle, Florian
  2018-07-30 11:56 ` Michael Olbrich
  0 siblings, 1 reply; 6+ messages in thread
From: Baeuerle, Florian @ 2018-07-30 11:39 UTC (permalink / raw)
  To: ptxdist

This adds rules for generating a squashfs image from the root
filesystem via genimage.

Since genimage does not seem to support squashfs-tools v3.x, this
package conflicts with that option.
---
 config/images/squashfs.config    |  8 ++++
 platforms/image-root-squashfs.in | 77 ++++++++++++++++++++++++++++++++
 rules/image-root-squashfs.make   | 41 +++++++++++++++++
 3 files changed, 126 insertions(+)
 create mode 100644 config/images/squashfs.config
 create mode 100644 platforms/image-root-squashfs.in
 create mode 100644 rules/image-root-squashfs.make

diff --git a/config/images/squashfs.config b/config/images/squashfs.config
new file mode 100644
index 000000000..605fcb7a5
--- /dev/null
+++ b/config/images/squashfs.config
@@ -0,0 +1,8 @@
+image @IMAGE@ {
+	squashfs {
+		extraargs = "@EXTRA_ARGS@"
+		compression = @COMPRESSION_MODE@
+		block-size = @BLOCK_SIZE@
+	}
+	name = "root"
+}
diff --git a/platforms/image-root-squashfs.in b/platforms/image-root-squashfs.in
new file mode 100644
index 000000000..d29540310
--- /dev/null
+++ b/platforms/image-root-squashfs.in
@@ -0,0 +1,77 @@
+## SECTION=image
+
+comment "root.squashfs conflicts with squashfs-3.x"
+	depends on HOST_SQUASHFS_TOOLS_V3X
+
+menuconfig IMAGE_ROOT_SQUASHFS
+	tristate
+	select HOST_GENIMAGE
+	select HOST_SQUASHFS_TOOLS
+	select IMAGE_ROOT_TGZ
+	depends on !HOST_SQUASHFS_TOOLS_V3X
+	prompt "Generate images/root.squashfs "
+	help
+	  Build squashfs images of the root filesystem. This image can be stored
+	  linearly into target's flash device at the start of the desired
+	  partition. You should erase the whole partition first if the image
+	  is smaller than partition's size. If not, garbage data in the remaining
+	  space could confuse the filesystem driver.
+
+if IMAGE_ROOT_SQUASHFS
+
+choice
+	prompt "squashfs compression mode"
+	help
+	  Select your prefered compression mode.
+
+	config IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_GZIP
+	bool "gzip"
+	help
+	  Select your prefered compression mode.
+
+	config IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_LZMA
+	bool "lzma"
+	help
+	  Select your prefered compression mode.
+
+	config IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_LZO
+	bool "lzo"
+	help
+	  Select your prefered compression mode.
+
+	config IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_LZ4
+	bool "lz4"
+	help
+	  Select your prefered compression mode.
+
+	config IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_XZ
+	bool "xz"
+	help
+	  Select your prefered compression mode.
+
+endchoice
+
+config IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE
+        string
+        default "gzip" if IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_GZIP
+        default "lzma" if IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_LZMA
+        default "lzo" if IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_LZO
+        default "lz4" if IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_LZ4
+        default "xz" if IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_XZ
+
+config IMAGE_ROOT_SQUASHFS_BLOCK_SIZE
+	string
+	default "128k"
+	prompt "Block size"
+	help
+	  This allows the compression data block size to be selected, both "K" and "M"
+	  postfixes are supported.
+
+config IMAGE_ROOT_SQUASHFS_EXTRA_ARGS
+	string
+	default ""
+	prompt "extra arguments passed to mksquashfs"
+	help
+	  You can add extra arguments for mksquashfs here
+
+endif
diff --git a/rules/image-root-squashfs.make b/rules/image-root-squashfs.make
new file mode 100644
index 000000000..ce79943f3
--- /dev/null
+++ b/rules/image-root-squashfs.make
@@ -0,0 +1,41 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2018 by Florian Bäuerle <florian.baeuerle@allegion.com>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+IMAGE_PACKAGES-$(PTXCONF_IMAGE_ROOT_SQUASHFS) += image-root-squashfs
+
+#
+# Paths and names
+#
+IMAGE_ROOT_SQUASHFS		:= image-root-squashfs
+IMAGE_ROOT_SQUASHFS_DIR		:= $(BUILDDIR)/$(IMAGE_ROOT_SQUASHFS)
+IMAGE_ROOT_SQUASHFS_IMAGE	:= $(IMAGEDIR)/root.squashfs
+IMAGE_ROOT_SQUASHFS_FILES	:= $(IMAGEDIR)/root.tgz
+IMAGE_ROOT_SQUASHFS_CONFIG	:= squashfs.config
+
+# ----------------------------------------------------------------------------
+# Image
+# ----------------------------------------------------------------------------
+
+ifdef PTXCONF_IMAGE_ROOT_SQUASHFS
+IMAGE_ROOT_SQUASHFS_ENV := \
+	EXTRA_ARGS=$(PTXCONF_IMAGE_ROOT_SQUASHFS_EXTRA_ARGS) \
+	COMPRESSION_MODE=$(PTXCONF_IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE) \
+	BLOCK_SIZE=$(PTXCONF_IMAGE_ROOT_SQUASHFS_BLOCK_SIZE)
+
+$(IMAGE_ROOT_SQUASHFS_IMAGE):
+	@$(call targetinfo)
+	@$(call image/genimage, IMAGE_ROOT_SQUASHFS)
+	@$(call finish)
+endif
+
+# vim: syntax=make
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH] image-root-squashfs: add rules for generic squashfs image
  2018-07-30 11:39 [ptxdist] [PATCH] image-root-squashfs: add rules for generic squashfs image Baeuerle, Florian
@ 2018-07-30 11:56 ` Michael Olbrich
  2018-07-30 11:58   ` Baeuerle, Florian
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Olbrich @ 2018-07-30 11:56 UTC (permalink / raw)
  To: ptxdist

On Mon, Jul 30, 2018 at 11:39:05AM +0000, Baeuerle, Florian wrote:
> This adds rules for generating a squashfs image from the root
> filesystem via genimage.
> 
> Since genimage does not seem to support squashfs-tools v3.x, this
> package conflicts with that option.

I think we should remove support for squashfs-tools v3.x from PTXdist
completely instead. I don't think this is needed.

Michael

> ---
>  config/images/squashfs.config    |  8 ++++
>  platforms/image-root-squashfs.in | 77 ++++++++++++++++++++++++++++++++
>  rules/image-root-squashfs.make   | 41 +++++++++++++++++
>  3 files changed, 126 insertions(+)
>  create mode 100644 config/images/squashfs.config
>  create mode 100644 platforms/image-root-squashfs.in
>  create mode 100644 rules/image-root-squashfs.make
> 
> diff --git a/config/images/squashfs.config b/config/images/squashfs.config
> new file mode 100644
> index 000000000..605fcb7a5
> --- /dev/null
> +++ b/config/images/squashfs.config
> @@ -0,0 +1,8 @@
> +image @IMAGE@ {
> +	squashfs {
> +		extraargs = "@EXTRA_ARGS@"
> +		compression = @COMPRESSION_MODE@
> +		block-size = @BLOCK_SIZE@
> +	}
> +	name = "root"
> +}
> diff --git a/platforms/image-root-squashfs.in b/platforms/image-root-squashfs.in
> new file mode 100644
> index 000000000..d29540310
> --- /dev/null
> +++ b/platforms/image-root-squashfs.in
> @@ -0,0 +1,77 @@
> +## SECTION=image
> +
> +comment "root.squashfs conflicts with squashfs-3.x"
> +	depends on HOST_SQUASHFS_TOOLS_V3X
> +
> +menuconfig IMAGE_ROOT_SQUASHFS
> +	tristate
> +	select HOST_GENIMAGE
> +	select HOST_SQUASHFS_TOOLS
> +	select IMAGE_ROOT_TGZ
> +	depends on !HOST_SQUASHFS_TOOLS_V3X
> +	prompt "Generate images/root.squashfs "
> +	help
> +	  Build squashfs images of the root filesystem. This image can be stored
> +	  linearly into target's flash device at the start of the desired
> +	  partition. You should erase the whole partition first if the image
> +	  is smaller than partition's size. If not, garbage data in the remaining
> +	  space could confuse the filesystem driver.
> +
> +if IMAGE_ROOT_SQUASHFS
> +
> +choice
> +	prompt "squashfs compression mode"
> +	help
> +	  Select your prefered compression mode.
> +
> +	config IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_GZIP
> +	bool "gzip"
> +	help
> +	  Select your prefered compression mode.
> +
> +	config IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_LZMA
> +	bool "lzma"
> +	help
> +	  Select your prefered compression mode.
> +
> +	config IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_LZO
> +	bool "lzo"
> +	help
> +	  Select your prefered compression mode.
> +
> +	config IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_LZ4
> +	bool "lz4"
> +	help
> +	  Select your prefered compression mode.
> +
> +	config IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_XZ
> +	bool "xz"
> +	help
> +	  Select your prefered compression mode.
> +
> +endchoice
> +
> +config IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE
> +        string
> +        default "gzip" if IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_GZIP
> +        default "lzma" if IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_LZMA
> +        default "lzo" if IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_LZO
> +        default "lz4" if IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_LZ4
> +        default "xz" if IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_XZ
> +
> +config IMAGE_ROOT_SQUASHFS_BLOCK_SIZE
> +	string
> +	default "128k"
> +	prompt "Block size"
> +	help
> +	  This allows the compression data block size to be selected, both "K" and "M"
> +	  postfixes are supported.
> +
> +config IMAGE_ROOT_SQUASHFS_EXTRA_ARGS
> +	string

> +	default ""

This is the default. Just remove it.

> +	prompt "extra arguments passed to mksquashfs"
> +	help
> +	  You can add extra arguments for mksquashfs here
> +
> +endif
> diff --git a/rules/image-root-squashfs.make b/rules/image-root-squashfs.make
> new file mode 100644
> index 000000000..ce79943f3
> --- /dev/null
> +++ b/rules/image-root-squashfs.make
> @@ -0,0 +1,41 @@
> +# -*-makefile-*-
> +#
> +# Copyright (C) 2018 by Florian Bäuerle <florian.baeuerle@allegion.com>
> +#
> +# See CREDITS for details about who has contributed to this project.
> +#
> +# For further information about the PTXdist project and license conditions
> +# see the README file.
> +#
> +
> +#
> +# We provide this package
> +#
> +IMAGE_PACKAGES-$(PTXCONF_IMAGE_ROOT_SQUASHFS) += image-root-squashfs
> +
> +#
> +# Paths and names
> +#
> +IMAGE_ROOT_SQUASHFS		:= image-root-squashfs
> +IMAGE_ROOT_SQUASHFS_DIR		:= $(BUILDDIR)/$(IMAGE_ROOT_SQUASHFS)
> +IMAGE_ROOT_SQUASHFS_IMAGE	:= $(IMAGEDIR)/root.squashfs
> +IMAGE_ROOT_SQUASHFS_FILES	:= $(IMAGEDIR)/root.tgz
> +IMAGE_ROOT_SQUASHFS_CONFIG	:= squashfs.config
> +
> +# ----------------------------------------------------------------------------
> +# Image
> +# ----------------------------------------------------------------------------
> +
> +ifdef PTXCONF_IMAGE_ROOT_SQUASHFS

This is not needed. I should remove this from the other rules. Something
like this was necessary when we two ways to generate the same images. That
is no longer the case.

Michael

> +IMAGE_ROOT_SQUASHFS_ENV := \
> +	EXTRA_ARGS=$(PTXCONF_IMAGE_ROOT_SQUASHFS_EXTRA_ARGS) \
> +	COMPRESSION_MODE=$(PTXCONF_IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE) \
> +	BLOCK_SIZE=$(PTXCONF_IMAGE_ROOT_SQUASHFS_BLOCK_SIZE)
> +
> +$(IMAGE_ROOT_SQUASHFS_IMAGE):
> +	@$(call targetinfo)
> +	@$(call image/genimage, IMAGE_ROOT_SQUASHFS)
> +	@$(call finish)
> +endif
> +
> +# vim: syntax=make
> _______________________________________________
> 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] 6+ messages in thread

* Re: [ptxdist] [PATCH] image-root-squashfs: add rules for generic squashfs image
  2018-07-30 11:56 ` Michael Olbrich
@ 2018-07-30 11:58   ` Baeuerle, Florian
  2018-07-30 12:20     ` Michael Olbrich
  0 siblings, 1 reply; 6+ messages in thread
From: Baeuerle, Florian @ 2018-07-30 11:58 UTC (permalink / raw)
  To: ptxdist

Am Montag, den 30.07.2018, 13:56 +0200 schrieb Michael Olbrich:
> On Mon, Jul 30, 2018 at 11:39:05AM +0000, Baeuerle, Florian wrote:
> > This adds rules for generating a squashfs image from the root
> > filesystem via genimage.
> > 
> > Since genimage does not seem to support squashfs-tools v3.x, this
> > package conflicts with that option.
> 
> I think we should remove support for squashfs-tools v3.x from PTXdist
> completely instead. I don't think this is needed.
> 
> Michael

Would you like that being done in this patch, or would you prefer an extra
patch for that?

> 
> > ---
> >  config/images/squashfs.config    |  8 ++++
> >  platforms/image-root-squashfs.in | 77 ++++++++++++++++++++++++++++++++
> >  rules/image-root-squashfs.make   | 41 +++++++++++++++++
> >  3 files changed, 126 insertions(+)
> >  create mode 100644 config/images/squashfs.config
> >  create mode 100644 platforms/image-root-squashfs.in
> >  create mode 100644 rules/image-root-squashfs.make
> > 
> > diff --git a/config/images/squashfs.config b/config/images/squashfs.config
> > new file mode 100644
> > index 000000000..605fcb7a5
> > --- /dev/null
> > +++ b/config/images/squashfs.config
> > @@ -0,0 +1,8 @@
> > +image @IMAGE@ {
> > +	squashfs {
> > +		extraargs = "@EXTRA_ARGS@"
> > +		compression = @COMPRESSION_MODE@
> > +		block-size = @BLOCK_SIZE@
> > +	}
> > +	name = "root"
> > +}
> > diff --git a/platforms/image-root-squashfs.in b/platforms/image-root-squashfs.in
> > new file mode 100644
> > index 000000000..d29540310
> > --- /dev/null
> > +++ b/platforms/image-root-squashfs.in
> > @@ -0,0 +1,77 @@
> > +## SECTION=image
> > +
> > +comment "root.squashfs conflicts with squashfs-3.x"
> > +	depends on HOST_SQUASHFS_TOOLS_V3X
> > +
> > +menuconfig IMAGE_ROOT_SQUASHFS
> > +	tristate
> > +	select HOST_GENIMAGE
> > +	select HOST_SQUASHFS_TOOLS
> > +	select IMAGE_ROOT_TGZ
> > +	depends on !HOST_SQUASHFS_TOOLS_V3X
> > +	prompt "Generate images/root.squashfs "
> > +	help
> > +	  Build squashfs images of the root filesystem. This image can be stored
> > +	  linearly into target's flash device at the start of the desired
> > +	  partition. You should erase the whole partition first if the image
> > +	  is smaller than partition's size. If not, garbage data in the remaining
> > +	  space could confuse the filesystem driver.
> > +
> > +if IMAGE_ROOT_SQUASHFS
> > +
> > +choice
> > +	prompt "squashfs compression mode"
> > +	help
> > +	  Select your prefered compression mode.
> > +
> > +	config IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_GZIP
> > +	bool "gzip"
> > +	help
> > +	  Select your prefered compression mode.
> > +
> > +	config IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_LZMA
> > +	bool "lzma"
> > +	help
> > +	  Select your prefered compression mode.
> > +
> > +	config IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_LZO
> > +	bool "lzo"
> > +	help
> > +	  Select your prefered compression mode.
> > +
> > +	config IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_LZ4
> > +	bool "lz4"
> > +	help
> > +	  Select your prefered compression mode.
> > +
> > +	config IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_XZ
> > +	bool "xz"
> > +	help
> > +	  Select your prefered compression mode.
> > +
> > +endchoice
> > +
> > +config IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE
> > +        string
> > +        default "gzip" if IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_GZIP
> > +        default "lzma" if IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_LZMA
> > +        default "lzo" if IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_LZO
> > +        default "lz4" if IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_LZ4
> > +        default "xz" if IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_XZ
> > +
> > +config IMAGE_ROOT_SQUASHFS_BLOCK_SIZE
> > +	string
> > +	default "128k"
> > +	prompt "Block size"
> > +	help
> > +	  This allows the compression data block size to be selected, both "K" and "M"
> > +	  postfixes are supported.
> > +
> > +config IMAGE_ROOT_SQUASHFS_EXTRA_ARGS
> > +	string
> > +	default ""
> 
> This is the default. Just remove it.
> 
> > +	prompt "extra arguments passed to mksquashfs"
> > +	help
> > +	  You can add extra arguments for mksquashfs here
> > +
> > +endif
> > diff --git a/rules/image-root-squashfs.make b/rules/image-root-squashfs.make
> > new file mode 100644
> > index 000000000..ce79943f3
> > --- /dev/null
> > +++ b/rules/image-root-squashfs.make
> > @@ -0,0 +1,41 @@
> > +# -*-makefile-*-
> > +#
> > +# Copyright (C) 2018 by Florian Bäuerle <florian.baeuerle@allegion.com>
> > +#
> > +# See CREDITS for details about who has contributed to this project.
> > +#
> > +# For further information about the PTXdist project and license conditions
> > +# see the README file.
> > +#
> > +
> > +#
> > +# We provide this package
> > +#
> > +IMAGE_PACKAGES-$(PTXCONF_IMAGE_ROOT_SQUASHFS) += image-root-squashfs
> > +
> > +#
> > +# Paths and names
> > +#
> > +IMAGE_ROOT_SQUASHFS		:= image-root-squashfs
> > +IMAGE_ROOT_SQUASHFS_DIR		:= $(BUILDDIR)/$(IMAGE_ROOT_SQUASHFS)
> > +IMAGE_ROOT_SQUASHFS_IMAGE	:= $(IMAGEDIR)/root.squashfs
> > +IMAGE_ROOT_SQUASHFS_FILES	:= $(IMAGEDIR)/root.tgz
> > +IMAGE_ROOT_SQUASHFS_CONFIG	:= squashfs.config
> > +
> > +# ----------------------------------------------------------------------------
> > +# Image
> > +# ----------------------------------------------------------------------------
> > +
> > +ifdef PTXCONF_IMAGE_ROOT_SQUASHFS
> 
> This is not needed. I should remove this from the other rules. Something
> like this was necessary when we two ways to generate the same images. That
> is no longer the case.
> 
> Michael
> 
> > +IMAGE_ROOT_SQUASHFS_ENV := \
> > +	EXTRA_ARGS=$(PTXCONF_IMAGE_ROOT_SQUASHFS_EXTRA_ARGS) \
> > +	COMPRESSION_MODE=$(PTXCONF_IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE) \
> > +	BLOCK_SIZE=$(PTXCONF_IMAGE_ROOT_SQUASHFS_BLOCK_SIZE)
> > +
> > +$(IMAGE_ROOT_SQUASHFS_IMAGE):
> > +	@$(call targetinfo)
> > +	@$(call image/genimage, IMAGE_ROOT_SQUASHFS)
> > +	@$(call finish)
> > +endif
> > +
> > +# vim: syntax=make
> > _______________________________________________
> > ptxdist mailing list
> > ptxdist@pengutronix.de
> 
> 
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH] image-root-squashfs: add rules for generic squashfs image
  2018-07-30 11:58   ` Baeuerle, Florian
@ 2018-07-30 12:20     ` Michael Olbrich
  2018-07-30 12:50       ` [ptxdist] [PATCH v2 1/2] " Baeuerle, Florian
  2018-07-30 12:50       ` [ptxdist] [PATCH v2 2/2] squashfs-tools: version bump 4.2 -> 4.3 and drop 3.4 support Baeuerle, Florian
  0 siblings, 2 replies; 6+ messages in thread
From: Michael Olbrich @ 2018-07-30 12:20 UTC (permalink / raw)
  To: ptxdist

On Mon, Jul 30, 2018 at 11:58:56AM +0000, Baeuerle, Florian wrote:
> Am Montag, den 30.07.2018, 13:56 +0200 schrieb Michael Olbrich:
> > On Mon, Jul 30, 2018 at 11:39:05AM +0000, Baeuerle, Florian wrote:
> > > This adds rules for generating a squashfs image from the root
> > > filesystem via genimage.
> > > 
> > > Since genimage does not seem to support squashfs-tools v3.x, this
> > > package conflicts with that option.
> > 
> > I think we should remove support for squashfs-tools v3.x from PTXdist
> > completely instead. I don't think this is needed.
> > 
> > Michael
> 
> Would you like that being done in this patch, or would you prefer an extra
> patch for that?

An extra patch please.

Michael

> > 
> > > ---
> > >  config/images/squashfs.config    |  8 ++++
> > >  platforms/image-root-squashfs.in | 77 ++++++++++++++++++++++++++++++++
> > >  rules/image-root-squashfs.make   | 41 +++++++++++++++++
> > >  3 files changed, 126 insertions(+)
> > >  create mode 100644 config/images/squashfs.config
> > >  create mode 100644 platforms/image-root-squashfs.in
> > >  create mode 100644 rules/image-root-squashfs.make
> > > 
> > > diff --git a/config/images/squashfs.config b/config/images/squashfs.config
> > > new file mode 100644
> > > index 000000000..605fcb7a5
> > > --- /dev/null
> > > +++ b/config/images/squashfs.config
> > > @@ -0,0 +1,8 @@
> > > +image @IMAGE@ {
> > > +	squashfs {
> > > +		extraargs = "@EXTRA_ARGS@"
> > > +		compression = @COMPRESSION_MODE@
> > > +		block-size = @BLOCK_SIZE@
> > > +	}
> > > +	name = "root"
> > > +}
> > > diff --git a/platforms/image-root-squashfs.in b/platforms/image-root-squashfs.in
> > > new file mode 100644
> > > index 000000000..d29540310
> > > --- /dev/null
> > > +++ b/platforms/image-root-squashfs.in
> > > @@ -0,0 +1,77 @@
> > > +## SECTION=image
> > > +
> > > +comment "root.squashfs conflicts with squashfs-3.x"
> > > +	depends on HOST_SQUASHFS_TOOLS_V3X
> > > +
> > > +menuconfig IMAGE_ROOT_SQUASHFS
> > > +	tristate
> > > +	select HOST_GENIMAGE
> > > +	select HOST_SQUASHFS_TOOLS
> > > +	select IMAGE_ROOT_TGZ
> > > +	depends on !HOST_SQUASHFS_TOOLS_V3X
> > > +	prompt "Generate images/root.squashfs "
> > > +	help
> > > +	  Build squashfs images of the root filesystem. This image can be stored
> > > +	  linearly into target's flash device at the start of the desired
> > > +	  partition. You should erase the whole partition first if the image
> > > +	  is smaller than partition's size. If not, garbage data in the remaining
> > > +	  space could confuse the filesystem driver.
> > > +
> > > +if IMAGE_ROOT_SQUASHFS
> > > +
> > > +choice
> > > +	prompt "squashfs compression mode"
> > > +	help
> > > +	  Select your prefered compression mode.
> > > +
> > > +	config IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_GZIP
> > > +	bool "gzip"
> > > +	help
> > > +	  Select your prefered compression mode.
> > > +
> > > +	config IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_LZMA
> > > +	bool "lzma"
> > > +	help
> > > +	  Select your prefered compression mode.
> > > +
> > > +	config IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_LZO
> > > +	bool "lzo"
> > > +	help
> > > +	  Select your prefered compression mode.
> > > +
> > > +	config IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_LZ4
> > > +	bool "lz4"
> > > +	help
> > > +	  Select your prefered compression mode.
> > > +
> > > +	config IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_XZ
> > > +	bool "xz"
> > > +	help
> > > +	  Select your prefered compression mode.
> > > +
> > > +endchoice
> > > +
> > > +config IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE
> > > +        string
> > > +        default "gzip" if IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_GZIP
> > > +        default "lzma" if IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_LZMA
> > > +        default "lzo" if IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_LZO
> > > +        default "lz4" if IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_LZ4
> > > +        default "xz" if IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_XZ
> > > +
> > > +config IMAGE_ROOT_SQUASHFS_BLOCK_SIZE
> > > +	string
> > > +	default "128k"
> > > +	prompt "Block size"
> > > +	help
> > > +	  This allows the compression data block size to be selected, both "K" and "M"
> > > +	  postfixes are supported.
> > > +
> > > +config IMAGE_ROOT_SQUASHFS_EXTRA_ARGS
> > > +	string
> > > +	default ""
> > 
> > This is the default. Just remove it.
> > 
> > > +	prompt "extra arguments passed to mksquashfs"
> > > +	help
> > > +	  You can add extra arguments for mksquashfs here
> > > +
> > > +endif
> > > diff --git a/rules/image-root-squashfs.make b/rules/image-root-squashfs.make
> > > new file mode 100644
> > > index 000000000..ce79943f3
> > > --- /dev/null
> > > +++ b/rules/image-root-squashfs.make
> > > @@ -0,0 +1,41 @@
> > > +# -*-makefile-*-
> > > +#
> > > +# Copyright (C) 2018 by Florian Bäuerle <florian.baeuerle@allegion.com>
> > > +#
> > > +# See CREDITS for details about who has contributed to this project.
> > > +#
> > > +# For further information about the PTXdist project and license conditions
> > > +# see the README file.
> > > +#
> > > +
> > > +#
> > > +# We provide this package
> > > +#
> > > +IMAGE_PACKAGES-$(PTXCONF_IMAGE_ROOT_SQUASHFS) += image-root-squashfs
> > > +
> > > +#
> > > +# Paths and names
> > > +#
> > > +IMAGE_ROOT_SQUASHFS		:= image-root-squashfs
> > > +IMAGE_ROOT_SQUASHFS_DIR		:= $(BUILDDIR)/$(IMAGE_ROOT_SQUASHFS)
> > > +IMAGE_ROOT_SQUASHFS_IMAGE	:= $(IMAGEDIR)/root.squashfs
> > > +IMAGE_ROOT_SQUASHFS_FILES	:= $(IMAGEDIR)/root.tgz
> > > +IMAGE_ROOT_SQUASHFS_CONFIG	:= squashfs.config
> > > +
> > > +# ----------------------------------------------------------------------------
> > > +# Image
> > > +# ----------------------------------------------------------------------------
> > > +
> > > +ifdef PTXCONF_IMAGE_ROOT_SQUASHFS
> > 
> > This is not needed. I should remove this from the other rules. Something
> > like this was necessary when we two ways to generate the same images. That
> > is no longer the case.
> > 
> > Michael
> > 
> > > +IMAGE_ROOT_SQUASHFS_ENV := \
> > > +	EXTRA_ARGS=$(PTXCONF_IMAGE_ROOT_SQUASHFS_EXTRA_ARGS) \
> > > +	COMPRESSION_MODE=$(PTXCONF_IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE) \
> > > +	BLOCK_SIZE=$(PTXCONF_IMAGE_ROOT_SQUASHFS_BLOCK_SIZE)
> > > +
> > > +$(IMAGE_ROOT_SQUASHFS_IMAGE):
> > > +	@$(call targetinfo)
> > > +	@$(call image/genimage, IMAGE_ROOT_SQUASHFS)
> > > +	@$(call finish)
> > > +endif
> > > +
> > > +# vim: syntax=make
> > > _______________________________________________
> > > ptxdist mailing list
> > > ptxdist@pengutronix.de
> > 
> > 
> _______________________________________________
> 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] 6+ messages in thread

* [ptxdist] [PATCH v2 1/2] image-root-squashfs: add rules for generic squashfs image
  2018-07-30 12:20     ` Michael Olbrich
@ 2018-07-30 12:50       ` Baeuerle, Florian
  2018-07-30 12:50       ` [ptxdist] [PATCH v2 2/2] squashfs-tools: version bump 4.2 -> 4.3 and drop 3.4 support Baeuerle, Florian
  1 sibling, 0 replies; 6+ messages in thread
From: Baeuerle, Florian @ 2018-07-30 12:50 UTC (permalink / raw)
  To: ptxdist

This adds rules for generating a squashfs image from the root
filesystem via genimage.
---
 config/images/squashfs.config    |  8 ++++
 platforms/image-root-squashfs.in | 72 ++++++++++++++++++++++++++++++++
 rules/image-root-squashfs.make   | 39 +++++++++++++++++
 3 files changed, 119 insertions(+)
 create mode 100644 config/images/squashfs.config
 create mode 100644 platforms/image-root-squashfs.in
 create mode 100644 rules/image-root-squashfs.make

diff --git a/config/images/squashfs.config b/config/images/squashfs.config
new file mode 100644
index 000000000..605fcb7a5
--- /dev/null
+++ b/config/images/squashfs.config
@@ -0,0 +1,8 @@
+image @IMAGE@ {
+	squashfs {
+		extraargs = "@EXTRA_ARGS@"
+		compression = @COMPRESSION_MODE@
+		block-size = @BLOCK_SIZE@
+	}
+	name = "root"
+}
diff --git a/platforms/image-root-squashfs.in b/platforms/image-root-squashfs.in
new file mode 100644
index 000000000..4020c50eb
--- /dev/null
+++ b/platforms/image-root-squashfs.in
@@ -0,0 +1,72 @@
+## SECTION=image
+
+menuconfig IMAGE_ROOT_SQUASHFS
+	tristate
+	select HOST_GENIMAGE
+	select HOST_SQUASHFS_TOOLS
+	select IMAGE_ROOT_TGZ
+	prompt "Generate images/root.squashfs "
+	help
+	  Build squashfs images of the root filesystem. This image can be stored
+	  linearly into target's flash device at the start of the desired
+	  partition. You should erase the whole partition first if the image
+	  is smaller than partition's size. If not, garbage data in the remaining
+	  space could confuse the filesystem driver.
+
+if IMAGE_ROOT_SQUASHFS
+
+choice
+	prompt "squashfs compression mode"
+	help
+	  Select your prefered compression mode.
+
+	config IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_GZIP
+	bool "gzip"
+	help
+	  Select your prefered compression mode.
+
+	config IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_LZMA
+	bool "lzma"
+	help
+	  Select your prefered compression mode.
+
+	config IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_LZO
+	bool "lzo"
+	help
+	  Select your prefered compression mode.
+
+	config IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_LZ4
+	bool "lz4"
+	help
+	  Select your prefered compression mode.
+
+	config IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_XZ
+	bool "xz"
+	help
+	  Select your prefered compression mode.
+
+endchoice
+
+config IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE
+        string
+        default "gzip" if IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_GZIP
+        default "lzma" if IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_LZMA
+        default "lzo" if IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_LZO
+        default "lz4" if IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_LZ4
+        default "xz" if IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE_XZ
+
+config IMAGE_ROOT_SQUASHFS_BLOCK_SIZE
+	string
+	default "128k"
+	prompt "Block size"
+	help
+	  This allows the compression data block size to be selected, both "K" and "M"
+	  postfixes are supported.
+
+config IMAGE_ROOT_SQUASHFS_EXTRA_ARGS
+	string
+	prompt "extra arguments passed to mksquashfs"
+	help
+	  You can add extra arguments for mksquashfs here
+
+endif
diff --git a/rules/image-root-squashfs.make b/rules/image-root-squashfs.make
new file mode 100644
index 000000000..204e5434f
--- /dev/null
+++ b/rules/image-root-squashfs.make
@@ -0,0 +1,39 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2018 by Florian Bäuerle <florian.baeuerle@allegion.com>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+IMAGE_PACKAGES-$(PTXCONF_IMAGE_ROOT_SQUASHFS) += image-root-squashfs
+
+#
+# Paths and names
+#
+IMAGE_ROOT_SQUASHFS		:= image-root-squashfs
+IMAGE_ROOT_SQUASHFS_DIR		:= $(BUILDDIR)/$(IMAGE_ROOT_SQUASHFS)
+IMAGE_ROOT_SQUASHFS_IMAGE	:= $(IMAGEDIR)/root.squashfs
+IMAGE_ROOT_SQUASHFS_FILES	:= $(IMAGEDIR)/root.tgz
+IMAGE_ROOT_SQUASHFS_CONFIG	:= squashfs.config
+
+# ----------------------------------------------------------------------------
+# Image
+# ----------------------------------------------------------------------------
+
+IMAGE_ROOT_SQUASHFS_ENV := \
+	EXTRA_ARGS=$(PTXCONF_IMAGE_ROOT_SQUASHFS_EXTRA_ARGS) \
+	COMPRESSION_MODE=$(PTXCONF_IMAGE_ROOT_SQUASHFS_COMPRESSION_MODE) \
+	BLOCK_SIZE=$(PTXCONF_IMAGE_ROOT_SQUASHFS_BLOCK_SIZE)
+
+$(IMAGE_ROOT_SQUASHFS_IMAGE):
+	@$(call targetinfo)
+	@$(call image/genimage, IMAGE_ROOT_SQUASHFS)
+	@$(call finish)
+
+# vim: syntax=make
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* [ptxdist] [PATCH v2 2/2] squashfs-tools: version bump 4.2 -> 4.3 and drop 3.4 support
  2018-07-30 12:20     ` Michael Olbrich
  2018-07-30 12:50       ` [ptxdist] [PATCH v2 1/2] " Baeuerle, Florian
@ 2018-07-30 12:50       ` Baeuerle, Florian
  1 sibling, 0 replies; 6+ messages in thread
From: Baeuerle, Florian @ 2018-07-30 12:50 UTC (permalink / raw)
  To: ptxdist

---
 rules/squashfs-tools.make | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/rules/squashfs-tools.make b/rules/squashfs-tools.make
index 6bdc03635..5fb905d06 100644
--- a/rules/squashfs-tools.make
+++ b/rules/squashfs-tools.make
@@ -16,13 +16,9 @@ PACKAGES-$(PTXCONF_SQUASHFS_TOOLS) += squashfs-tools
 #
 # Paths and names
 #
-SQUASHFS_TOOLS_VERSION	:= $(call ptx/ifdef, PTXCONF_HOST_SQUASHFS_TOOLS_V3X, 3.4, 4.2)
-ifdef PTXCONF_HOST_SQUASHFS_TOOLS_V3X
-SQUASHFS_TOOLS_MD5	:= 2a4d2995ad5aa6840c95a95ffa6b1da6
-else
-SQUASHFS_TOOLS_MD5	:= 1b7a781fb4cf8938842279bd3e8ee852
-endif
-SQUASHFS_TOOLS		:= squashfs$(SQUASHFS_TOOLS_VERSION)
+SQUASHFS_TOOLS_VERSION	:= 4.3
+SQUASHFS_TOOLS_MD5	:= d92ab59aabf5173f2a59089531e30dbf
+SQUASHFS_TOOLS		:= squashfs-tools-$(SQUASHFS_TOOLS_VERSION)
 SQUASHFS_TOOLS_SUFFIX	:= tar.gz
 SQUASHFS_TOOLS_URL	:= $(call ptx/mirror, SF, squashfs/$(SQUASHFS_TOOLS).$(SQUASHFS_TOOLS_SUFFIX))
 SQUASHFS_TOOLS_SOURCE	:= $(SRCDIR)/$(SQUASHFS_TOOLS).$(SQUASHFS_TOOLS_SUFFIX)
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

end of thread, other threads:[~2018-07-30 12:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-30 11:39 [ptxdist] [PATCH] image-root-squashfs: add rules for generic squashfs image Baeuerle, Florian
2018-07-30 11:56 ` Michael Olbrich
2018-07-30 11:58   ` Baeuerle, Florian
2018-07-30 12:20     ` Michael Olbrich
2018-07-30 12:50       ` [ptxdist] [PATCH v2 1/2] " Baeuerle, Florian
2018-07-30 12:50       ` [ptxdist] [PATCH v2 2/2] squashfs-tools: version bump 4.2 -> 4.3 and drop 3.4 support Baeuerle, Florian

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