Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renesas_example: add example building the an image for renesas #24

Merged
merged 1 commit into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is rsync for here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Necessary for renesas yocto build. Does require this as a native tool


# install repo tool
RUN curl https://storage.googleapis.com/git-repo-downloads/repo > /bin/repo
Expand Down Expand Up @@ -46,5 +46,7 @@ ENV DL_DIR=/downloads
ENV TMP_DIR=/tmp
ENV OUTPUT_DIR=/build-output
ENV BB_ENV_PASSTHROUGH_ADDITIONS="SSTATE_DIR DL_DIR"
# BB_ENV_EXTRAWHITE is still used in Dunfell release and was renamed afterwards to BB_ENV_PASSTHROUGH_ADDITIONS
ENV BB_ENV_EXTRAWHITE="SSTATE_DIR DL_DIR"

USER yoctouser
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
17 changes: 17 additions & 0 deletions source-repo/renesas/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 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 root of the source repo, after deploying the build pipeline 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/*
49 changes: 49 additions & 0 deletions source-repo/renesas/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash

set -e
BOARD_LIST=("h3ulcb" "m3ulcb")
TARGET_BOARD=$1
PROPRIETARY_DIR=`pwd`/proprietary
WORK=`pwd`/${TARGET_BOARD}

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 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
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

# without proprietary files this build does not
##TODO bitbake core-image-weston
bitbake core-image-minimal
Loading