aboutsummaryrefslogtreecommitdiffstats
path: root/common/mentor-swupdate/recipes-core/initrdscripts/files/0001-init-install-efi-SWU-fallback-incase-WDT-fired-SWU-p.patch
blob: 33a458a0d3bc3befdc1760a14357ac7353b0d283 (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
From 2b8e67eb5899962528ab821754c76abd1bc4aef3 Mon Sep 17 00:00:00 2001
From: "Arsalan H. Awan" <Arsalan_Awan@mentor.com>
Date: Thu, 14 Feb 2019 14:31:03 +0500
Subject: [PATCH 1/3] init-install-efi/SWU: fallback incase WDT fired & SWU
 performed

Signed-off-by: Arsalan H. Awan <Arsalan_Awan@mentor.com>
---
 init-install-efi.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/init-install-efi.sh b/init-install-efi.sh
index ba0de76..e259785 100644
--- a/init-install-efi.sh
+++ b/init-install-efi.sh
@@ -320,6 +320,9 @@ save_env --file ${GRUBENV#\/boot} RFS
 $cmd
 }
 FALL_BACK
+    # Mentor - SWUpdate - set the default boot as per the WDT and SWU status
+    # If WDT fired && SWU performed, fallback to last working state, else normal boot
+    sed -i "/default=boot/a if ! amd-wdt getstatus; then\n  if test \$KERNEL != \$FB_KERNEL; then\n    set default='fallback'\n  fi\nfi\n" $GRUBCFG
 fi
 
 if [ -d /run/media/$1/loader ]; then
-- 
2.11.1