[openwrt/openwrt] ipq807x: image: fix eMMC flashing/recovery from within initramfs

LEDE Commits lede-commits at lists.infradead.org
Tue Jun 13 07:49:59 PDT 2023


ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-23.05:
https://git.openwrt.org/1e7fa539ae6e94bfdb5d9e503f0c103e15b408a1

commit 1e7fa539ae6e94bfdb5d9e503f0c103e15b408a1
Author: Petr Štetiar <ynezz at true.cz>
AuthorDate: Mon Jun 5 14:10:44 2023 +0200

    ipq807x: image: fix eMMC flashing/recovery from within initramfs
    
    Having initramfs image built with same config as on buildbots:
    
     CONFIG_TARGET_MULTI_PROFILE=y
     CONFIG_TARGET_ALL_PROFILES=y
     CONFIG_TARGET_PER_DEVICE_ROOTFS=y
    
    Its currently impossible to flash/recover the device using that image as
    losetup is missing:
    
     root at OpenWrt:/# sysupgrade -v /tmp/openwrt-ipq807x-generic-prpl_haze-squashfs-sysupgrade.bin
     ...
     /lib/upgrade/do_stage2: line 38: losetup: not found
     Failed to detach all loop devices. Skip this try.
    
    So lets fix it by including the needed utils for sysupgrade in
    DEFAULT_PACKAGES set.
    
    Signed-off-by: Petr Štetiar <ynezz at true.cz>
    (cherry picked from commit 07fe8bc62a866e78e131c3f63a08554a94e931f8)
---
 target/linux/ipq807x/Makefile         | 3 ++-
 target/linux/ipq807x/image/generic.mk | 1 -
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/ipq807x/Makefile b/target/linux/ipq807x/Makefile
index fdabf575d3..f423acd76c 100644
--- a/target/linux/ipq807x/Makefile
+++ b/target/linux/ipq807x/Makefile
@@ -16,6 +16,7 @@ DEFAULT_PACKAGES += \
 	kmod-leds-gpio kmod-gpio-button-hotplug \
 	kmod-phy-aquantia kmod-qca-nss-dp \
 	ath11k-firmware-ipq8074 kmod-ath11k-ahb \
-	wpad-basic-mbedtls uboot-envtools
+	wpad-basic-mbedtls uboot-envtools \
+	e2fsprogs kmod-fs-ext4 losetup
 
 $(eval $(call BuildTarget))
diff --git a/target/linux/ipq807x/image/generic.mk b/target/linux/ipq807x/image/generic.mk
index 6eca67d11c..124cdfc3b2 100644
--- a/target/linux/ipq807x/image/generic.mk
+++ b/target/linux/ipq807x/image/generic.mk
@@ -14,7 +14,6 @@ define Device/EmmcImage
 	IMAGES += factory.bin sysupgrade.bin
 	IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 64k
 	IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to 64k | sysupgrade-tar rootfs=$$$$@ | append-metadata
-	DEVICE_PACKAGES := e2fsprogs kmod-fs-ext4 losetup
 endef
 
 define Device/UbiFit




More information about the lede-commits mailing list