aboutsummaryrefslogtreecommitdiffstats
path: root/common/mentor-swupdate/recipes-core/initrdscripts
diff options
context:
space:
mode:
Diffstat (limited to 'common/mentor-swupdate/recipes-core/initrdscripts')
-rw-r--r--common/mentor-swupdate/recipes-core/initrdscripts/files/0001-init-install-efi-SWU-fallback-incase-WDT-fired-SWU-p.patch28
-rw-r--r--common/mentor-swupdate/recipes-core/initrdscripts/files/0002-init-install-efi-SWU-add-setup-WDT-routine-to-enable.patch39
-rw-r--r--common/mentor-swupdate/recipes-core/initrdscripts/files/0003-init-install-efi-SWU-start-the-WDT-as-soon-as-a-menu.patch27
-rw-r--r--common/mentor-swupdate/recipes-core/initrdscripts/initramfs-module-install-efi_1.0.bbappend5
4 files changed, 98 insertions, 1 deletions
diff --git a/common/mentor-swupdate/recipes-core/initrdscripts/files/0001-init-install-efi-SWU-fallback-incase-WDT-fired-SWU-p.patch b/common/mentor-swupdate/recipes-core/initrdscripts/files/0001-init-install-efi-SWU-fallback-incase-WDT-fired-SWU-p.patch
new file mode 100644
index 00000000..33a458a0
--- /dev/null
+++ b/common/mentor-swupdate/recipes-core/initrdscripts/files/0001-init-install-efi-SWU-fallback-incase-WDT-fired-SWU-p.patch
@@ -0,0 +1,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
+
diff --git a/common/mentor-swupdate/recipes-core/initrdscripts/files/0002-init-install-efi-SWU-add-setup-WDT-routine-to-enable.patch b/common/mentor-swupdate/recipes-core/initrdscripts/files/0002-init-install-efi-SWU-add-setup-WDT-routine-to-enable.patch
new file mode 100644
index 00000000..22d4a626
--- /dev/null
+++ b/common/mentor-swupdate/recipes-core/initrdscripts/files/0002-init-install-efi-SWU-add-setup-WDT-routine-to-enable.patch
@@ -0,0 +1,39 @@
+From 34fb95494f01cd0adbcfae5d113f669336d8cf0c Mon Sep 17 00:00:00 2001
+From: "Arsalan H. Awan" <Arsalan_Awan@mentor.com>
+Date: Fri, 8 Mar 2019 12:05:56 +0500
+Subject: [PATCH 2/3] init-install-efi/SWU: add setup WDT routine to enable if
+ mel_wdt is 1
+
+> set WDT timeout to 60s by default to reboot in case system hangs.
+> start WDT ONLY IF mel_wdt is set to 1.
+>> this allows user to disable the WDT in case the user is doing
+ kernel debugging or so and wants the system to keep running.
+> enable WDT (set mel_wdt=1) by default
+
+Signed-off-by: Arsalan H. Awan <Arsalan_Awan@mentor.com>
+---
+ init-install-efi.sh | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/init-install-efi.sh b/init-install-efi.sh
+index e259785..270b254 100644
+--- a/init-install-efi.sh
++++ b/init-install-efi.sh
+@@ -323,6 +323,14 @@ 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
++ # Mentor - SWUpdate - setup routine for WDT
++ sed -i "/menuentry.*boot/i function setup_wdt {\n}\n" $GRUBCFG
++ # > If mel_wdt is set to 1, ONLY THEN start the WDT
++ sed -i "/function setup_wdt/a if test \$mel_wdt -eq 1; then amd-wdt start; fi" $GRUBCFG
++ # > set WDT timeout value to 60s by default
++ sed -i "/function setup_wdt/a amd-wdt settime 60" $GRUBCFG
++ # Mentor - SWUpdate - enable WDT by default
++ sed -i "/menuentry.*boot/i set mel_wdt=1\n" $GRUBCFG
+ fi
+
+ if [ -d /run/media/$1/loader ]; then
+--
+2.11.1
+
diff --git a/common/mentor-swupdate/recipes-core/initrdscripts/files/0003-init-install-efi-SWU-start-the-WDT-as-soon-as-a-menu.patch b/common/mentor-swupdate/recipes-core/initrdscripts/files/0003-init-install-efi-SWU-start-the-WDT-as-soon-as-a-menu.patch
new file mode 100644
index 00000000..cbec24aa
--- /dev/null
+++ b/common/mentor-swupdate/recipes-core/initrdscripts/files/0003-init-install-efi-SWU-start-the-WDT-as-soon-as-a-menu.patch
@@ -0,0 +1,27 @@
+From 64dd7084103bddf314365271981bf535e863e647 Mon Sep 17 00:00:00 2001
+From: "Arsalan H. Awan" <Arsalan_Awan@mentor.com>
+Date: Fri, 8 Mar 2019 12:15:56 +0500
+Subject: [PATCH 3/3] init-install-efi/SWU: start the WDT as soon as a
+ menuentry is selected
+
+Signed-off-by: Arsalan H. Awan <Arsalan_Awan@mentor.com>
+---
+ init-install-efi.sh | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/init-install-efi.sh b/init-install-efi.sh
+index 270b254..502b0ce 100644
+--- a/init-install-efi.sh
++++ b/init-install-efi.sh
+@@ -331,6 +331,8 @@ FALL_BACK
+ sed -i "/function setup_wdt/a amd-wdt settime 60" $GRUBCFG
+ # Mentor - SWUpdate - enable WDT by default
+ sed -i "/menuentry.*boot/i set mel_wdt=1\n" $GRUBCFG
++ # Mentor - SWUpdate - start the WDT as soon as a menuentry is selected
++ sed -i "/menuentry/a setup_wdt" $GRUBCFG
+ fi
+
+ if [ -d /run/media/$1/loader ]; then
+--
+2.11.1
+
diff --git a/common/mentor-swupdate/recipes-core/initrdscripts/initramfs-module-install-efi_1.0.bbappend b/common/mentor-swupdate/recipes-core/initrdscripts/initramfs-module-install-efi_1.0.bbappend
index 86ad4e1e..60972845 100644
--- a/common/mentor-swupdate/recipes-core/initrdscripts/initramfs-module-install-efi_1.0.bbappend
+++ b/common/mentor-swupdate/recipes-core/initrdscripts/initramfs-module-install-efi_1.0.bbappend
@@ -5,4 +5,7 @@ SRC_URI += "file://0001-init-install-efi-manage-partitioning-scheme-as-per-M.pat
file://0004-init-install-efi-pick-kernel-and-rootfs-from-grub.en.patch \
file://0005-init-install-efi-create-fallback-entry.patch \
file://0006-init-install-efi-don-t-unnecessarily-set-the-rootfs-.patch \
- file://0007-init-install-efi-grub-don-t-set-a-timeout.patch"
+ file://0007-init-install-efi-grub-don-t-set-a-timeout.patch \
+ file://0001-init-install-efi-SWU-fallback-incase-WDT-fired-SWU-p.patch \
+ file://0002-init-install-efi-SWU-add-setup-WDT-routine-to-enable.patch \
+ file://0003-init-install-efi-SWU-start-the-WDT-as-soon-as-a-menu.patch"