[OpenWrt-Devel] [PATCH] ath79: image: fix initramfs for safeloader devices

mail at adrianschmutzler.de mail at adrianschmutzler.de
Fri Jun 19 05:36:44 EDT 2020


Hi Petr,

> -----Original Message-----
> From: openwrt-devel [mailto:openwrt-devel-bounces at lists.openwrt.org]
> On Behalf Of Petr Štetiar
> Sent: Freitag, 19. Juni 2020 11:32
> To: openwrt-devel at lists.openwrt.org
> Cc: Petr Štetiar <ynezz at true.cz>
> Subject: [OpenWrt-Devel] [PATCH] ath79: image: fix initramfs for safeloader
> devices
> 
> Currently it's not possible to tftpboot initramfs image on archer-c7-v5 as the
> image contains tplink-v1-header which leads to:
> 
>  ath> bootm
>  ## Booting image at 81000000 ...
>  Bad Magic Number
> 
> as U-Boot expect uImage wrapped image. This is caused by following
> inheritance issue:
> 
>   define Device/Init
>     KERNEL_INITRAMFS = $$(KERNEL)
> 
>   define Device/tplink-v1
>     KERNEL := kernel-bin | append-dtb | lzma
>     KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | tplink-v1-header
> 
>   define Device/tplink-safeloader
>     $(Device/tplink-v1)
> 
>   define Device/tplink-safeloader-uimage
>     $(Device/tplink-safeloader)
>     KERNEL := kernel-bin | append-dtb | lzma | uImageArcher lzma
> 
>   define Device/tplink_archer-c7-v5
>     $(Device/tplink-safeloader-uimage)
> 
> where tplink-v1 defines KERNEL_INITRAMFS with tplink-v1-header and it's
> then used by all devices inheriting from tplink-safeloader. Fix this by
> overriding KERNEL_INITRAMFS to KERNEL variable again.

So, I wonder whether that's specific to the C7 v5 then or whether it would apply to the other tplink-safeloader-uimage devices as well?

Best

Adrian

> 
> Signed-off-by: Petr Štetiar <ynezz at true.cz>
> ---
>  target/linux/ath79/image/common-tp-link.mk | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/target/linux/ath79/image/common-tp-link.mk
> b/target/linux/ath79/image/common-tp-link.mk
> index 328eaaed3056..81a557df4871 100644
> --- a/target/linux/ath79/image/common-tp-link.mk
> +++ b/target/linux/ath79/image/common-tp-link.mk
> @@ -78,6 +78,7 @@ define Device/tplink-safeloader
>    $(Device/tplink-v1)
>    TPLINK_HWREV := 0x0
>    KERNEL := kernel-bin | append-dtb | lzma | tplink-v1-header -O
> +  KERNEL_INITRAMFS := $$(KERNEL)
>    IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade | \
>  	append-metadata | check-size
>    IMAGE/factory.bin := append-rootfs | tplink-safeloader factory @@ -86,6
> +87,7 @@ endef  define Device/tplink-safeloader-uimage
>    $(Device/tplink-safeloader)
>    KERNEL := kernel-bin | append-dtb | lzma | uImageArcher lzma
> +  KERNEL_INITRAMFS := $$(KERNEL)
>  endef
> 
>  define Device/tplink-safeloader-okli
> @@ -96,4 +98,5 @@ define Device/tplink-safeloader-okli
>    COMPILE/loader-$(1).elf := loader-okli-compile
>    KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 | \
>  	loader-okli $(1) 12288
> +  KERNEL_INITRAMFS := $$(KERNEL)
>  endef
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openpgp-digital-signature.asc
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20200619/289b4bd8/attachment.sig>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list