summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Gerasimov <anton@advancedtelematic.com>2017-01-04 10:38:53 +0100
committerAnton Gerasimov <anton@advancedtelematic.com>2017-01-04 10:38:53 +0100
commit0440d76b91de5e91fba107ea1eadbaff2f0eaa91 (patch)
tree662b45c80964cd57c6b6be97cf2ef8ee810ee496
parent47f2172bb6940591b6f8d6da2768fda687d2dc94 (diff)
downloadmeta-updater-0440d76b91de5e91fba107ea1eadbaff2f0eaa91.tar.gz
Move RPi-specific u-boot script from meta-updater
-rw-r--r--meta-sota-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript.bb26
-rw-r--r--meta-sota-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/boot.scr3
-rw-r--r--meta-sota-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.txt7
3 files changed, 36 insertions, 0 deletions
diff --git a/meta-sota-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript.bb b/meta-sota-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript.bb
new file mode 100644
index 0000000..9f5f0ca
--- /dev/null
+++ b/meta-sota-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript.bb
@@ -0,0 +1,26 @@
1DESCRIPTION = "Boot script for launching OTA-enabled images on raspberrypi"
2LICENSE = "MIT"
3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
4
5DEPENDS = "u-boot-mkimage-native"
6
7COMPATIBLE_MACHINE = "raspberrypi"
8
9SRC_URI = "file://boot.scr \
10 file://uEnv.txt"
11
12S = "${WORKDIR}"
13
14inherit deploy
15
16do_deploy() {
17 install -d ${DEPLOYDIR}/bcm2835-bootfiles
18
19 mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "Ostree boot script" -d ${S}/boot.scr ${DEPLOYDIR}/bcm2835-bootfiles/boot.scr
20 install -m 0755 ${S}/uEnv.txt ${DEPLOYDIR}/bcm2835-bootfiles/uEnv.txt
21}
22
23addtask deploy before do_package after do_install
24do_deploy[dirs] += "${DEPLOYDIR}/bcm2835-bootfiles"
25
26PACKAGE_ARCH = "${MACHINE_ARCH}"
diff --git a/meta-sota-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/boot.scr b/meta-sota-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/boot.scr
new file mode 100644
index 0000000..dc13f85
--- /dev/null
+++ b/meta-sota-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/boot.scr
@@ -0,0 +1,3 @@
1fatload mmc 0:1 $loadaddr /uEnv.txt
2env import -t $loadaddr $filesize
3run bootcmd
diff --git a/meta-sota-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.txt b/meta-sota-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.txt
new file mode 100644
index 0000000..f6c0570
--- /dev/null
+++ b/meta-sota-raspberrypi/recipes-bsp/u-boot-otascript/u-boot-otascript/uEnv.txt
@@ -0,0 +1,7 @@
1fdt_addr_r=0x0c800000
2bootcmd_dtb=fdt addr $fdt_addr_r; fdt get value bootargs_fdt /chosen bootargs
3bootcmd_otenv=ext2load mmc 0:2 $loadaddr /boot/loader/uEnv.txt; env import -t $loadaddr $filesize
4bootcmd_args=setenv bootargs "$bootargs $bootargs_fdt ostree_root=/dev/mmcblk0p2 root=/dev/ram0 rw rootwait rootdelay=2 ramdisk_size=8192"
5bootcmd_load=ext2load mmc 0:2 $kernel_addr_r "/boot"$kernel_image; ext2load mmc 0:2 $ramdisk_addr_r "/boot"$ramdisk_image
6bootcmd_run=bootm $kernel_addr_r $ramdisk_addr_r $fdt_addr_r
7bootcmd=run bootcmd_dtb; run bootcmd_otenv; run bootcmd_args; run bootcmd_load; run bootcmd_run