-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrtos.desc
45 lines (36 loc) · 1.35 KB
/
rtos.desc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# SPDX-License-Identifier: MIT
# file names to use: change this if you rename the project.
RTOS_BIN="rtos/*/*/armadillo_rtos_demo.bin"
KMOD="linux/rpmsg_armadillo.ko"
DTBO="dts/armadillo_iotg_g4-rtos-demo.dtbo"
BOOT="boot_script/boot.txt"
# we install to rootfs, so set version as extra_os from start
swdesc_option component=extra_os.rtos
swdesc_option version=1
# install rtos binary. The newest file matching wildcard is installed
# versions are built.
rtos_bin=$(ls -t $RTOS_BIN | head -n 1)
[ -n "$rtos_bin" ] || error "Could not find rtos binary at $RTOS_BIN"
echo "Using $rtos_bin"
swdesc_files --dest /boot "$rtos_bin"
# install the kernel module
# the kernel version used is the currently running version, so
# linux should not be updated in the same SWU. If that is the
# case just set kver directly.
swdesc_exec "$KMOD" \
'kver=$(uname -r)' \
'mkdir -p /lib/modules/$kver/extras' \
"mv \$1 /lib/modules/\$kver/extras/${KMOD##*/}" \
'depmod $kver'
# copy and enable dtb overlay
swdesc_files --dest /boot "$DTBO"
swdesc_script "$SCRIPT_DIR/examples/update_overlays.sh" -- \
"${DTBO##*/}"
# tell u-boot to start up the cortex M core
swdesc_exec "$BOOT" \
'mv $1 /boot/boot.txt' \
'mkbootscr /boot/boot.txt'
# update preserve_files list
swdesc_script "$SCRIPT_DIR/examples/update_preserve_files.sh" -- \
"POST /boot" \
"POST /lib/modules"