Browse Source

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 <[email protected]>
Yangbo Lu 5 years ago
parent
commit
3a99b624d8
1 changed files with 13 additions and 0 deletions
  1. 13 0
      target/linux/layerscape/base-files/lib/preinit/02_sysinfo_fixup

+ 13 - 0
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