Improve Xu4 u-boot update logic

This commit is contained in:
zador-blood-stained 2017-08-31 16:57:04 +03:00
parent 24bdb91374
commit 667422519c

View file

@ -39,6 +39,19 @@ GOVERNOR=ondemand
SERIALCON=ttySAC2
setup_write_uboot_platform()
{
# this will update u-boot on the device rootfs is located on
# in case it's a mmc device, otherwise DEVICE will not be changed
# and will default to /dev/mmcblk0
local tmp=$(cat /proc/cmdline)
tmp="${tmp##*root=}"
tmp="${tmp%% *}"
[[ -n $tmp ]] && local part=$(findfs $tmp 2>/dev/null)
[[ -n $part ]] && local dev=$(lsblk -n -o PKNAME $part 2>/dev/null)
[[ -n $dev && $dev == mmcblk* ]] && DEVICE="/dev/${dev}"
}
write_uboot_platform()
{
# handle writing to eMMC on package upgrades