All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH v2 0/2] openbmc: Use JFFS2 for RW overlay filesystem
@ 2016-02-17  7:27 Andrew Jeffery
  2016-02-17  7:27 ` [RFC PATCH v2 1/2] obmc-init.sh: Fix FS type in mount failure message Andrew Jeffery
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andrew Jeffery @ 2016-02-17  7:27 UTC (permalink / raw)
  To: openbmc

Hopefully less convoluted this time! I've (re)boot tested the JFFS2 image with
success, and I've tested generation of an ext4 RW filesystem as well but
haven't flashed it (binwalk claims that a ext filesystem was created).

Since v1:

  Address comments from Milton:

  * Drop mtd-utils-jffs2 for busybox-provided functionality
  * Drop re-arrangement of variables in obmc-{init,update}.sh
  * Simplify generation of image-rwfs
  * Move hard-coded ext4 mkfs options to (commented) options variable
  * Split out mount message fix

Andrew Jeffery (2):
  obmc-init.sh: Fix FS type in mount failure message
  openbmc: Use JFFS2 for RW overlay filesystem

 meta-phosphor/classes/image-overlay.bbclass                |  7 ++++++-
 .../classes/obmc-phosphor-image_types_uboot.bbclass        | 14 ++++++++++++--
 .../obmc-phosphor-initfs/files/obmc-init.sh                |  4 ++--
 .../obmc-phosphor-initfs/files/obmc-update.sh              |  2 +-
 4 files changed, 21 insertions(+), 6 deletions(-)

-- 
2.5.0

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

* [RFC PATCH v2 1/2] obmc-init.sh: Fix FS type in mount failure message
  2016-02-17  7:27 [RFC PATCH v2 0/2] openbmc: Use JFFS2 for RW overlay filesystem Andrew Jeffery
@ 2016-02-17  7:27 ` Andrew Jeffery
  2016-02-17  7:27 ` [RFC PATCH v2 2/2] openbmc: Use JFFS2 for RW overlay filesystem Andrew Jeffery
  2016-02-18 23:08 ` Milton Miller II
  2 siblings, 0 replies; 4+ messages in thread
From: Andrew Jeffery @ 2016-02-17  7:27 UTC (permalink / raw)
  To: openbmc

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
---
 .../common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh
index 6750de3..9674765 100644
--- a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh
+++ b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh
@@ -114,7 +114,7 @@ then
 	msg="$(cat)" << HERE
 
 Mounting read-write $rwdev filesystem failed.  Please fix and run
-	mount $rwdev $rwdir -t $rwfs -o $rwopts
+	mount $rwdev $rwdir -t $rwfst -o $rwopts
 to to continue, or do change nothing to run from RAM for this boot.
 HERE
 	debug_takeover "$msg"
-- 
2.5.0

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

