From b2098010d246ac79850fdc9475a9c0b02e7d4f8d Mon Sep 17 00:00:00 2001 From: Lars Randers Date: Wed, 30 Jul 2025 21:19:33 +0000 Subject: [PATCH] u-boot: add recovery option - Use "run recovery" to execute Signed-off-by: Lars Randers --- 03_build_u-boot.sh | 1 + 06_generate_debian_console_root.sh | 1 + 06_generate_ubuntu_console_root.sh | 1 + deploy/genimage.cfg | 1 + deploy/recovery.scr | Bin 0 -> 601 bytes ...gle-beaglev_fire-add-recovery-option.patch | 37 ++++++++++++++++++ 6 files changed, 41 insertions(+) create mode 100644 deploy/recovery.scr create mode 100644 patches/u-boot/0003-board-beagle-beaglev_fire-add-recovery-option.patch diff --git a/03_build_u-boot.sh b/03_build_u-boot.sh index cdc81da..f86c998 100755 --- a/03_build_u-boot.sh +++ b/03_build_u-boot.sh @@ -10,6 +10,7 @@ if [ ! -f ./.patched ] ; then if [ -f configs/beaglev_fire_defconfig ] ; then git am ../patches/u-boot/0001-drivers-mailbox-mpfs-mbox-add-missing-include.patch git am ../patches/u-boot/0002-board-beagle-beaglev_fire-fix-compilation-warning.patch + git am ../patches/u-boot/0003-board-beagle-beaglev_fire-add-recovery-option.patch fi touch .patched fi diff --git a/06_generate_debian_console_root.sh b/06_generate_debian_console_root.sh index e42ca95..1233f81 100755 --- a/06_generate_debian_console_root.sh +++ b/06_generate_debian_console_root.sh @@ -50,6 +50,7 @@ tar xfp ./deploy/${distro}-${version}-console-riscv64-${datestamp}/riscv64-rootf sync mkdir -p ./deploy/input/ || true +cp -v ./deploy/recovery.scr deploy/input/ cp -v ./deploy/boot.scr deploy/input/ cp -v ./deploy/sysconf.txt deploy/input/ diff --git a/06_generate_ubuntu_console_root.sh b/06_generate_ubuntu_console_root.sh index 463bda6..25449e4 100755 --- a/06_generate_ubuntu_console_root.sh +++ b/06_generate_ubuntu_console_root.sh @@ -50,6 +50,7 @@ tar xfp ./deploy/${distro}-${version}-console-riscv64-${datestamp}/riscv64-rootf sync mkdir -p ./deploy/input/ || true +cp -v ./deploy/recovery.scr deploy/input/ cp -v ./deploy/boot.scr deploy/input/ cp -v ./deploy/sysconf.txt deploy/input/ diff --git a/deploy/genimage.cfg b/deploy/genimage.cfg index e223489..66341b3 100644 --- a/deploy/genimage.cfg +++ b/deploy/genimage.cfg @@ -4,6 +4,7 @@ image boot.vfat { vfat { files = { "beaglev_fire.itb", + "recovery.scr", "boot.scr", "sysconf.txt" } diff --git a/deploy/recovery.scr b/deploy/recovery.scr new file mode 100644 index 0000000000000000000000000000000000000000..4dd13d3e96ce92d8c4443720b91ce3601f1daf24 GIT binary patch literal 601 zcmaiwu};G<5QeKtFnD7^Wx6Vr5Cb&rNERem7&?JiBPYHjN9{PW-H58{3-APp7vNEN z6&?c{C90@IxyAC`_v`-q&yPk=7jGZ3dVT&H42GjYSEuiv^62ci{~maUCt(Jh5R8Sy8@q~-#Y$|1g$Y-3)mtu}upycttKt zSRfTx=i%RMv_w;*OvR20oAh1+$?o7EBODA@-o+BA0N!$vJd+4iTM|BlE{tw%hxRTS zgH6JGBq2+fTAfePRl$b4na8u)JdR^fJiiRtqYX|dr(9y{n`vmq+e3OU|3^Rb`UuRb U27#8!I@K*2$=9~GSn7m*1G9g@;s5{u literal 0 HcmV?d00001 diff --git a/patches/u-boot/0003-board-beagle-beaglev_fire-add-recovery-option.patch b/patches/u-boot/0003-board-beagle-beaglev_fire-add-recovery-option.patch new file mode 100644 index 0000000..30473ef --- /dev/null +++ b/patches/u-boot/0003-board-beagle-beaglev_fire-add-recovery-option.patch @@ -0,0 +1,37 @@ +From da52a15fc720b91b39c126a2753192dddd075b17 Mon Sep 17 00:00:00 2001 +From: Lars Randers +Date: Wed, 30 Jul 2025 20:10:28 +0000 +Subject: [PATCH] board: beagle: beaglev_fire: add recovery option + +Signed-off-by: Lars Randers +--- + include/configs/beaglev_fire.h | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/include/configs/beaglev_fire.h b/include/configs/beaglev_fire.h +index e3ee0f02..b9ab650a 100644 +--- a/include/configs/beaglev_fire.h ++++ b/include/configs/beaglev_fire.h +@@ -42,6 +42,11 @@ + "done; " \ + "fi;\0 " \ + ++#define BOOTENV_RECOVERY \ ++ "recovery=" \ ++ "setenv boot_scripts recovery.scr; " \ ++ "boot;\0" ++ + #include + + #define CFG_EXTRA_ENV_SETTINGS \ +@@ -52,6 +57,7 @@ + "ramdisk_addr_r=0x8aa00000\0" \ + "scriptaddr=0x8e000000\0" \ + BOOTENV_DESIGN_OVERLAYS \ ++ BOOTENV_RECOVERY \ + BOOTENV \ + + #endif /* __CONFIG_H */ +-- +2.39.2 +