Skip to content

Commit

Permalink
renesas_example: add example building the an image for renesas
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-roos committed Oct 10, 2023
1 parent 579830a commit 24fbf1c
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 1 deletion.
2 changes: 1 addition & 1 deletion assets/build-image/ubuntu_22_04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions lib/constructs/source-repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
16 changes: 16 additions & 0 deletions source-repo/renesas/README.md
Original file line number Diff line number Diff line change
@@ -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
29 changes: 29 additions & 0 deletions source-repo/renesas/build.buildspec.yml
Original file line number Diff line number Diff line change
@@ -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/*
61 changes: 61 additions & 0 deletions source-repo/renesas/build.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 24fbf1c

Please sign in to comment.