aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/imx/cortexa9/base-files/lib/imx.sh
diff options
context:
space:
mode:
authorPiotr Dymacz <pepe2k@gmail.com>2021-03-29 00:33:20 +0200
committerPiotr Dymacz <pepe2k@gmail.com>2021-11-03 12:45:40 +0100
commitd2fb495a9d2ae2d3e09675ffdc4e4b9a1ded9b23 (patch)
treeabeb3ff4a7c18fb764590882030b994c0fdeffc7 /target/linux/imx/cortexa9/base-files/lib/imx.sh
parent53cdf9bf330bbffb0d41ec0fe9635c1a25ccf008 (diff)
downloadupstream-d2fb495a9d2ae2d3e09675ffdc4e4b9a1ded9b23.tar.gz
upstream-d2fb495a9d2ae2d3e09675ffdc4e4b9a1ded9b23.tar.bz2
upstream-d2fb495a9d2ae2d3e09675ffdc4e4b9a1ded9b23.zip
imx: split into arch-specific subtargets
Modern NXP i.MX series includes several different families, based on single- or multi-core Arm Cortex-A CPUs. To be able to support more families within a single target, we split the 'imx' in arch-specific subtargets, starting with 'cortexa9' for the Cortex-A9 based i.MX 6, already supported by the original 'imx6' target. Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
Diffstat (limited to 'target/linux/imx/cortexa9/base-files/lib/imx.sh')
-rw-r--r--target/linux/imx/cortexa9/base-files/lib/imx.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/target/linux/imx/cortexa9/base-files/lib/imx.sh b/target/linux/imx/cortexa9/base-files/lib/imx.sh
new file mode 100644
index 0000000000..46d2eeb006
--- /dev/null
+++ b/target/linux/imx/cortexa9/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
+ }
+}