summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcajun-rat <p@beta16.co.uk>2017-06-22 14:31:02 +0200
committerGitHub <noreply@github.com>2017-06-22 14:31:02 +0200
commit45c155a67d3532ad32342fc512e8bf6341ab9e5d (patch)
tree891f48bd89fa449b41378f5b0ecdb0b33358ef15
parent40922f1348b3fcb4d9e5b8d1772e64b45d401bc1 (diff)
parent3eda07d8632fe6723418b47dfb3a0bb4b41129b3 (diff)
downloadmeta-updater-45c155a67d3532ad32342fc512e8bf6341ab9e5d.tar.gz
Merge pull request #85 from advancedtelematic/feat/DEM-158/R-Car-M3
R-Car M3 Support
-rw-r--r--classes/sota.bbclass1
-rw-r--r--classes/sota_m3ulcb.bbclass9
-rw-r--r--conf/include/bblayers/sota_m3ulcb.inc2
-rw-r--r--recipes-sota/ostree-initrd/files/init.sh34
-rw-r--r--recipes-sota/ostree-initrd/ostree-initrd.bb2
5 files changed, 30 insertions, 18 deletions
diff --git a/classes/sota.bbclass b/classes/sota.bbclass
index a96429c..5073e29 100644
--- a/classes/sota.bbclass
+++ b/classes/sota.bbclass
@@ -25,6 +25,7 @@ SOTA_MACHINE ??="none"
25SOTA_MACHINE_raspberrypi2 ?= "raspberrypi" 25SOTA_MACHINE_raspberrypi2 ?= "raspberrypi"
26SOTA_MACHINE_raspberrypi3 ?= "raspberrypi" 26SOTA_MACHINE_raspberrypi3 ?= "raspberrypi"
27SOTA_MACHINE_porter ?= "porter" 27SOTA_MACHINE_porter ?= "porter"
28SOTA_MACHINE_m3ulcb = "m3ulcb"
28SOTA_MACHINE_intel-corei7-64 ?= "minnowboard" 29SOTA_MACHINE_intel-corei7-64 ?= "minnowboard"
29SOTA_MACHINE_qemux86-64 ?= "qemux86-64" 30SOTA_MACHINE_qemux86-64 ?= "qemux86-64"
30SOTA_MACHINE_am335x-evm ?= "am335x-evm-wifi" 31SOTA_MACHINE_am335x-evm ?= "am335x-evm-wifi"
diff --git a/classes/sota_m3ulcb.bbclass b/classes/sota_m3ulcb.bbclass
new file mode 100644
index 0000000..21d04ba
--- /dev/null
+++ b/classes/sota_m3ulcb.bbclass
@@ -0,0 +1,9 @@
1# Commit united image to OSTree, not just uImage
2OSTREE_KERNEL = "Image"
3
4EXTRA_IMAGEDEPENDS_append_sota = " m3ulcb-ota-bootfiles"
5IMAGE_CLASSES_append_sota = " image_types_uboot "
6IMAGE_BOOT_FILES_sota += "m3ulcb-ota-bootfiles/*"
7
8OSTREE_BOOTLOADER ?= "u-boot"
9UBOOT_MACHINE_sota = "m3ulcb_defconfig"
diff --git a/conf/include/bblayers/sota_m3ulcb.inc b/conf/include/bblayers/sota_m3ulcb.inc
new file mode 100644
index 0000000..04f78e4
--- /dev/null
+++ b/conf/include/bblayers/sota_m3ulcb.inc
@@ -0,0 +1,2 @@
1
2BBLAYERS += " ${METADIR}/meta-renesas ${METADIR}/meta-renesas-rcar-gen3 ${METADIR}/meta-openembedded/meta-multimedia"
diff --git a/recipes-sota/ostree-initrd/files/init.sh b/recipes-sota/ostree-initrd/files/init.sh
index 1814ca3..0b0693d 100644
--- a/recipes-sota/ostree-initrd/files/init.sh
+++ b/recipes-sota/ostree-initrd/files/init.sh
@@ -1,17 +1,13 @@
1#!/bin/sh 1#!/bin/sh
2 2set -eu
3# global variables
4
5SMACK=n
6DEBUG=n
7 3
8# ------------------------------------------- 4# -------------------------------------------
9 5
10log_info() { echo "$0[$$]: $@" >&2; } 6log_info() { echo "$0[$$]: $*" >&2; }
11log_error() { echo "$0[$$]: ERROR $@" >&2; } 7log_error() { echo "$0[$$]: ERROR $*" >&2; }
12 8
13do_mount_fs() { 9do_mount_fs() {
14 log_info "mounting FS: $@" 10 log_info "mounting FS: $*"
15 [[ -e /proc/filesystems ]] && { grep -q "$1" /proc/filesystems || { log_error "Unknown filesystem"; return 1; } } 11 [[ -e /proc/filesystems ]] && { grep -q "$1" /proc/filesystems || { log_error "Unknown filesystem"; return 1; } }
16 [[ -d "$2" ]] || mkdir -p "$2" 12 [[ -d "$2" ]] || mkdir -p "$2"
17 [[ -e /proc/mounts ]] && { grep -q -e "^$1 $2 $1" /proc/mounts && { log_info "$2 ($1) already mounted"; return 0; } } 13 [[ -e /proc/mounts ]] && { grep -q -e "^$1 $2 $1" /proc/mounts && { log_info "$2 ($1) already mounted"; return 0; } }
@@ -26,10 +22,10 @@ bail_out() {
26} 22}
27 23
28get_ostree_sysroot() { 24get_ostree_sysroot() {
29 for opt in `cat /proc/cmdline`; do 25 for opt in $(cat /proc/cmdline); do
30 arg=`echo $opt | cut -d'=' -f1` 26 arg=$(echo "$opt" | cut -d'=' -f1)
31 if [ $arg == "ostree_root" ]; then 27 if [ "$arg" == "ostree_root" ]; then
32 echo $opt | cut -d'=' -f2- 28 echo "$opt" | cut -d'=' -f2-
33 return 29 return
34 fi 30 fi
35 done 31 done
@@ -38,7 +34,7 @@ get_ostree_sysroot() {
38 34
39export PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/lib/ostree 35export PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/lib/ostree
40 36
41log_info "starting initrd script" 37log_info "Starting OSTree initrd script"
42 38
43do_mount_fs proc /proc 39do_mount_fs proc /proc
44do_mount_fs sysfs /sys 40do_mount_fs sysfs /sys
@@ -50,8 +46,6 @@ do_mount_fs tmpfs /run
50 46
51# check if smack is active (and if so, mount smackfs) 47# check if smack is active (and if so, mount smackfs)
52grep -q smackfs /proc/filesystems && { 48grep -q smackfs /proc/filesystems && {
53 SMACK=y
54
55 do_mount_fs smackfs /sys/fs/smackfs 49 do_mount_fs smackfs /sys/fs/smackfs
56 50
57 # adjust current label and network label 51 # adjust current label and network label
@@ -62,14 +56,20 @@ grep -q smackfs /proc/filesystems && {
62mkdir -p /sysroot 56mkdir -p /sysroot
63ostree_sysroot=$(get_ostree_sysroot) 57ostree_sysroot=$(get_ostree_sysroot)
64 58
65mount $ostree_sysroot /sysroot || bail_out "Unable to mount $ostree_sysroot as physical sysroot" 59mount "$ostree_sysroot" /sysroot || {
60 # The SD card in the R-Car M3 takes a bit of time to come up
61 # Retry the mount if it fails the first time
62 log_info "Mounting $ostree_sysroot failed, waiting 5s for the device to be available..."
63 sleep 5
64 mount "$ostree_sysroot" /sysroot || bail_out "Unable to mount $ostree_sysroot as physical sysroot"
65}
66ostree-prepare-root /sysroot 66ostree-prepare-root /sysroot
67 67
68# move mounted devices to new root 68# move mounted devices to new root
69cd /sysroot 69cd /sysroot
70for x in dev proc; do 70for x in dev proc; do
71 log_info "Moving /$x to new rootfs" 71 log_info "Moving /$x to new rootfs"
72 mount -o move /$x $x 72 mount -o move "/$x" "$x"
73done 73done
74 74
75# switch to new rootfs 75# switch to new rootfs
diff --git a/recipes-sota/ostree-initrd/ostree-initrd.bb b/recipes-sota/ostree-initrd/ostree-initrd.bb
index b721405..6046c81 100644
--- a/recipes-sota/ostree-initrd/ostree-initrd.bb
+++ b/recipes-sota/ostree-initrd/ostree-initrd.bb
@@ -5,7 +5,7 @@ SRC_URI = "file://init.sh"
5 5
6S = "${WORKDIR}" 6S = "${WORKDIR}"
7 7
8PV = "2" 8PV = "3"
9 9
10do_install() { 10do_install() {
11 install -dm 0755 ${D}/etc 11 install -dm 0755 ${D}/etc