summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Gerasimov <anton.gerasimov@here.com>2019-02-21 15:54:39 +0100
committerAnton Gerasimov <anton.gerasimov@here.com>2019-02-25 15:35:01 +0100
commit690262acdba2511b14798c04b19d9dcc7df2d538 (patch)
treecdf2890f58fb10431fa9adf6c0bb1319c34816bf
parent3b9b75140ea58f546829cb3cf1b234e5b650de77 (diff)
downloadmeta-updater-feat/universaluenv.tar.gz
Add universal uEnv recipefeat/universaluenv
Signed-off-by: Anton Gerasimov <anton.gerasimov@here.com>
-rw-r--r--README.adoc16
-rw-r--r--classes/image_types_ostree.bbclass7
-rw-r--r--classes/sota.bbclass17
-rw-r--r--classes/sota_raspberrypi.bbclass8
-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.txt34
-rw-r--r--recipes-sota/ota-u-boot-script/ota-u-boot-script.bb63
9 files changed, 146 insertions, 9 deletions
diff --git a/README.adoc b/README.adoc
index 27ecabf..d425095 100644
--- a/README.adoc
+++ b/README.adoc
@@ -70,9 +70,20 @@ If your board isn't supported yet, you can add board integration code yourself.
701. Make the board boot into http://www.denx.de/wiki/U-Boot[U-Boot] 701. Make the board boot into http://www.denx.de/wiki/U-Boot[U-Boot]
712. Make U-boot import variables from /boot/loader/uEnv.txt and load the kernel with initramfs and kernel command line arguments according to what is set in this file. 712. Make U-boot import variables from /boot/loader/uEnv.txt and load the kernel with initramfs and kernel command line arguments according to what is set in this file.
72 72
73You may take a look into https://github.com/advancedtelematic/meta-updater-minnowboard[Minnowboard] or https://github.com/advancedtelematic/meta-updater-raspberrypi[Raspberry Pi] integration layers for examples. 73There is a flexible universal U-boot script provided by meta-updater to do OSTree-enabled boot, `ota-u-boot-script`. It is not being deployed by default, so you should enable it in your machine configuration. This script can be configured with following variables:
74 74
75Although we have used U-Boot so far, other boot loaders can be configured work with OSTree as well. 75* `SOTA_BOOTLOADER_BOOTCOMMAND` - command U-Boot will use to load the kernel. Normally is either `bootm` or `bootz`.
76* `SOTA_BOOTLOADER_BOOT_PART` - boot partition the script will use. Now only used for storing the U-Boot environment. Should be a full partition name, e.g. `mmc 0:1`.
77* `SOTA_BOOTLOADER_MAIN_PART` - the partition where the OSTree sysroot resides. Should be a full partition name, e.g. `mmc 0:1`
78* `SOTA_BOOTLOADER_KERNEL_ADDR` - address to load the kernel to. Can't refer to another variable, should be a (normally hex) number e.g. `0x02700000`.
79* `SOTA_BOOTLOADER_RAMDISK_ADDR` - address to load the ramdisk to. Can't refer to another variable, should be a (normally hex) number e.g. `0x02700000`. Set to empty when using FIT image with ramdisk packed (`KERNEL_IMAGETYPE = "fitImage"`).
80* `SOTA_BOOTLOADER_FDT_ADDR` - address to load the device tree to. Can't refer to another variable, should be a (normally hex) number e.g. `0x02700000`. Set to empty when no device tree is used.
81* `SOTA_BOOTLOADER_ROOT_DEVICE` - the partition where the OSTree sysroot resides as linux device path, e.g. `/dev/mmcblk0p2`.
82* `SOTA_BOOTLOADER_EXTRA_PARAMS` - extra parameters to add to kernel command line. Note that these parameters will be non-updatable, it is recommended in most cases to use `OSTREE_KERNEL_ARGS` instead.
83
84Although meta-updater is best integrated with U-Boot so far, basic support for Grub also exists. In addition to these two bootloaders libostree also supports SysLinux.
85
86Normally there still has to be some platform-dependent integration snippet that would source the script provided by meta-updater and/or OSTree. For an example of such snippets you can look into https://github.com/advancedtelematic/meta-updater-raspberrypi[Raspberry Pi] (U-Boot) and https://github.com/advancedtelematic/meta-updater-minnowboard[Minnowboard] (Grub, directly loads snippet provided by libostree) integration layers.
76 87
77== SOTA-related variables in local.conf 88== SOTA-related variables in local.conf
78 89
@@ -82,6 +93,7 @@ Although we have used U-Boot so far, other boot loaders can be configured work w
82* `OSTREE_COMMIT_SUBJECT` - Commit subject used by OSTree. Defaults to `Commit-id: ${IMAGE_NAME}` 93* `OSTREE_COMMIT_SUBJECT` - Commit subject used by OSTree. Defaults to `Commit-id: ${IMAGE_NAME}`
83* `OSTREE_UPDATE_SUMMARY` - Set this to '1' to update summary of OSTree repository on each commit. '0' by default. 94* `OSTREE_UPDATE_SUMMARY` - Set this to '1' to update summary of OSTree repository on each commit. '0' by default.
84* `OSTREE_DEPLOY_DEVICETREE` - Set this to '1' to include devicetree(s) to boot 95* `OSTREE_DEPLOY_DEVICETREE` - Set this to '1' to include devicetree(s) to boot
96* `OSTREE_KERNEL_ARGS` - Parameters to kernel command line.
85* `INITRAMFS_IMAGE` - initramfs/initrd image that is used as a proxy while booting into OSTree deployment. Do not change this setting unless you are sure that your initramfs can serve as such a proxy. 97* `INITRAMFS_IMAGE` - initramfs/initrd image that is used as a proxy while booting into OSTree deployment. Do not change this setting unless you are sure that your initramfs can serve as such a proxy.
86* `SOTA_PACKED_CREDENTIALS` - when set, your ostree commit will be pushed to a remote repo as a bitbake step. This should be the path to a zipped credentials file in https://github.com/advancedtelematic/aktualizr/blob/master/docs/credentials.adoc[the format accepted by garage-push]. 98* `SOTA_PACKED_CREDENTIALS` - when set, your ostree commit will be pushed to a remote repo as a bitbake step. This should be the path to a zipped credentials file in https://github.com/advancedtelematic/aktualizr/blob/master/docs/credentials.adoc[the format accepted by garage-push].
87* `SOTA_DEPLOY_CREDENTIALS` - when set to '1' (default value), deploys credentials to the built image. Override it in `local.conf` to built a generic image that can be provisioned manually after the build. 99* `SOTA_DEPLOY_CREDENTIALS` - when set to '1' (default value), deploys credentials to the built image. Override it in `local.conf` to built a generic image that can be provisioned manually after the build.
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass
index 29da78e..a6c9155 100644
--- a/classes/image_types_ostree.bbclass
+++ b/classes/image_types_ostree.bbclass
@@ -112,7 +112,12 @@ IMAGE_CMD_ostree () {
112 touch boot/initramfs-${checksum} 112 touch boot/initramfs-${checksum}
113 else 113 else
114 if [ "${OSTREE_DEPLOY_DEVICETREE}" = "1" ] && [ -n "${KERNEL_DEVICETREE}" ]; then 114 if [ "${OSTREE_DEPLOY_DEVICETREE}" = "1" ] && [ -n "${KERNEL_DEVICETREE}" ]; then
115 checksum=$(cat ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.${INITRAMFS_FSTYPES} ${KERNEL_DEVICETREE} | sha256sum | cut -f 1 -d " ") 115 kernel_ostree_fullpath=""
116 for blob in ${KERNEL_DEVICETREE}; do
117 kernel_ostree_fullpath="$kernel_ostree_fullpath ${DEPLOY_DIR_IMAGE}/$blob"
118 done
119
120 checksum=$(cat ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.${INITRAMFS_FSTYPES} $kernel_ostree_fullpath | sha256sum | cut -f 1 -d " ")
116 for DTS_FILE in ${KERNEL_DEVICETREE}; do 121 for DTS_FILE in ${KERNEL_DEVICETREE}; do
117 DTS_FILE_BASENAME=$(basename ${DTS_FILE}) 122 DTS_FILE_BASENAME=$(basename ${DTS_FILE})
118 cp ${DEPLOY_DIR_IMAGE}/${DTS_FILE_BASENAME} boot/devicetree-${DTS_FILE_BASENAME}-${checksum} 123 cp ${DEPLOY_DIR_IMAGE}/${DTS_FILE_BASENAME} boot/devicetree-${DTS_FILE_BASENAME}-${checksum}
diff --git a/classes/sota.bbclass b/classes/sota.bbclass
index 92b4c43..236a3bb 100644
--- a/classes/sota.bbclass
+++ b/classes/sota.bbclass
@@ -21,7 +21,11 @@ WKS_FILE_sota ?= "sdimage-sota.wks"
21 21
22EXTRA_IMAGEDEPENDS_append_sota = " parted-native mtools-native dosfstools-native" 22EXTRA_IMAGEDEPENDS_append_sota = " parted-native mtools-native dosfstools-native"
23 23
24INITRAMFS_FSTYPES ?= "${@oe.utils.ifelse(d.getVar('OSTREE_BOOTLOADER') == 'u-boot', 'cpio.gz.u-boot', 'cpio.gz')}" 24# Has to be an override, because 'INITRAMFS_FSTYPES ?=' is not strong enough to override the default value
25INITRAMFS_FSTYPES_sota ?= "${@oe.utils.ifelse(d.getVar('OSTREE_BOOTLOADER') == 'u-boot' and d.getVar('KERNEL_IMAGETYPE') != 'fitImage', 'cpio.gz.u-boot', 'cpio.gz')}"
26
27# Deploy config fragment list to OSTree root fs
28IMAGE_INSTALL_append = "${@oe.utils.ifelse(d.getVar('KERNEL_IMAGETYPE') == 'fitImage', ' fit-conf', ' ')}"
25 29
26# Please redefine OSTREE_REPO in order to have a persistent OSTree repo 30# Please redefine OSTREE_REPO in order to have a persistent OSTree repo
27export OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo" 31export OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo"
@@ -38,6 +42,15 @@ GARAGE_TARGET_NAME ?= "${OSTREE_BRANCHNAME}"
38GARAGE_TARGET_VERSION ?= "" 42GARAGE_TARGET_VERSION ?= ""
39GARAGE_TARGET_URL ?= "https://example.com/" 43GARAGE_TARGET_URL ?= "https://example.com/"
40 44
45SOTA_BOOTLOADER_EXTRA_PARAMS ??= ""
46SOTA_BOOTLOADER_BOOTCOMMAND ??= "bootm"
47SOTA_BOOTLOADER_KERNEL_ADDR ??= "0x02700000"
48SOTA_BOOTLOADER_RAMDISK_ADDR ??= ""
49SOTA_BOOTLOADER_FDT_ADDR ??= ""
50SOTA_BOOTLOADER_BOOT_PART ??= "mmc 0:1"
51SOTA_BOOTLOADER_MAIN_PART ??= "mmc 0:2"
52SOTA_BOOTLOADER_ROOT_DEVICE ??= "/dev/mmcblk0p2"
53
41SOTA_MACHINE ??="none" 54SOTA_MACHINE ??="none"
42SOTA_MACHINE_rpi ?= "raspberrypi" 55SOTA_MACHINE_rpi ?= "raspberrypi"
43SOTA_MACHINE_porter ?= "porter" 56SOTA_MACHINE_porter ?= "porter"
@@ -49,4 +62,6 @@ SOTA_MACHINE_am335x-evm ?= "am335x-evm-wifi"
49SOTA_OVERRIDES_BLACKLIST = "ostree ota" 62SOTA_OVERRIDES_BLACKLIST = "ostree ota"
50SOTA_REQUIRED_VARIABLES = "OSTREE_REPO OSTREE_BRANCHNAME OSTREE_OSNAME OSTREE_BOOTLOADER OSTREE_BOOT_PARTITION GARAGE_SIGN_REPO GARAGE_TARGET_NAME" 63SOTA_REQUIRED_VARIABLES = "OSTREE_REPO OSTREE_BRANCHNAME OSTREE_OSNAME OSTREE_BOOTLOADER OSTREE_BOOT_PARTITION GARAGE_SIGN_REPO GARAGE_TARGET_NAME"
51 64
65do_image_wic[depends] += " ota-u-boot-script:do_deploy "
66
52inherit sota_sanity sota_${SOTA_MACHINE} image_repo_manifest 67inherit sota_sanity sota_${SOTA_MACHINE} image_repo_manifest
diff --git a/classes/sota_raspberrypi.bbclass b/classes/sota_raspberrypi.bbclass
index e1c0054..88b5f21 100644
--- a/classes/sota_raspberrypi.bbclass
+++ b/classes/sota_raspberrypi.bbclass
@@ -2,16 +2,12 @@ RPI_USE_U_BOOT_sota = "1"
2 2
3KERNEL_CLASSES_append_sota = " kernel-fitimage" 3KERNEL_CLASSES_append_sota = " kernel-fitimage"
4KERNEL_IMAGETYPE_sota = "fitImage" 4KERNEL_IMAGETYPE_sota = "fitImage"
5INITRAMFS_FSTYPES = "cpio.gz"
6OSTREE_KERNEL = "${KERNEL_IMAGETYPE}-${INITRAMFS_IMAGE}-${MACHINE}-${KERNEL_FIT_LINK_NAME}" 5OSTREE_KERNEL = "${KERNEL_IMAGETYPE}-${INITRAMFS_IMAGE}-${MACHINE}-${KERNEL_FIT_LINK_NAME}"
7 6
8# DTB needs to be relocated to apply overlays 7# DTB needs to be relocated to apply overlays
9UBOOT_DTB_LOADADDRESS = "0x05000000" 8UBOOT_DTB_LOADADDRESS = "0x05000000"
10UBOOT_DTBO_LOADADDRESS = "0x06000000" 9UBOOT_DTBO_LOADADDRESS = "0x06000000"
11 10
12# Deploy config fragment list to OSTree root fs
13IMAGE_INSTALL_append = " fit-conf"
14
15PREFERRED_PROVIDER_virtual/bootloader_sota ?= "u-boot" 11PREFERRED_PROVIDER_virtual/bootloader_sota ?= "u-boot"
16UBOOT_ENTRYPOINT_sota ?= "0x00008000" 12UBOOT_ENTRYPOINT_sota ?= "0x00008000"
17 13
@@ -19,7 +15,7 @@ IMAGE_FSTYPES_remove_sota = "rpi-sdimg"
19OSTREE_BOOTLOADER ?= "u-boot" 15OSTREE_BOOTLOADER ?= "u-boot"
20 16
21# OSTree puts its own boot.scr to bcm2835-bootfiles 17# OSTree puts its own boot.scr to bcm2835-bootfiles
22IMAGE_BOOT_FILES_sota = "bcm2835-bootfiles/* u-boot.bin;${SDIMG_KERNELIMAGE}" 18IMAGE_BOOT_FILES_sota = "bcm2835-bootfiles/* uEnv.txt u-boot.bin;${SDIMG_KERNELIMAGE}"
23 19
24# Just the overlays that will be used should be listed 20# Just the overlays that will be used should be listed
25KERNEL_DEVICETREE_raspberrypi2_sota ?= " bcm2709-rpi-2-b.dtb " 21KERNEL_DEVICETREE_raspberrypi2_sota ?= " bcm2709-rpi-2-b.dtb "
@@ -35,3 +31,5 @@ OSTREE_KERNEL_ARGS_sota ?= " 8250.nr_uarts=1 bcm2708_fb.fbwidth=656 bcm2708_fb.f
35 31
36SOTA_CLIENT_FEATURES_append = " ubootenv" 32SOTA_CLIENT_FEATURES_append = " ubootenv"
37 33
34SOTA_ROLLBACK_MECHANISM = "file-env"
35
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..6a179b7
--- /dev/null
+++ b/recipes-sota/ota-u-boot-script/files/uEnv-fileenv.txt
@@ -0,0 +1 @@
bootcmd_create_envfile=if test ! -e $sota_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..51eaf73
--- /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;
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..d890257
--- /dev/null
+++ b/recipes-sota/ota-u-boot-script/files/uEnv.txt
@@ -0,0 +1,34 @@
1bootcmd_fitconf=
2bootcmd_create_envfile=
3fit_conf=
4
5sota_bootcommand=@@SOTA_BOOTLOADER_BOOTCOMMAND@@
6sota_kernel_addr=@@SOTA_BOOTLOADER_KERNEL_ADDR@@
7sota_ramdisk_addr=@@SOTA_BOOTLOADER_RAMDISK_ADDR@@
8sota_fdt_addr=@@SOTA_BOOTLOADER_FDT_ADDR@@
9sota_boot_part=@@SOTA_BOOTLOADER_BOOT_PART@@
10sota_main_part=@@SOTA_BOOTLOADER_MAIN_PART@@
11sota_root_device=@@SOTA_BOOTLOADER_ROOT_DEVICE@@
12
13@@INITFINISHED@@
14
15bootcmd_resetvars=setenv kernel_image; setenv bootargs; setenv kernel_image2; setenv bootargs2
16bootcmd_otenv=run bootcmd_resetvars; load ${sota_main_part} $loadaddr /boot/loader/uEnv.txt; env import -t $loadaddr $filesize
17
18bootcmd_args=setenv bootargs "$bootargs $bootargs_fdt ostree_root=$sota_root_device root=/dev/ram0 rw rootwait rootdelay=2 ramdisk_size=8192 panic=1 @@SOTA_BOOTLOADER_EXTRA_PARAMS@@"
19
20bootcmd_getroot=setexpr ostree_root gsub "^.*ostree=([^ ]*).*$" "\\\\1" "${bootargs}";
21
22bootcmd_load_kernel=load $sota_main_part $sota_kernel_addr "/boot"$kernel_image
23
24bootcmd_load_ramdisk=if test -n "${sota_ramdisk_addr}"; then load $sota_main_part $sota_ramdisk_addr "/boot"$ramdisk_image; fi
25
26bootcmd_load_fdt=if test -n "${sota_fdt_addr}"; then load $sota_main_part $sota_fdt_addr "/boot"$fdt_file; fi
27
28bootcmd_load=run bootcmd_load_kernel; run bootcmd_load_ramdisk; run bootcmd_load_fdt;
29
30bootcmd_run=$sota_bootcommand $sota_kernel_addr$fit_conf $sota_ramdisk_addr $sota_fdt_addr
31
32bootcmd=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 test ! "${upgrade_available}" = "1"; then setenv upgrade_available 1; saveenv; fi; reset; fi
33
34
diff --git a/recipes-sota/ota-u-boot-script/ota-u-boot-script.bb b/recipes-sota/ota-u-boot-script/ota-u-boot-script.bb
new file mode 100644
index 0000000..de00148
--- /dev/null
+++ b/recipes-sota/ota-u-boot-script/ota-u-boot-script.bb
@@ -0,0 +1,63 @@
1DESCRIPTION = "Boot script template for OTA-enabled image"
2LICENSE = "MIT"
3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
4
5inherit deploy
6
7SRC_URI = "file://uEnv-fileenv.txt \
8 file://uEnv-fit.txt \
9 file://uEnv-rollback.txt \
10 file://uEnv.txt"
11
12python () {
13 d.setVar('SOTA_BOOTLOADER_EXTRA_PARAMS', d.getVar('SOTA_BOOTLOADER_EXTRA_PARAMS').replace('/', '\/'))
14 d.setVar('SOTA_BOOTLOADER_BOOTCOMMAND', d.getVar('SOTA_BOOTLOADER_BOOTCOMMAND').replace('/', '\/'))
15 d.setVar('SOTA_BOOTLOADER_KERNEL_ADDR', d.getVar('SOTA_BOOTLOADER_KERNEL_ADDR').replace('/', '\/'))
16 d.setVar('SOTA_BOOTLOADER_RAMDISK_ADDR', d.getVar('SOTA_BOOTLOADER_RAMDISK_ADDR').replace('/', '\/'))
17 d.setVar('SOTA_BOOTLOADER_FDT_ADDR', d.getVar('SOTA_BOOTLOADER_FDT_ADDR').replace('/', '\/'))
18 d.setVar('SOTA_BOOTLOADER_BOOT_PART', d.getVar('SOTA_BOOTLOADER_BOOT_PART').replace('/', '\/'))
19 d.setVar('SOTA_BOOTLOADER_MAIN_PART', d.getVar('SOTA_BOOTLOADER_MAIN_PART').replace('/', '\/'))
20 d.setVar('SOTA_BOOTLOADER_ROOT_DEVICE', d.getVar('SOTA_BOOTLOADER_ROOT_DEVICE').replace('/', '\/'))
21}
22
23do_compile() {
24
25 UENV_TEMPLATE="${WORKDIR}/uEnv.template"
26 # Initialization portion
27 sed -n '0,/@@INITFINISHED@@/p' < ${WORKDIR}/uEnv.txt | head -n -1 > $UENV_TEMPLATE
28
29 # Support for FIT images
30 if [ "${KERNEL_IMAGETYPE}" = "fitImage" ]; then
31 cat ${WORKDIR}/uEnv-fit.txt >> $UENV_TEMPLATE
32 fi
33
34 # Rollback support
35 if [ -n "${SOTA_ROLLBACK_MECHANISM}" ]; then
36 cat ${WORKDIR}/uEnv-rollback.txt >> $UENV_TEMPLATE
37
38 if [ "${SOTA_ROLLBACK_MECHANISM}" = "file-env" ]; then
39 cat ${WORKDIR}/uEnv-fileenv.txt >> $UENV_TEMPLATE
40 fi
41 fi
42
43 # The rest of the base template
44 sed -n '/@@INITFINISHED@@/,$p' < ${WORKDIR}/uEnv.txt | sed -n '2,$p' >> $UENV_TEMPLATE
45
46 # Substitute the variables
47 sed -e 's/@@SOTA_BOOTLOADER_EXTRA_PARAMS@@/${SOTA_BOOTLOADER_EXTRA_PARAMS}/' \
48 -e 's/@@SOTA_BOOTLOADER_BOOTCOMMAND@@/${SOTA_BOOTLOADER_BOOTCOMMAND}/' \
49 -e 's/@@SOTA_BOOTLOADER_KERNEL_ADDR@@/${SOTA_BOOTLOADER_KERNEL_ADDR}/' \
50 -e 's/@@SOTA_BOOTLOADER_RAMDISK_ADDR@@/${SOTA_BOOTLOADER_RAMDISK_ADDR}/' \
51 -e 's/@@SOTA_BOOTLOADER_FDT_ADDR@@/${SOTA_BOOTLOADER_FDT_ADDR}/' \
52 -e 's/@@SOTA_BOOTLOADER_BOOT_PART@@/${SOTA_BOOTLOADER_BOOT_PART}/' \
53 -e 's/@@SOTA_BOOTLOADER_MAIN_PART@@/${SOTA_BOOTLOADER_MAIN_PART}/' \
54 -e 's/@@SOTA_BOOTLOADER_ROOT_DEVICE@@/${SOTA_BOOTLOADER_ROOT_DEVICE}/' \
55 "$UENV_TEMPLATE" > ${WORKDIR}/uEnv-final.txt
56}
57
58do_deploy() {
59 install -d ${DEPLOYDIR}
60 install -m 0644 ${WORKDIR}/uEnv-final.txt ${DEPLOYDIR}/uEnv.txt
61}
62
63addtask deploy after do_compile before do_build