diff mbox series

mvebu: omnia: make initramfs image usable out of the box

Message ID 20210130130444.8581-1-ynezz@true.cz
State Accepted
Delegated to: Petr Štetiar
Headers show
Series mvebu: omnia: make initramfs image usable out of the box | expand

Commit Message

Petr Štetiar Jan. 30, 2021, 1:04 p.m. UTC
Currently it's not possible to boot the device with just initramfs image
without additional effort as the initramfs image doesn't contain device tree.
Fix it by producing FIT based image which could be booted with following
commands:

 setenv bootargs earlyprintk console=ttyS0,115200
 tftpboot ${kernel_addr_r} openwrt-mvebu-cortexa9-cznic_turris-omnia-initramfs-kernel.bin
 bootm ${kernel_addr_r}

Cc: Karel Kočí <karel.koci@nic.cz>
Cc: Tomasz Maciej Nowak <tmn505@gmail.com>
Cc: Klaus Kudielka <klaus.kudielka@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
---
 target/linux/mvebu/image/cortexa9.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Tomasz Maciej Nowak Jan. 30, 2021, 3:45 p.m. UTC | #1
W dniu 30.01.2021 o 14:04, Petr Štetiar pisze:
> Currently it's not possible to boot the device with just initramfs image
> without additional effort as the initramfs image doesn't contain device tree.
> Fix it by producing FIT based image which could be booted with following
> commands:
> 
>  setenv bootargs earlyprintk console=ttyS0,115200
>  tftpboot ${kernel_addr_r} openwrt-mvebu-cortexa9-cznic_turris-omnia-initramfs-kernel.bin
>  bootm ${kernel_addr_r}
> 
> Cc: Karel Kočí <karel.koci@nic.cz>
> Cc: Tomasz Maciej Nowak <tmn505@gmail.com>
> Cc: Klaus Kudielka <klaus.kudielka@gmail.com>
> Signed-off-by: Petr Štetiar <ynezz@true.cz>

Looks good.

Reviewed-by: Tomasz Maciej Nowak <tmn505@gmail.com>

> ---
>  target/linux/mvebu/image/cortexa9.mk | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/linux/mvebu/image/cortexa9.mk b/target/linux/mvebu/image/cortexa9.mk
> index ea20a25a2990..968e2a38f480 100644
> --- a/target/linux/mvebu/image/cortexa9.mk
> +++ b/target/linux/mvebu/image/cortexa9.mk
> @@ -32,8 +32,9 @@ define Device/cznic_turris-omnia
>    DEVICE_VENDOR := CZ.NIC
>    DEVICE_MODEL := Turris Omnia
>    KERNEL_INSTALL := 1
> +  SOC := armada-385
>    KERNEL := kernel-bin
> -  KERNEL_INITRAMFS := kernel-bin
> +  KERNEL_INITRAMFS := kernel-bin | gzip | fit gzip $$(KDIR)/image-$$(DEVICE_DTS).dtb
>    DEVICE_PACKAGES :=  \
>      mkf2fs e2fsprogs kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 \
>      wpad-basic-wolfssl kmod-ath9k kmod-ath10k-ct ath10k-firmware-qca988x-ct \
> @@ -42,7 +43,6 @@ define Device/cznic_turris-omnia
>    IMAGE/$$(IMAGE_PREFIX)-sysupgrade.img.gz := boot-scr | boot-img | sdcard-img | gzip | append-metadata
>    IMAGE/omnia-medkit-$$(IMAGE_PREFIX)-initramfs.tar.gz := omnia-medkit-initramfs | gzip
>    IMAGE_NAME = $$(2)
> -  SOC := armada-385
>    SUPPORTED_DEVICES += armada-385-turris-omnia
>    BOOT_SCRIPT := turris-omnia
>  endef
>
Klaus Kudielka Jan. 31, 2021, 8:49 a.m. UTC | #2
On 30.01.21 14:04, Petr Štetiar wrote:
> Currently it's not possible to boot the device with just initramfs image
> without additional effort as the initramfs image doesn't contain device tree.
> Fix it by producing FIT based image which could be booted with following
> commands:
>
>   setenv bootargs earlyprintk console=ttyS0,115200
>   tftpboot ${kernel_addr_r} openwrt-mvebu-cortexa9-cznic_turris-omnia-initramfs-kernel.bin
>   bootm ${kernel_addr_r}
>
> Cc: Karel Kočí <karel.koci@nic.cz>
> Cc: Tomasz Maciej Nowak <tmn505@gmail.com>
> Cc: Klaus Kudielka <klaus.kudielka@gmail.com>
> Signed-off-by: Petr Štetiar <ynezz@true.cz>