* [RFC PATCH v2 2/2] openbmc: Use JFFS2 for RW overlay filesystem
  2016-02-17  7:27 [RFC PATCH v2 0/2] openbmc: Use JFFS2 for RW overlay filesystem Andrew Jeffery
  2016-02-17  7:27 ` [RFC PATCH v2 1/2] obmc-init.sh: Fix FS type in mount failure message Andrew Jeffery
@ 2016-02-17  7:27 ` Andrew Jeffery
  2016-02-18 23:08 ` Milton Miller II
  2 siblings, 0 replies; 4+ messages in thread
From: Andrew Jeffery @ 2016-02-17  7:27 UTC (permalink / raw)
  To: openbmc

We can enable JFFS2 support on mtd6 (the RW mtd partition) with a
(first-pass) kernel patch[1] applied to work-around a 'stutter' in the
(optimised) ARM mmiocpy() implementation.

[1] Unmerged, but tested: https://lists.ozlabs.org/pipermail/openbmc/2016-February/001874.html

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
---
 meta-phosphor/classes/image-overlay.bbclass                |  7 ++++++-
 .../classes/obmc-phosphor-image_types_uboot.bbclass        | 14 ++++++++++++--
 .../obmc-phosphor-initfs/files/obmc-init.sh                |  2 +-
 .../obmc-phosphor-initfs/files/obmc-update.sh              |  2 +-
 4 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/meta-phosphor/classes/image-overlay.bbclass b/meta-phosphor/classes/image-overlay.bbclass
index 1c6137d..9203955 100644
--- a/meta-phosphor/classes/image-overlay.bbclass
+++ b/meta-phosphor/classes/image-overlay.bbclass
@@ -3,7 +3,12 @@ INITRD_IMAGE ?= "core-image-minimal-initramfs"
 INITRD ?= "${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE}-${MACHINE}.cpio.${INITRD_CTYPE}${uboot}"
 
 IMAGE_BASETYPE ?= "squashfs-xz"
-OVERLAY_BASETYPE ?= "ext4"
+OVERLAY_BASETYPE ?= "jffs2"
+
+# Note: OVERLAY_BASETYPE_OPTS is not used when OVERLAY_BASETYPE=jffs2
+# Options for when OVERLAY_BASETYPE=ext4
+#
+# OVERLAY_BASETYPE_OPTS ?= "-b 4096 -F -O^huge_file"
 
 IMAGE_TYPES_${PN} += "${IMAGE_BASETYPE}"
 
diff --git a/meta-phosphor/classes/obmc-phosphor-image_types_uboot.bbclass b/meta-phosphor/classes/obmc-phosphor-image_types_uboot.bbclass
index c390c36..abbbe75 100644
--- a/meta-phosphor/classes/obmc-phosphor-image_types_uboot.bbclass
+++ b/meta-phosphor/classes/obmc-phosphor-image_types_uboot.bbclass
@@ -51,8 +51,18 @@ do_generate_flash() {
        fi
 
        oe_mkimage  "${initrd}" "${INITRD_CTYPE}" || bbfatal "oe_mkimage initrd"
-       dd if=/dev/zero of=${ddir}/${rwfs} bs=1k count=${RWFS_SIZE}
-       mkfs.${OVERLAY_BASETYPE} -b 4096 -F -O^huge_file ${ddir}/${rwfs} || bbfatal "mkfs rwfs"
+
+       # Set all the bits to effecitvely erase the RW partition on the NOR when
+       # the image is written
+       dd if=/dev/zero bs=1k count=${RWFS_SIZE} \
+              | tr '\000' '\377' > ${ddir}/${rwfs}
+       if [ "${OVERLAY_BASETYPE}" != jffs2 ]; then
+              # jffs2 can mount an erased filesystem as if it were formatted,
+              # so don't bother formatting unless we're configured to use
+              # something different.
+              mkfs.${OVERLAY_BASETYPE} ${OVERLAY_BASETYPE_OPTS} \
+                     ${ddir}/${rwfs} || bbfatal "mkfs rwfs"
+       fi
 
        dst="${ddir}/${FLASH_IMAGE_NAME}"
        rm -rf $dst
diff --git a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh
index 9674765..f1e448b 100644
--- a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh
+++ b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-init.sh
@@ -72,7 +72,7 @@ rodev=/dev/mtdblock${rofs#mtd}
 rwdev=/dev/mtdblock${rwfs#mtd}
 
 rofst=squashfs
-rwfst=ext4
+rwfst=jffs2
 roopts=ro
 rwopts=rw
 
diff --git a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh
index face06d..4b08e17 100755
--- a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh
+++ b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-initfs/files/obmc-update.sh
@@ -38,7 +38,7 @@ findmtd() {
 rwfs=$(findmtd rwfs)
 
 rwdev=/dev/mtdblock${rwfs#mtd}
-rwfst=ext4
+rwfst=jffs2
 rwopts=rw
 rorwopts=ro${rwopts#rw}
 
-- 
2.5.0

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

* Re: [RFC PATCH v2 2/2] openbmc: Use JFFS2 for RW overlay filesystem
  2016-02-17  7:27 [RFC PATCH v2 0/2] openbmc: Use JFFS2 for RW overlay filesystem Andrew Jeffery
  2016-02-17  7:27 ` [RFC PATCH v2 1/2] obmc-init.sh: Fix FS type in mount failure message Andrew Jeffery
  2016-02-17  7:27 ` [RFC PATCH v2 2/2] openbmc: Use JFFS2 for RW overlay filesystem Andrew Jeffery
@ 2016-02-18 23:08 ` Milton Miller II
  2 siblings, 0 replies; 4+ messages in thread
From: Milton Miller II @ 2016-02-18 23:08 UTC (permalink / raw)
  To: Andrew Jeffery; +Cc: openbmc

Around 02/17/2016 01:27AM in some time zone Andrew Jeffery wrote:

