diff options
author | David Woodhouse <dwmw2@infradead.org> | 2020-07-20 16:25:49 +0100 |
---|---|---|
committer | Chuanhong Guo <gch981213@gmail.com> | 2020-07-26 16:42:36 +0800 |
commit | 7a1eaa446b07ebf516a43db609ccbf169baadcae (patch) | |
tree | 227bf7dfd7dd021ff7046f8d8e70e4bff5f95159 /target/linux/mediatek | |
parent | ad295e0ee81b61b667f6e38418b02006aea7c5aa (diff) | |
download | upstream-7a1eaa446b07ebf516a43db609ccbf169baadcae.tar.gz upstream-7a1eaa446b07ebf516a43db609ccbf169baadcae.tar.bz2 upstream-7a1eaa446b07ebf516a43db609ccbf169baadcae.zip |
mediatek: mt7623: increase flexibility of finding recovery partition
I'm about to change the layout of the images for UniElec U7623 so make it
find the recovery partition based on which the root partition is too.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'target/linux/mediatek')
-rw-r--r-- | target/linux/mediatek/mt7623/base-files/lib/preinit/07_set_iface_mac | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/target/linux/mediatek/mt7623/base-files/lib/preinit/07_set_iface_mac b/target/linux/mediatek/mt7623/base-files/lib/preinit/07_set_iface_mac index 60b699d9c9..7b165df565 100644 --- a/target/linux/mediatek/mt7623/base-files/lib/preinit/07_set_iface_mac +++ b/target/linux/mediatek/mt7623/base-files/lib/preinit/07_set_iface_mac @@ -42,16 +42,22 @@ preinit_set_mac_address() { local rootpart case $(board_name) in - bananapi,bpi-r2) + bananapi,bpi-r2|\ + unielec,u7623-02-emmc-512m) rootpart=$(cat /proc/cmdline) rootpart="${rootpart##*root=}" - rootpart="${rootpart%%p3 *}" - if [ "$rootpart" = "/dev/mmcblk0" -o "$rootpart" = "/dev/mmcblk1" ]; then - set_recovery_mac_address ${rootpart}p2 - fi - ;; - unielec,u7623-02-emmc-512m) - set_recovery_mac_address /dev/mmcblk0p1 + rootpart="${rootpart%% *}" + case $rootpart in + /dev/mmcblk0p2) # Legacy U7623 image + set_recovery_mac_address /dev/mmcblk0p1 + ;; + /dev/mmcblk0p3) # U7623 or Banana Pi R2 eMMC + set_recovery_mac_address /dev/mmcblk0p2 + ;; + /dev/mmcblk1p3) # Banana Pi R2 SD + set_recovery_mac_address /dev/mmcblk1p2 + ;; + esac ;; esac } |