From ae8a5db4668b153baa1b4aaf814f2cdd685e6466 Mon Sep 17 00:00:00 2001 From: Leon Anavi Date: Wed, 31 May 2017 10:21:56 +0300 Subject: sota: Support m3ulcb Support Renesas R Car Starter Kit Generation 3 (m3ulcb). Signed-off-by: Leon Anavi --- classes/sota.bbclass | 1 + classes/sota_m3ulcb.bbclass | 9 +++++++++ conf/include/bblayers/sota_m3ulcb.inc | 2 ++ 3 files changed, 12 insertions(+) create mode 100644 classes/sota_m3ulcb.bbclass create mode 100644 conf/include/bblayers/sota_m3ulcb.inc 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" SOTA_MACHINE_raspberrypi2 ?= "raspberrypi" SOTA_MACHINE_raspberrypi3 ?= "raspberrypi" SOTA_MACHINE_porter ?= "porter" +SOTA_MACHINE_m3ulcb = "m3ulcb" SOTA_MACHINE_intel-corei7-64 ?= "minnowboard" SOTA_MACHINE_qemux86-64 ?= "qemux86-64" SOTA_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 @@ +# Commit united image to OSTree, not just uImage +OSTREE_KERNEL = "Image" + +EXTRA_IMAGEDEPENDS_append_sota = " m3ulcb-ota-bootfiles" +IMAGE_CLASSES_append_sota = " image_types_uboot " +IMAGE_BOOT_FILES_sota += "m3ulcb-ota-bootfiles/*" + +OSTREE_BOOTLOADER ?= "u-boot" +UBOOT_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 @@ + +BBLAYERS += " ${METADIR}/meta-renesas ${METADIR}/meta-renesas-rcar-gen3 ${METADIR}/meta-openembedded/meta-multimedia" -- cgit v1.2.3-54-g00ecf From 64e2fb483f6d4df8929af9ada31a72e218121f0e Mon Sep 17 00:00:00 2001 From: Phil Wise Date: Thu, 22 Jun 2017 12:15:21 +0200 Subject: Fix warnings from shellcheck shell linter --- recipes-sota/ostree-initrd/files/init.sh | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/recipes-sota/ostree-initrd/files/init.sh b/recipes-sota/ostree-initrd/files/init.sh index 1814ca3..b88716c 100644 --- a/recipes-sota/ostree-initrd/files/init.sh +++ b/recipes-sota/ostree-initrd/files/init.sh @@ -1,17 +1,13 @@ #!/bin/sh - -# global variables - -SMACK=n -DEBUG=n +set -eu # ------------------------------------------- -log_info() { echo "$0[$$]: $@" >&2; } -log_error() { echo "$0[$$]: ERROR $@" >&2; } +log_info() { echo "$0[$$]: $*" >&2; } +log_error() { echo "$0[$$]: ERROR $*" >&2; } do_mount_fs() { - log_info "mounting FS: $@" + log_info "mounting FS: $*" [[ -e /proc/filesystems ]] && { grep -q "$1" /proc/filesystems || { log_error "Unknown filesystem"; return 1; } } [[ -d "$2" ]] || mkdir -p "$2" [[ -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() { } get_ostree_sysroot() { - for opt in `cat /proc/cmdline`; do - arg=`echo $opt | cut -d'=' -f1` - if [ $arg == "ostree_root" ]; then - echo $opt | cut -d'=' -f2- + for opt in $(cat /proc/cmdline); do + arg=$(echo "$opt" | cut -d'=' -f1) + if [ "$arg" == "ostree_root" ]; then + echo "$opt" | cut -d'=' -f2- return fi done @@ -38,7 +34,7 @@ get_ostree_sysroot() { export PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/lib/ostree -log_info "starting initrd script" +log_info "Starting OSTree initrd script" do_mount_fs proc /proc do_mount_fs sysfs /sys @@ -50,8 +46,6 @@ do_mount_fs tmpfs /run # check if smack is active (and if so, mount smackfs) grep -q smackfs /proc/filesystems && { - SMACK=y - do_mount_fs smackfs /sys/fs/smackfs # adjust current label and network label @@ -69,7 +63,7 @@ ostree-prepare-root /sysroot cd /sysroot for x in dev proc; do log_info "Moving /$x to new rootfs" - mount -o move /$x $x + mount -o move "/$x" "$x" done # switch to new rootfs -- cgit v1.2.3-54-g00ecf From 3eda07d8632fe6723418b47dfb3a0bb4b41129b3 Mon Sep 17 00:00:00 2001 From: Phil Wise Date: Thu, 22 Jun 2017 12:16:03 +0200 Subject: Retry mounting sysroot Fixes DEM-169 --- recipes-sota/ostree-initrd/files/init.sh | 8 +++++++- recipes-sota/ostree-initrd/ostree-initrd.bb | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/recipes-sota/ostree-initrd/files/init.sh b/recipes-sota/ostree-initrd/files/init.sh index b88716c..0b0693d 100644 --- a/recipes-sota/ostree-initrd/files/init.sh +++ b/recipes-sota/ostree-initrd/files/init.sh @@ -56,7 +56,13 @@ grep -q smackfs /proc/filesystems && { mkdir -p /sysroot ostree_sysroot=$(get_ostree_sysroot) -mount $ostree_sysroot /sysroot || bail_out "Unable to mount $ostree_sysroot as physical sysroot" +mount "$ostree_sysroot" /sysroot || { + # The SD card in the R-Car M3 takes a bit of time to come up + # Retry the mount if it fails the first time + log_info "Mounting $ostree_sysroot failed, waiting 5s for the device to be available..." + sleep 5 + mount "$ostree_sysroot" /sysroot || bail_out "Unable to mount $ostree_sysroot as physical sysroot" +} ostree-prepare-root /sysroot # move mounted devices to new root 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" S = "${WORKDIR}" -PV = "2" +PV = "3" do_install() { install -dm 0755 ${D}/etc -- cgit v1.2.3-54-g00ecf