Skip to content
This repository was archived by the owner on Sep 7, 2020. It is now read-only.
Open
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
5 changes: 4 additions & 1 deletion tools/docker/builder/openwrt/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ FROM ubuntu:18.04 as openwrt-prerequisites
RUN apt-get update \
&& apt-get -y install --no-install-recommends \
build-essential libncurses5 libncurses5-dev python python3 \
unzip git ca-certificates gawk wget file bash \
unzip git ca-certificates gawk wget file bash fakeroot \
python-yaml python3-yaml rsync less vim gnupg software-properties-common \
# yq is available in a separate ppa (needs gnupg and software-properties-common):
&& if [ -n "$HTTP_PROXY" ]; then KEYSERVER_OPTIONS="--keyserver-options http-proxy=$HTTP_PROXY"; fi \
Expand Down Expand Up @@ -51,6 +51,9 @@ ENV PRPLMESH_VARIANT=$PRPLMESH_VARIANT
# The feed to use to build prplMesh.
ARG PRPL_FEED
ENV PRPL_FEED=$PRPL_FEED
# The feed to use to build HLAPI.
ARG SAH_FEED
ENV SAH_FEED=$SAH_FEED
# optional: intel feed to use.
ARG INTEL_FEED
ENV INTEL_FEED=$INTEL_FEED
Expand Down
6 changes: 6 additions & 0 deletions tools/docker/builder/openwrt/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ usage() {
echo "The following environment variables will affect the build:"
echo " - PRPL_FEED: the prpl feed that will be used to install prplMesh."
echo " default: $PRPL_FEED"
echo " - SAH_FEED: the SAH feed that will be used to install bus agnostic API."
echo " default: $SAH_FEED"

}

Expand All @@ -41,6 +43,7 @@ build_image() {
--build-arg TARGET_DEVICE="$TARGET_DEVICE" \
--build-arg TARGET_PROFILE="$TARGET_PROFILE" \
--build-arg PRPL_FEED="$PRPL_FEED" \
--build-arg SAH_FEED="$SAH_FEED" \
--build-arg PRPLMESH_VARIANT="$PRPLMESH_VARIANT" \
--target="$DOCKER_TARGET_STAGE" \
"$scriptdir/"
Expand Down Expand Up @@ -131,6 +134,7 @@ main() {
dbg "OPENWRT_REPOSITORY=$OPENWRT_REPOSITORY"
dbg "OPENWRT_VERSION=$OPENWRT_VERSION"
dbg "PRPL_FEED=$PRPL_FEED"
dbg "SAH_FEED=$SAH_FEED"
dbg "IMAGE_ONLY=$IMAGE_ONLY"
dbg "TARGET_DEVICE=$TARGET_DEVICE"
dbg "TAG=$TAG"
Expand Down Expand Up @@ -158,6 +162,7 @@ main() {
PRPLMESH_VERSION="$(git describe --always --dirty | sed -e 's/.*-g//')"
export PRPLMESH_VERSION
export PRPL_FEED
export SAH_FEED
export PRPLMESH_VARIANT

if [ $IMAGE_ONLY = true ] ; then
Expand All @@ -175,6 +180,7 @@ IMAGE_ONLY=false
OPENWRT_REPOSITORY='https://git.prpl.dev/prplmesh/prplwrt.git'
OPENWRT_VERSION='3d511d477e72bd1845c75101a7f3d4e00780991d'
PRPL_FEED='https://git.prpl.dev/prplmesh/feed-prpl.git^89e6602655713f8487c72d8d636daa610d76a468'
SAH_FEED='https://gitlab.com/soft.at.home/buildsystems/openwrt/sah-packages.git'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please include a specific commit hash for it (by appending a ^ character, then the commit hash) to try to improve the reproducibility of the images.

PRPLMESH_VARIANT="-nl80211"
DOCKER_TARGET_STAGE="prplmesh-builder"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@
- name: feed_pending
uri: https://intel.prpl.dev/intel/feed-pending.git
hash: 352365b31f968ab37e772b23c30ea32dbff9e337
- name: sah
uri: https://gitlab.com/soft.at.home/buildsystems/openwrt/sah-packages.git
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here, please include a hash: HASH line

18 changes: 18 additions & 0 deletions tools/docker/builder/openwrt/scripts/build-openwrt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ case $TARGET_DEVICE in
*)
cp feeds.conf.default feeds.conf
echo "src-git prpl $PRPL_FEED" >> feeds.conf
echo "src-git sah $SAH_FEED" >> feeds.conf
scripts/feeds update -a
scripts/feeds install -a
{
Expand All @@ -34,6 +35,23 @@ case $TARGET_DEVICE in
echo "CONFIG_TARGET_${TARGET_SYSTEM}_${SUBTARGET}=y"
echo "CONFIG_TARGET_${TARGET_SYSTEM}_${SUBTARGET}_${TARGET_PROFILE}=y"
echo "CONFIG_PACKAGE_prplmesh${PRPLMESH_VARIANT}=y"
# AMBIORIX modules to work with u-bus
echo "CONFIG_PACKAGE_amxb-ubus=y"
# AMBIORIX applications for debug
echo "CONFIG_PACKAGE_amxb-inspect=y"
echo "CONFIG_PACKAGE_amxo-cg=y"
echo "CONFIG_PACKAGE_amxrt=y"
# AMBIORIX libs
echo "CONFIG_PACKAGE_libamxb=y"
echo "CONFIG_PACKAGE_libamxc=y"
Copy link
Collaborator

Choose a reason for hiding this comment

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

The same changes have to be introduced in prplwrt for the axepoint/rax40 in a profile file.
This one is not a nitpick comment, if we want to use it on the axepoint it has to be in a profile under profiles/, since gen_config.py removes any custom .config line anyway.

echo "CONFIG_PACKAGE_libamxd=y"
echo "CONFIG_PACKAGE_libamxj=y"
echo "CONFIG_PACKAGE_libamxo=y"
Copy link
Collaborator

Choose a reason for hiding this comment

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

You might also want to check if all the config lines are needed, or if some are depended on by others and can be removed (maybe you did already).

echo "CONFIG_PACKAGE_libamxp=y"
echo "CONFIG_PACKAGE_libevent2=y"
# Dependencies of AMBIORIX
echo "CONFIG_PACKAGE_uriparser=y"
echo "CONFIG_PACKAGE_yajl=y"
Copy link
Collaborator

Choose a reason for hiding this comment

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

The different CONFIG_TARGET... and the config line for prplmesh are convenient to have here because they depend on arguments.
For other stuff we want to add however, it would be easier to have a file containing the configuration directly (no need for the echo lines, you could directly copy and paste from the .config).
Then here it would just be a matter of copying the partial config file to .config.
This is something we did before to build different targets with different GCC versions, but it was reverted at some point because it wasn't used anymore.
You can check the following commit if you want an example of what I'm talking about: https://github.com/prplfoundation/prplMesh/blob/ba02ad94f6d6129b8f5b10fdd619d76e40ab1948/tools/docker/builder/openwrt/Dockerfile
(specifically this line: COPY --chown=openwrt:openwrt configs/base_${BASE_CONFIG}_config /home/openwrt/base_config)

I would understand if you don't want to do this as part of this PR though, so (nitpick)

} >> .config
make defconfig
printf '%s=%s\n' "PRPL_FEED" "$PRPL_FEED" >> files/etc/prplwrt-version
Expand Down