summaryrefslogtreecommitdiffstats
path: root/recipes-sota/ota-u-boot-script/files
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-sota/ota-u-boot-script/files')
-rw-r--r--recipes-sota/ota-u-boot-script/files/uEnv-fileenv.txt1
-rw-r--r--recipes-sota/ota-u-boot-script/files/uEnv-fit.txt1
-rw-r--r--recipes-sota/ota-u-boot-script/files/uEnv-rollback.txt8
-rw-r--r--recipes-sota/ota-u-boot-script/files/uEnv.txt33
4 files changed, 43 insertions, 0 deletions
diff --git a/recipes-sota/ota-u-boot-script/files/uEnv-fileenv.txt b/recipes-sota/ota-u-boot-script/files/uEnv-fileenv.txt
new file mode 100644
index 0000000..3646416
--- /dev/null
+++ b/recipes-sota/ota-u-boot-script/files/uEnv-fileenv.txt
@@ -0,0 +1 @@
bootcmd_create_envfile=if test ! -e ${updater_boot_part} uboot.env; then saveenv; fi;
diff --git a/recipes-sota/ota-u-boot-script/files/uEnv-fit.txt b/recipes-sota/ota-u-boot-script/files/uEnv-fit.txt
new file mode 100644
index 0000000..64e34b0
--- /dev/null
+++ b/recipes-sota/ota-u-boot-script/files/uEnv-fit.txt
@@ -0,0 +1 @@
bootcmd_fitconf=run bootcmd_getroot; if test -e ${sota_main_part} "${ostree_root}/usr/lib/fit_conf"; then load ${sota_main_part} $loadaddr "${ostree_root}/usr/lib/fit_conf"; env import -t $loadaddr $filesize; fi; setenv sota_kernel_addr ${sota_kernel_addr}${fit_conf}
diff --git a/recipes-sota/ota-u-boot-script/files/uEnv-rollback.txt b/recipes-sota/ota-u-boot-script/files/uEnv-rollback.txt
new file mode 100644
index 0000000..07b6b22
--- /dev/null
+++ b/recipes-sota/ota-u-boot-script/files/uEnv-rollback.txt
@@ -0,0 +1,8 @@
1bootcmd_rollbackenv=setenv kernel_image ${kernel_image2}; setenv ramdisk_image ${ramdisk_image2}; setenv fdt_file ${fdt_file2}; setenv bootargs ${bootargs2}
2
3bootlimit=3
4
5bootcmd_set_rollback=if test ! "${rollback}" = "1"; then setenv rollback 1; setenv upgrade_available 0; saveenv; fi
6altbootcmd=run bootcmd_create_envfile; run bootcmd_otenv; run bootcmd_set_rollback; if test -n "${kernel_image2}"; then run bootcmd_rollbackenv; fi; run bootcmd_args; run bootcmd_fitconf; run bootcmd_load; run bootcmd_run; reset
7
8
diff --git a/recipes-sota/ota-u-boot-script/files/uEnv.txt b/recipes-sota/ota-u-boot-script/files/uEnv.txt
new file mode 100644
index 0000000..0cd97b7
--- /dev/null
+++ b/recipes-sota/ota-u-boot-script/files/uEnv.txt
@@ -0,0 +1,33 @@
1bootcmd_fitconf=
2bootcmd_create_envfile=
3
4sota_bootcommand=bootm
5sota_kernel_addr=${ramdisk_addr_r}
6sota_ramdisk_addr=-
7sota_fdt_addr=-
8sota_boot_part=mmc 0:1
9sota_main_part=mmc 0:2
10sota_root_device=/dev/mmcblk0p2
11
12%%INITFINISHED%%
13
14bootcmd_resetvars=setenv kernel_image; setenv bootargs; setenv kernel_image2; setenv bootargs2
15bootcmd_otenv=run bootcmd_resetvars; load ${updater_main_part} $loadaddr /boot/loader/uEnv.txt; env import -t $loadaddr $filesize
16
17bootcmd_args=setenv bootargs "$bootargs $bootargs_fdt ostree_root=${updater_root_device} root=/dev/ram0 rw rootwait rootdelay=2 ramdisk_size=8192 panic=1 %%SOTA_EXTRA_BOOTCMD%%"
18
19bootcmd_getroot=setexpr ostree_root gsub "^.*ostree=([^ ]*).*$" "\\\\1" "${bootargs}";
20
21bootcmd_load_kernel=load ${updater_main_part} ${sota_kernel_addr} "/boot"$kernel_image
22
23bootcmd_load_ramdisk=if ! "${sota_ramdisk_addr}" = "-"; then load ${updater_main_part} ${sota_ramdisk_addr} "/boot"$ramdisk_image; fi
24
25bootcmd_load_fdt=if ! "${sota_fdt_addr}" = "-"; then load ${updater_main_part} ${sota_fdt_addr} "/boot"$fdt_file; fi
26
27bootcmd_load=run bootcmd_load_kernel; run bootcmd_load_ramdisk; run bootcmd_load_fdt;
28
29bootcmd_run=${sota_bootcommand} ${sota_kernel_addr} ${sota_ramdisk_addr} ${sota_fdt_addr}
30
31bootcmd=if test "${rollback}" = "1"; then run altbootcmd; else run bootcmd_create_envfile; run bootcmd_otenv; run bootcmd_args; run bootcmd_fitconf; run bootcmd_load; run bootcmd_run; if ! "${upgrade_available}" = "1"; then setenv upgrade_available 1; saveenv; fi; reset; fi
32
33