mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-26 08:51:13 +00:00
8126e572dd
In imx6, we currently use the model from DTS to derive a board name manually in /lib/imx6.sh. However, if we have individual DTS files anyway, we can exploit generic 02_sysinfo and use the compatible as board name directly. While at it, remove the wildcards from /lib/upgrade/platform.sh as these might make code shorter, but are quite unpleasant when grepping for a specific device. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
31 lines
574 B
Bash
31 lines
574 B
Bash
#
|
|
# Copyright (C) 2010-2013 OpenWrt.org
|
|
#
|
|
|
|
rootpartuuid() {
|
|
local cmdline=$(cat /proc/cmdline)
|
|
local bootpart=${cmdline##*root=}
|
|
bootpart=${bootpart%% *}
|
|
local uuid=${bootpart#PARTUUID=}
|
|
echo ${uuid%-02}
|
|
}
|
|
|
|
bootdev_from_uuid() {
|
|
blkid | grep "PTUUID=\"$(rootpartuuid)\"" | cut -d : -f1
|
|
}
|
|
|
|
bootpart_from_uuid() {
|
|
blkid | grep $(rootpartuuid)-01 | cut -d : -f1
|
|
}
|
|
|
|
rootpart_from_uuid() {
|
|
blkid | grep $(rootpartuuid)-02 | cut -d : -f1
|
|
}
|
|
|
|
apalis_mount_boot() {
|
|
mkdir -p /boot
|
|
[ -f /boot/uImage ] || {
|
|
mount -o rw,noatime $(bootpart_from_uuid) /boot > /dev/null
|
|
}
|
|
}
|