diff options
author | Piotr Dymacz <pepe2k@gmail.com> | 2021-03-28 16:56:18 +0200 |
---|---|---|
committer | Piotr Dymacz <pepe2k@gmail.com> | 2021-11-03 12:45:40 +0100 |
commit | d1c66eacabe11f8088f2d49e94b80dfa8a0f94f7 (patch) | |
tree | 64d43ea3b3eaa8c8780206ee78e4e0b9ea482d56 /target/linux/imx/base-files/lib/imx.sh | |
parent | 7abde5037d572cb28cc8ae41b39c76323eebc4a6 (diff) |
imx6: rename target to 'imx'
This is first step in migrating to a generic i.MX target which in the
next steps will also get divided into arch-specific subtargets.
In the result, this will make it possible to support, within a single
target, also other modern NXP i.MX families, like the i.MX 7, i.MX 8
or recently introduced i.MX 9.
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
Diffstat (limited to 'target/linux/imx/base-files/lib/imx.sh')
-rw-r--r-- | target/linux/imx/base-files/lib/imx.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/target/linux/imx/base-files/lib/imx.sh b/target/linux/imx/base-files/lib/imx.sh new file mode 100644 index 0000000000..46d2eeb006 --- /dev/null +++ b/target/linux/imx/base-files/lib/imx.sh @@ -0,0 +1,30 @@ +# +# 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 + } +} |