Skip to content
Snippets Groups Projects
Commit 788ca8e4 authored by Mikhail Kshevetskiy's avatar Mikhail Kshevetskiy
Browse files

airoha: pass bootloader device to iopsys_do_upgrade in eMMC case

parent cf58c44a
No related branches found
No related tags found
1 merge request!1239airoha: eMMC support fixes
......@@ -9,7 +9,28 @@ platform_do_upgrade() {
return 1
fi
iopsys_do_upgrade "$1" || return
local boot_dev=""
case "$(get_root_device_type)" in
emmc)
# search for device-mapper devices with specified name
local dir
local name='u-boot'
for dir in /sys/block/dm-*; do
grep -qFx "${name}" "${dir}/dm/name" 2>/dev/null || continue;
boot_dev=$(grep '^DEVNAME=' "${dir}/uevent" | sed 's|^DEVNAME=|/dev/|')
break
done
if [ -z "${boot_dev}" ]; then
log sysupgrade "ERROR: unable to determine boot device."
return 1
fi
;;
*)
;;
esac
iopsys_do_upgrade "$1" "${boot_dev}" || return
}
# Tell the bootloader to boot from flash "bank" $1 next time.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment