diff options
Diffstat (limited to 'recipes-sota/ota-u-boot-script/files')
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 @@ | |||
1 | bootcmd_rollbackenv=setenv kernel_image ${kernel_image2}; setenv ramdisk_image ${ramdisk_image2}; setenv fdt_file ${fdt_file2}; setenv bootargs ${bootargs2} | ||
2 | |||
3 | bootlimit=3 | ||
4 | |||
5 | bootcmd_set_rollback=if test ! "${rollback}" = "1"; then setenv rollback 1; setenv upgrade_available 0; saveenv; fi | ||
6 | altbootcmd=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 @@ | |||
1 | bootcmd_fitconf= | ||
2 | bootcmd_create_envfile= | ||
3 | |||
4 | sota_bootcommand=bootm | ||
5 | sota_kernel_addr=${ramdisk_addr_r} | ||
6 | sota_ramdisk_addr=- | ||
7 | sota_fdt_addr=- | ||
8 | sota_boot_part=mmc 0:1 | ||
9 | sota_main_part=mmc 0:2 | ||
10 | sota_root_device=/dev/mmcblk0p2 | ||
11 | |||
12 | %%INITFINISHED%% | ||
13 | |||
14 | bootcmd_resetvars=setenv kernel_image; setenv bootargs; setenv kernel_image2; setenv bootargs2 | ||
15 | bootcmd_otenv=run bootcmd_resetvars; load ${updater_main_part} $loadaddr /boot/loader/uEnv.txt; env import -t $loadaddr $filesize | ||
16 | |||
17 | bootcmd_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 | |||
19 | bootcmd_getroot=setexpr ostree_root gsub "^.*ostree=([^ ]*).*$" "\\\\1" "${bootargs}"; | ||
20 | |||
21 | bootcmd_load_kernel=load ${updater_main_part} ${sota_kernel_addr} "/boot"$kernel_image | ||
22 | |||
23 | bootcmd_load_ramdisk=if ! "${sota_ramdisk_addr}" = "-"; then load ${updater_main_part} ${sota_ramdisk_addr} "/boot"$ramdisk_image; fi | ||
24 | |||
25 | bootcmd_load_fdt=if ! "${sota_fdt_addr}" = "-"; then load ${updater_main_part} ${sota_fdt_addr} "/boot"$fdt_file; fi | ||
26 | |||
27 | bootcmd_load=run bootcmd_load_kernel; run bootcmd_load_ramdisk; run bootcmd_load_fdt; | ||
28 | |||
29 | bootcmd_run=${sota_bootcommand} ${sota_kernel_addr} ${sota_ramdisk_addr} ${sota_fdt_addr} | ||
30 | |||
31 | bootcmd=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 | |||