summaryrefslogtreecommitdiffstats
path: root/target/linux/mediatek/mt7622
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2024-02-25 21:12:10 +0000
committerDaniel Golle <daniel@makrotopia.org>2024-02-26 01:29:22 +0000
commiteab44ec7ea042a4d1adf5e2bf76736fb4df69063 (patch)
treeee5be754abee0b13ef2f12ae119dd8de623203b6 /target/linux/mediatek/mt7622
parentfc865eb3ae0369a966490ec5e8a3991d4553eb40 (diff)
downloadopenwrt-eab44ec7ea042a4d1adf5e2bf76736fb4df69063.tar.gz
openwrt-eab44ec7ea042a4d1adf5e2bf76736fb4df69063.tar.bz2
openwrt-eab44ec7ea042a4d1adf5e2bf76736fb4df69063.zip
mediatek: drop platform_get_bootdev
Now that we got fitblk_get_bootdev in /lib/upgrade/common.sh we don't need platform_get_bootdev in each of the subtargets any longer. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'target/linux/mediatek/mt7622')
-rwxr-xr-xtarget/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh19
1 files changed, 2 insertions, 17 deletions
diff --git a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh
index f5d938e65e..236e8fdfb0 100755
--- a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh
+++ b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh
@@ -1,21 +1,6 @@
REQUIRE_IMAGE_METADATA=1
RAMFS_COPY_BIN='fitblk'
-platform_get_bootdev() {
- local rootdisk="$(cat /sys/firmware/devicetree/base/chosen/rootdisk)"
- local handle bootdev
- for handle in /sys/class/block/*/of_node/phandle /sys/class/block/*/device/of_node/phandle; do
- [ ! -e "$handle" ] && continue
- if [ "$rootdisk" = "$(cat $handle)" ]; then
- bootdev="${handle%/of_node/phandle}"
- bootdev="${bootdev%/device}"
- bootdev="${bootdev#/sys/class/block/}"
- echo "$bootdev"
- break
- fi
- done
-}
-
platform_do_upgrade() {
local board=$(board_name)
local file_type=$(identify $1)
@@ -28,7 +13,7 @@ platform_do_upgrade() {
ubnt,unifi-6-lr-v3-ubootmod)
[ -e /dev/fit0 ] && fitblk /dev/fit0
[ -e /dev/fitrw ] && fitblk /dev/fitrw
- bootdev="$(platform_get_bootdev)"
+ bootdev="$(fitblk_get_bootdev)"
case "$bootdev" in
mmcblk*)
EMMC_KERN_DEV="/dev/$bootdev"
@@ -119,7 +104,7 @@ platform_check_image() {
platform_copy_config() {
case "$(board_name)" in
bananapi,bpi-r64)
- if platform_get_bootdev | grep -q mmc; then
+ if fitblk_get_bootdev | grep -q mmc; then
emmc_copy_config
fi
;;