> We can enable JFFS2 support on mtd6 (the RW mtd partition) with a
> (first-pass) kernel patch[1] applied to work-around a 'stutter' in the
> (optimised) ARM mmiocpy() implementation.
> 
> [1] Unmerged, but tested: https://lists.ozlabs.org/pipermail/openbmc/2016-February/001874.html
> 
> Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
---
 meta-phosphor/classes/image-overlay.bbclass                |  7 ++++++-
 .../classes/obmc-phosphor-image_types_uboot.bbclass        | 14 ++++++++++++--
 .../obmc-phosphor-initfs/files/obmc-init.sh                |  2 +-
 .../obmc-phosphor-initfs/files/obmc-update.sh              |  2 +-
 4 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/meta-phosphor/classes/image-overlay.bbclass b/meta-phosphor/classes/image-overlay.bbclass
index 1c6137d..9203955 100644
--- a/meta-phosphor/classes/image-overlay.bbclass
+++ b/meta-phosphor/classes/image-overlay.bbclass
@@ -3,7 +3,12 @@ INITRD_IMAGE ?= "core-image-minimal-initramfs"
 INITRD ?= "${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE}-${MACHINE}.cpio.${INITRD_CTYPE}${uboot}"
 
 IMAGE_BASETYPE ?= "squashfs-xz"
-OVERLAY_BASETYPE ?= "ext4"
+OVERLAY_BASETYPE ?= "jffs2"
+
> +# Note: OVERLAY_BASETYPE_OPTS is not used when OVERLAY_BASETYPE=jffs2
> +# Options for when OVERLAY_BASETYPE=ext4
> +#
> +# OVERLAY_BASETYPE_OPTS ?= "-b 4096 -F -O^huge_file"
> 

This should be something like OVERLAY_MKFS_OPTS_ext4

Its options for the mkfs invocation of the overlay, not the 
base type.

The options are likely mkfs.ext4 specific.

In bitbake, if you want options to apply for a specific type the 
convention is to use that type of naming.  In many cases the build system 
resolves conditionally adding the text to the base variable (but it might 
need to be tested explicitly in this use case).

That also removes the need for a comment explaining it doesn't apply.

 
> diff --git a/meta-phosphor/classes/obmc-phosphor-image_types_uboot.bbclass b/meta-phosphor/classes/obmc-phosphor-
> image_types_uboot.bbclass
> index c390c36..abbbe75 100644
> --- a/meta-phosphor/classes/obmc-phosphor-image_types_uboot.bbclass
> +++ b/meta-phosphor/classes/obmc-phosphor-image_types_uboot.bbclass
>         oe_mkimage  "${initrd}" "${INITRD_CTYPE}" || bbfatal "oe_mkimage initrd"
> -       dd if=/dev/zero of=${ddir}/${rwfs} bs=1k count=${RWFS_SIZE}
> -       mkfs.${OVERLAY_BASETYPE} -b 4096 -F -O^huge_file ${ddir}/${rwfs} || bbfatal "mkfs rwfs"
> +
> +       # Set all the bits to effecitvely erase the RW partition on the NOR when

transposed typo: effectively 

> +       # the image is written
> +       dd if=/dev/zero bs=1k count=${RWFS_SIZE} \
> +              | tr '\000' '\377' > ${ddir}/${rwfs}
> +       if [ "${OVERLAY_BASETYPE}" != jffs2 ]; then

Maybe you could create a mkfs.jffs2 that just does nothing ?  Or verifies the erased
pattern?   Maybe it becomes jffs2-nor like squashfs-xz?   Not sure on this last part.

> +              # jffs2 can mount an erased filesystem as if it were formatted,
> +              # so don't bother formatting unless we're configured to use
> +              # something different.
> +              mkfs.${OVERLAY_BASETYPE} ${OVERLAY_BASETYPE_OPTS} \
> +                     ${ddir}/${rwfs} || bbfatal "mkfs rwfs"
> +       fi


Also could you try taking a stab at trying to mount ext4 before jffs2 in the
update copy-from script to allow the upgrade transition to work?

If not I will put it on top of your branch.

milton

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

end of thread, other threads:[~2016-02-18 23:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-17  7:27 [RFC PATCH v2 0/2] openbmc: Use JFFS2 for RW overlay filesystem Andrew Jeffery
2016-02-17  7:27 ` [RFC PATCH v2 1/2] obmc-init.sh: Fix FS type in mount failure message Andrew Jeffery
2016-02-17  7:27 ` [RFC PATCH v2 2/2] openbmc: Use JFFS2 for RW overlay filesystem Andrew Jeffery
2016-02-18 23:08 ` Milton Miller II

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.