At first I was concerned that this image format change also propagates 
into the omnia-medkit.
(Which would likely have broken OpenWrt first-time installation on 
devices with U-Boot 2015.10-rc2).

With a test build I convinced myself that this is not the case.

Acked-by: Klaus Kudielka <klaus.kudielka@gmail.com>
> ---
>   target/linux/mvebu/image/cortexa9.mk | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/target/linux/mvebu/image/cortexa9.mk b/target/linux/mvebu/image/cortexa9.mk
> index ea20a25a2990..968e2a38f480 100644
> --- a/target/linux/mvebu/image/cortexa9.mk
> +++ b/target/linux/mvebu/image/cortexa9.mk
> @@ -32,8 +32,9 @@ define Device/cznic_turris-omnia
>     DEVICE_VENDOR := CZ.NIC
>     DEVICE_MODEL := Turris Omnia
>     KERNEL_INSTALL := 1
> +  SOC := armada-385
>     KERNEL := kernel-bin
> -  KERNEL_INITRAMFS := kernel-bin
> +  KERNEL_INITRAMFS := kernel-bin | gzip | fit gzip $$(KDIR)/image-$$(DEVICE_DTS).dtb
>     DEVICE_PACKAGES :=  \
>       mkf2fs e2fsprogs kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 \
>       wpad-basic-wolfssl kmod-ath9k kmod-ath10k-ct ath10k-firmware-qca988x-ct \
> @@ -42,7 +43,6 @@ define Device/cznic_turris-omnia
>     IMAGE/$$(IMAGE_PREFIX)-sysupgrade.img.gz := boot-scr | boot-img | sdcard-img | gzip | append-metadata
>     IMAGE/omnia-medkit-$$(IMAGE_PREFIX)-initramfs.tar.gz := omnia-medkit-initramfs | gzip
>     IMAGE_NAME = $$(2)
> -  SOC := armada-385
>     SUPPORTED_DEVICES += armada-385-turris-omnia
>     BOOT_SCRIPT := turris-omnia
>   endef
diff mbox series

Patch

diff --git a/target/linux/mvebu/image/cortexa9.mk b/target/linux/mvebu/image/cortexa9.mk
index ea20a25a2990..968e2a38f480 100644
--- a/target/linux/mvebu/image/cortexa9.mk
+++ b/target/linux/mvebu/image/cortexa9.mk
@@ -32,8 +32,9 @@  define Device/cznic_turris-omnia
   DEVICE_VENDOR := CZ.NIC
   DEVICE_MODEL := Turris Omnia
   KERNEL_INSTALL := 1
+  SOC := armada-385
   KERNEL := kernel-bin
-  KERNEL_INITRAMFS := kernel-bin
+  KERNEL_INITRAMFS := kernel-bin | gzip | fit gzip $$(KDIR)/image-$$(DEVICE_DTS).dtb
   DEVICE_PACKAGES :=  \
     mkf2fs e2fsprogs kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 \
     wpad-basic-wolfssl kmod-ath9k kmod-ath10k-ct ath10k-firmware-qca988x-ct \
@@ -42,7 +43,6 @@  define Device/cznic_turris-omnia
   IMAGE/$$(IMAGE_PREFIX)-sysupgrade.img.gz := boot-scr | boot-img | sdcard-img | gzip | append-metadata
   IMAGE/omnia-medkit-$$(IMAGE_PREFIX)-initramfs.tar.gz := omnia-medkit-initramfs | gzip
   IMAGE_NAME = $$(2)
-  SOC := armada-385
   SUPPORTED_DEVICES += armada-385-turris-omnia
   BOOT_SCRIPT := turris-omnia
 endef