From d1c66eacabe11f8088f2d49e94b80dfa8a0f94f7 Mon Sep 17 00:00:00 2001 From: Piotr Dymacz Date: Sun, 28 Mar 2021 16:56:18 +0200 Subject: 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 --- target/linux/imx/base-files/lib/imx.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 target/linux/imx/base-files/lib/imx.sh (limited to 'target/linux/imx/base-files/lib/imx.sh') 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 + } +} -- cgit v1.2.3