diff --git a/assets/build-image/ubuntu_22_04/Dockerfile b/assets/build-image/ubuntu_22_04/Dockerfile index 5fdf5f5..4d27af3 100644 --- a/assets/build-image/ubuntu_22_04/Dockerfile +++ b/assets/build-image/ubuntu_22_04/Dockerfile @@ -13,7 +13,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # Install packages used elsewhere in the build RUN apt-get install -y --no-install-recommends \ uuid-runtime sysstat iproute2 openssh-client curl python-is-python3 \ - parted mtools dosfstools jq gpg gpg-agent qemu-utils + parted mtools dosfstools jq gpg gpg-agent qemu-utils rsync # install repo tool RUN curl https://storage.googleapis.com/git-repo-downloads/repo > /bin/repo diff --git a/lib/constructs/source-repo.ts b/lib/constructs/source-repo.ts index b114f6d..80e0575 100644 --- a/lib/constructs/source-repo.ts +++ b/lib/constructs/source-repo.ts @@ -16,6 +16,8 @@ export enum ProjectKind { PokyAmi = 'poky-ami', /** Build an kas based image */ Kas = 'kas', + /** Build an Renesas image */ + Renesas = 'renesas', } export interface SourceRepoProps extends cdk.StackProps { diff --git a/source-repo/renesas/README.md b/source-repo/renesas/README.md new file mode 100644 index 0000000..faebb7d --- /dev/null +++ b/source-repo/renesas/README.md @@ -0,0 +1,16 @@ +# renesas example based on https://elinux.org/R-Car/Boards/Yocto-Gen3/v5.9.0 + +To build a image containing the proprietary graphics and multimedia drivers from Renesas. +You need to download Multimedia and Graphics library and related Linux drivers, please from the following link: + +https://www.renesas.com/us/en/application/automotive/r-car-h3-m3-h2-m2-e2-documents-software + +Download two files: + +R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20220121.zip +R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20220121.zip + + +Graphic drivers are required for Wayland. Multimedia drivers are optional. + +Put them into the proprietary folder in the source repo and uncomment the #TODO in the build.sh \ No newline at end of file diff --git a/source-repo/renesas/build.buildspec.yml b/source-repo/renesas/build.buildspec.yml new file mode 100644 index 0000000..37e8b33 --- /dev/null +++ b/source-repo/renesas/build.buildspec.yml @@ -0,0 +1,29 @@ +version: 0.2 +run-as: yoctouser + +env: + shell: bash + +phases: + pre_build: + run-as: root + commands: + - chown -R yoctouser /sstate-cache + - chown -R yoctouser /downloads + - chmod 755 /sstate-cache + - chmod 755 /downloads + - chmod 755 build.sh + build: + commands: + - echo Build started on `date` + - ./build.sh h3ulcb + post_build: + commands: + # Prune old files in our EFS Mounts, that are not accessed by this or any build within 30 days + - find /sstate-cache -atime +30 -delete + - find /downloads -atime +30 -delete + +artifacts: + discard-paths: true + files: + - h3ulcb/build/tmp/deploy/images/h3ulcb/* diff --git a/source-repo/renesas/build.sh b/source-repo/renesas/build.sh new file mode 100644 index 0000000..8e31a59 --- /dev/null +++ b/source-repo/renesas/build.sh @@ -0,0 +1,61 @@ +#!/bin/bash + +set -e +BOARD_LIST=("h3ulcb" "m3ulcb") +TARGET_BOARD=$1 +PROPRIETARY_DIR=`pwd`/proprietary +WORK=`pwd`/${TARGET_BOARD} + +POKY_COMMIT=74b22db6879b388d700f61e08cb3f239cf940d18 +META_OE_COMMIT=814eec96c2a29172da57a425a3609f8b6fcc6afe +META_RENESAS_COMMIT=c5b39adbabdb8fd51517cf37190552b8fb57d062 + +GFX_MMP_LIB=R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-20220121.zip +GFX_MMP_DRIVER=R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-20220121.zip + +Usage () { + echo "Usage: $0 \${TARGET_BOARD_NAME}" + echo "BOARD_NAME list: " + for i in ${BOARD_LIST[@]}; do echo " - $i"; done + exit +} + +# Check Param. +if ! `IFS=$'\n'; echo "${BOARD_LIST[*]}" | grep -qx "${TARGET_BOARD}"`; then + Usage +fi +mkdir -p ${WORK} +cd ${WORK} +# Clone basic Yocto layers in parallel +# git clone git://git.yoctoproject.org/poky -b kirkstone & +# git clone git://git.openembedded.org/meta-openembedded -b kirkstone & +# git clone https://github.com/renesas-rcar/meta-renesas -b kirkstone-dev +git clone git://git.yoctoproject.org/poky -b dunfell & +git clone git://git.openembedded.org/meta-openembedded -b dunfell & +git clone https://github.com/renesas-rcar/meta-renesas -b dunfell +# Wait for all clone operations +wait +# Switch to proper branches/commits +# cd ${WORK}/poky +# git checkout -b tmp ${POKY_COMMIT} +# cd ${WORK}/meta-openembedded +# git checkout -b tmp ${META_OE_COMMIT} +# cd ${WORK}/meta-renesas +# git checkout -b tmp ${META_RENESAS_COMMIT} +# Populate meta-renesas with proprietary software packages +WORK_PROP_DIR=${WORK}/proprietary +mkdir -p ${WORK_PROP_DIR} +##TODO unzip -qo ${PROPRIETARY_DIR}/${GFX_MMP_LIB} -d ${WORK_PROP_DIR} +##TODO unzip -qo ${PROPRIETARY_DIR}/${GFX_MMP_DRIVER} -d ${WORK_PROP_DIR} +cd ${WORK}/meta-renesas +sh meta-rcar-gen3/docs/sample/copyscript/copy_proprietary_softwares.sh -f ${WORK_PROP_DIR} +cd ${WORK} +source poky/oe-init-build-env ${WORK}/build +#cp ${WORK}/meta-renesas/meta-rcar-gen3/docs/sample/conf/${TARGET_BOARD}/poky-gcc/bsp/*.conf ./conf/ +#cp ${WORK}/meta-renesas/meta-rcar-gen3/docs/sample/conf/${TARGET_BOARD}/poky-gcc/gfx-only/*.conf ./conf/ +cp ${WORK}/meta-renesas/meta-rcar-gen3/docs/sample/conf/${TARGET_BOARD}/poky-gcc/mmp/*.conf ./conf +cd ${WORK}/build +cp conf/local-wayland.conf conf/local.conf +echo 'BB_DANGLINGAPPENDS_WARNONLY ?= "true"' >> conf/local.conf + +bitbake core-image-weston