aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYangbo Lu <yangbo.lu@nxp.com>2020-05-28 13:50:42 +0800
committerPetr Štetiar <ynezz@true.cz>2020-07-11 14:44:22 +0200
commit3a99b624d87b32a95210ae58bd782a144ba12fc2 (patch)
tree1f3cc03655210f7991fe0ba070f21114b61d1e18
parent3a3b9ded50d25444b9acae6e0a2099db93232c11 (diff)
downloadupstream-3a99b624d87b32a95210ae58bd782a144ba12fc2.tar.gz
upstream-3a99b624d87b32a95210ae58bd782a144ba12fc2.tar.bz2
upstream-3a99b624d87b32a95210ae58bd782a144ba12fc2.zip
layerscape: fix board name for SD card boot
Many Layerscape boards support both flash boot and SD card boot. And different firmware and sysupgrade.bin are built for the two boot methods. To identify them, a fix could be done on board name by adding a postfix "-sdboot" for SD card boot. Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
-rw-r--r--target/linux/layerscape/base-files/lib/preinit/02_sysinfo_fixup13
1 files changed, 13 insertions, 0 deletions
diff --git a/target/linux/layerscape/base-files/lib/preinit/02_sysinfo_fixup b/target/linux/layerscape/base-files/lib/preinit/02_sysinfo_fixup
new file mode 100644
index 0000000000..1bbd8efbc6
--- /dev/null
+++ b/target/linux/layerscape/base-files/lib/preinit/02_sysinfo_fixup
@@ -0,0 +1,13 @@
+do_sysinfo_layerscape_fixup() {
+ [ -e /tmp/sysinfo/board_name ] || return
+ [ -e /proc/cmdline ] || return
+ cmdline=$(strings /proc/cmdline)
+ case "${cmdline}" in
+ *root=/dev/mmcblk*)
+ board="$(strings /tmp/sysinfo/board_name)-sdboot"
+ echo ${board} > /tmp/sysinfo/board_name
+ ;;
+ esac
+}
+
+boot_hook_add preinit_main do_sysinfo_layerscape_fixup