aboutsummaryrefslogtreecommitdiffstats
path: root/meta-agl-bsp/meta-boundary/recipes-bsp/u-boot/u-boot-script-boundary/0001-6x_bootscript-Make-bootscript-compatible-with-WIC-an.patch
blob: 1bf301ac63270198fcf0b16d9081ad0ab149525b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
From 785f028c550e50904ca4bc7f399a21e8b5f6910c Mon Sep 17 00:00:00 2001
From: Mihail Grigorov <michael.grigorov@konsulko.com>
Date: Mon, 23 Oct 2017 14:26:12 +0300
Subject: [PATCH] 6x_bootscript: Make bootscript compatible with WIC and SDCARD
 images

Get partition 2 UUID,
in case of error, points the boot directory to /boot
otherwise /

Signed-off-by: Mihail Grigorov <michael.grigorov@konsulko.com>
---
 .../boundary/nitrogen6x/6x_bootscript-yocto-3.14.txt  | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/board/boundary/nitrogen6x/6x_bootscript-yocto-3.14.txt b/board/boundary/nitrogen6x/6x_bootscript-yocto-3.14.txt
index f6bf2f5289..9b5946692d 100644
--- a/board/boundary/nitrogen6x/6x_bootscript-yocto-3.14.txt
+++ b/board/boundary/nitrogen6x/6x_bootscript-yocto-3.14.txt
@@ -48,6 +48,15 @@ if itest.s "x" == "x${dtbname}" ; then
 	fi
 fi
 
+setenv p2uuid 'x'
+part uuid ${dtype} ${disk}:2 p2uuid
+
+if itest.s ${p2uuid} == 'x'; then
+	bpart=1;
+else
+	bpart=2;
+fi
+
 if itest.s x${bootpart} == x ; then
 	bootpart=1
 fi
@@ -58,7 +67,11 @@ fi
 setenv bootargs ${bootargs} console=${console},115200 vmalloc=400M consoleblank=0 rootwait fixrtc cpu=${cpu} board=${board}
 
 if itest.s x == x${bootdir} ; then
-	bootdir=/
+	bootdir=/;
+fi
+
+if itest.s ${bpart} == '1'; then
+	bootdir=/boot/;
 fi
 
 if load ${dtype} ${disk}:${bootpart} ${a_fdt} ${bootdir}${dtbname} ; then
@@ -116,8 +129,6 @@ if itest.s "x" == "x${cmd_xxx_present}" ; then
 	echo "!!!!!!!!!!!!!!!!"
 fi
 
-bpart=2
-
 if test "sata" = "${dtype}" ; then
 	setenv bootargs "${bootargs} root=/dev/sda${bpart}" ;
 elif test "usb" = "${dtype}" ; then
@@ -167,7 +178,7 @@ if itest.s "x" != "x${show_env}" ; then
 	printenv
 fi
 
-if load ${dtype} ${disk}:${bootpart} ${a_zImage} /zImage ; then
+if load ${dtype} ${disk}:${bootpart} ${a_zImage} ${bootdir}/zImage ; then
 	bootz ${a_zImage} - ${a_fdt}
 fi
 echo "Error loading kernel image"
-- 
2.11.0