diff mbox series

[OpenWrt-Devel,4/4,v2] gemini: Add SL93512R Support

Message ID 20190123185958.27714-5-linus.walleij@linaro.org
State Changes Requested
Delegated to: Mathias Kresin
Headers show
Series Update Gemini to kernel v4.19 | expand

Commit Message

Linus Walleij Jan. 23, 2019, 6:59 p.m. UTC
This generates images for the StorLink SL93512R reference
design which is supported in kernel v4.19.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
ChangeLog v1->v2:
- Resend.
---
 target/linux/gemini/image/Makefile | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

Comments

Christian Lamparter Jan. 24, 2019, 3:21 p.m. UTC | #1
Hello,

On Wednesday, January 23, 2019 7:59:58 PM CET Linus Walleij wrote:
> This generates images for the StorLink SL93512R reference
> design which is supported in kernel v4.19.
> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> ChangeLog v1->v2:
> - Resend.
> ---
>  target/linux/gemini/image/Makefile | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/target/linux/gemini/image/Makefile b/target/linux/gemini/image/Makefile
> index 59041a72a785..722df1c82b00 100644
> --- a/target/linux/gemini/image/Makefile
> +++ b/target/linux/gemini/image/Makefile
> @@ -39,6 +39,19 @@ define Build/dns313-images
>  	if [ -d $(BIN_DIR)/.boot ] ; then rm -rf $(BIN_DIR)/.boot ; fi
>  endef
>  
> +# Create the special SL93512R image format with the squashfs
> +# split across two "partitions" named rd.gz and hddapp.tgz but
> +# essentially just being used by OpenWRT as one big squashfs
> +# partition
> +define Build/sl93512r-images
> +	dd if=$(IMAGE_ROOTFS) of=$(BIN_DIR)/rd.gz bs=6144k conv=sync
> +	dd if=$(IMAGE_ROOTFS) of=$(BIN_DIR)/hddapp.bz2 bs=6144k count=1 seek=1
So the rootfs gets added to 6144k of padding? For the NAS4220 this was all
just one zeroed file.

> +	cp $(IMAGE_KERNEL) $(BIN_DIR)/zImage
> +	mv $(BIN_DIR)/rd.gz $(BIN_DIR)/$(IMG_PREFIX)-sl93512r-rd.gz
> +	mv $(BIN_DIR)/hddapp.bz2 $(BIN_DIR)/$(IMG_PREFIX)-sl93512r-hddapp.bz2
> +	mv $(BIN_DIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-sl93512r-zImage
> +endef

I did rework the image creation process for the NAS4220B and sq201
because it was very racy (and probably caused some of the build
failures in this target? [0]) and I think it should be possible to
improve the sl93512r as well.

> +
>  # Create the special NAS4220B image format with the squashfs
>  # and overlay inside the "rd.gz" file. We pad it out to 6144K
>  # which is the size of the initramfs partition.
> @@ -122,6 +135,14 @@ define Device/dlink-dns-313
>  endef
>  TARGET_DEVICES += dlink-dns-313
>  
> +define Device/sl93512r
> +	DEVICE_TITLE := StorLink SL93512R Reference Design

> +	IMAGES += sl93512r-image
> +	IMAGE/sl93512r-image := sl93512r-images
Can you please check if something like this:

ARTIFACTS := zImage
ARTIFACT/zImage := append-kernel
IMAGES := rd.gz hddapp.bz2
IMAGE/rd.gz := append-rootfs | pad-to 6144k
IMAGE/hddapp.bz2 := pad-extra 6144k | append-rootfs

Produces similar/compatible files?
(This would make the extra Build/sl93512r-images obsolete).

> +	DEVICE_PACKAGES := $(GEMINI_NAS_PACKAGES)
> +endef
> +TARGET_DEVICES += sl93512r

Regards,
Christian

[0] http://phase1.builds.lede-project.org/builders/gemini%2Fgeneric
Linus Walleij Jan. 26, 2019, 11:34 a.m. UTC | #2
Hi Christian!

thanks for tidying up Gemini!

On Thu, Jan 24, 2019 at 4:21 PM Christian Lamparter <chunkeey@gmail.com> wrote:

> > +     cp $(IMAGE_KERNEL) $(BIN_DIR)/zImage
> > +     mv $(BIN_DIR)/rd.gz $(BIN_DIR)/$(IMG_PREFIX)-sl93512r-rd.gz
> > +     mv $(BIN_DIR)/hddapp.bz2 $(BIN_DIR)/$(IMG_PREFIX)-sl93512r-hddapp.bz2
> > +     mv $(BIN_DIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-sl93512r-zImage
> > +endef
>
> I did rework the image creation process for the NAS4220B and sq201
> because it was very racy (and probably caused some of the build
> failures in this target? [0]) and I think it should be possible to
> improve the sl93512r as well.

Yup I rebased my SL93512r on top of your changes, it works
like a charm.

> > +define Device/sl93512r
> > +     DEVICE_TITLE := StorLink SL93512R Reference Design
>
> > +     IMAGES += sl93512r-image
> > +     IMAGE/sl93512r-image := sl93512r-images
> Can you please check if something like this:
>
> ARTIFACTS := zImage
> ARTIFACT/zImage := append-kernel
> IMAGES := rd.gz hddapp.bz2
> IMAGE/rd.gz := append-rootfs | pad-to 6144k
> IMAGE/hddapp.bz2 := pad-extra 6144k | append-rootfs
>
> Produces similar/compatible files?
> (This would make the extra Build/sl93512r-images obsolete).

It does, I have a new patch for this.

I will not submit it again until we switch to v4.19
though, just sending the kernel patches and
config-v4.19 for next iteration.

Yours,
Linus Walleij
diff mbox series

Patch

diff --git a/target/linux/gemini/image/Makefile b/target/linux/gemini/image/Makefile
index 59041a72a785..722df1c82b00 100644
--- a/target/linux/gemini/image/Makefile
+++ b/target/linux/gemini/image/Makefile
@@ -39,6 +39,19 @@  define Build/dns313-images
 	if [ -d $(BIN_DIR)/.boot ] ; then rm -rf $(BIN_DIR)/.boot ; fi
 endef
 
+# Create the special SL93512R image format with the squashfs
+# split across two "partitions" named rd.gz and hddapp.tgz but
+# essentially just being used by OpenWRT as one big squashfs
+# partition
+define Build/sl93512r-images
+	dd if=$(IMAGE_ROOTFS) of=$(BIN_DIR)/rd.gz bs=6144k conv=sync
+	dd if=$(IMAGE_ROOTFS) of=$(BIN_DIR)/hddapp.bz2 bs=6144k count=1 seek=1
+	cp $(IMAGE_KERNEL) $(BIN_DIR)/zImage
+	mv $(BIN_DIR)/rd.gz $(BIN_DIR)/$(IMG_PREFIX)-sl93512r-rd.gz
+	mv $(BIN_DIR)/hddapp.bz2 $(BIN_DIR)/$(IMG_PREFIX)-sl93512r-hddapp.bz2
+	mv $(BIN_DIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-sl93512r-zImage
+endef
+
 # Create the special NAS4220B image format with the squashfs
 # and overlay inside the "rd.gz" file. We pad it out to 6144K
 # which is the size of the initramfs partition.
@@ -122,6 +135,14 @@  define Device/dlink-dns-313
 endef
 TARGET_DEVICES += dlink-dns-313
 
+define Device/sl93512r
+	DEVICE_TITLE := StorLink SL93512R Reference Design
+	IMAGES += sl93512r-image
+	IMAGE/sl93512r-image := sl93512r-images
+	DEVICE_PACKAGES := $(GEMINI_NAS_PACKAGES)
+endef
+TARGET_DEVICES += sl93512r
+
 define Device/nas4220b
 	DEVICE_TITLE := Raidsonic NAS IB-4220-B
 	IMAGES += nas4220b-image