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

Enhance buildtools #106

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
1 change: 0 additions & 1 deletion build_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ workdir=$workdir/$TAG

cp build-install-dumb-init.sh $workdir
cp install-buildtools.sh $workdir
cp install-buildtools-make.sh $workdir
cd $workdir

baseimage=`grep FROM Dockerfile | sed -e 's/FROM //'`
Expand Down
16 changes: 5 additions & 11 deletions distro-entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,15 @@
# SPDX-License-Identifier: GPL-2.0-only
#

RELEASE="4.1"
ARCH="$(uname -m)"

if [ "$(uname -m)" = "aarch64" ]; then
SETUPSCRIPT="environment-setup-aarch64-pokysdk-linux"
elif [ "$(uname -m)" = "x86_64" ]; then
SETUPSCRIPT="environment-setup-x86_64-pokysdk-linux"
fi
# Search the environment setup script with the higher version number
SETUPSCRIPT="$(find /opt/poky -type f -name environment-setup-${ARCH}-pokysdk-linux 2>/dev/null | sort -r | head -n 1)"

# This entry point is so that we can do distro specific changes to the launch.
if [ -e /opt/poky/${RELEASE}/${SETUPSCRIPT} ]; then
if [ ! -z "${SETUPSCRIPT}" ]; then
# Buildtools has been installed so enable it
. /opt/poky/${RELEASE}/${SETUPSCRIPT} || exit 1
elif [ -e /opt/poky/${RELEASE}/${SETUPSCRIPT} ]; then
# Buildtools(-make) has been installed so enable it
. /opt/poky/${RELEASE}/${SETUPSCRIPT} || exit 1
. ${SETUPSCRIPT} || exit 1
fi

exec "$@"
2 changes: 1 addition & 1 deletion dockerfiles/alma/alma-8/alma-8-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ RUN dnf install -y 'dnf-command(config-manager)' && \
# of -make, install all the buildtools

COPY install-buildtools.sh /
RUN bash /install-buildtools.sh && \
RUN bash /install-buildtools.sh extended && \
rm /install-buildtools.sh

COPY build-install-dumb-init.sh /
Expand Down
6 changes: 3 additions & 3 deletions dockerfiles/alma/alma-9/alma-9-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ RUN dnf install -y 'dnf-command(config-manager)' && \

# Install buildtools-make. The original reason this was needed was due to a
# sanity check for make 4.1.2
COPY install-buildtools-make.sh /
RUN bash /install-buildtools-make.sh && \
rm /install-buildtools-make.sh
COPY install-buildtools.sh /
RUN bash /install-buildtools.sh make && \
rm /install-buildtools.sh

COPY build-install-dumb-init.sh /
RUN bash build-install-dumb-init.sh && \
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/centos/centos-7/centos-7-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ RUN yum -y install epel-release centos-release-scl && \
# build recent Yocto Project releases. Install the buildtools tarball to
# provide the required tools.
COPY install-buildtools.sh /
RUN bash /install-buildtools.sh && \
RUN bash /install-buildtools.sh extended && \
rm /install-buildtools.sh

COPY build-install-dumb-init.sh /
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/debian/debian-10/debian-10-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ RUN apt-get clean && \
# of -make, install all the buildtools

COPY install-buildtools.sh /
RUN bash /install-buildtools.sh && \
RUN bash /install-buildtools.sh extended && \
rm /install-buildtools.sh

COPY build-install-dumb-init.sh /
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/fedora/fedora-40/fedora-40-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ RUN dnf -y update && \
# Install buildtools for wget

COPY install-buildtools.sh /
RUN bash /install-buildtools.sh && \
RUN bash /install-buildtools.sh extended && \
rm /install-buildtools.sh

COPY build-install-dumb-init.sh /
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ RUN zypper --non-interactive install \
# of -make, install all the buildtools

COPY install-buildtools.sh /
RUN bash /install-buildtools.sh && \
RUN bash /install-buildtools.sh extended && \
rm /install-buildtools.sh

COPY build-install-dumb-init.sh /
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ RUN zypper --non-interactive install \
# of -make, install all the buildtools

COPY install-buildtools.sh /
RUN bash /install-buildtools.sh && \
RUN bash /install-buildtools.sh extended && \
rm /install-buildtools.sh

COPY build-install-dumb-init.sh /
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ RUN apt-get update && \
# Install buildtools due to python 3.8

COPY install-buildtools.sh /
RUN bash /install-buildtools.sh && \
RUN bash /install-buildtools.sh extended && \
rm /install-buildtools.sh

COPY build-install-dumb-init.sh /
Expand Down
31 changes: 0 additions & 31 deletions install-buildtools-make.sh

This file was deleted.

38 changes: 27 additions & 11 deletions install-buildtools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,38 @@
set -e

RELEASE="4.1"
if [ "$(uname -m)" = "aarch64" ]; then
BUILDTOOLS="aarch64-buildtools-extended-nativesdk-standalone-${RELEASE}.sh"
SHA256SUM="d5c0dd3e43c62f0465a9335f450d9f5f6861e4b3d39b0f04174bd50e6861c96e"
elif [ "$(uname -m)" = "x86_64" ]; then
BUILDTOOLS="x86_64-buildtools-extended-nativesdk-standalone-${RELEASE}.sh"
SHA256SUM="d360ac01016c848f713d6dd7848f25d0a5319e96e2dd279ab37ffcbd7320dbbe"

ARCH="$(uname -m)"
case "${ARCH}" in
aarch64|x86_64)
;;
*)
echo "Unsupported architecture '${ARCH}', can't install buildtools."
exit 1
;;
esac

if [ $# -eq 0 ]; then
BUILDTOOLS="${ARCH}-buildtools-nativesdk-standalone-${RELEASE}.sh"
else
echo "Unsupported architecture, can't install buildtools-make."
exit 1
TYPE="${1}"
case "${TYPE}" in
docs|extended|make)
;;
*)
echo "Invalid buildtools type '${TYPE}'."
exit 1
;;
esac
BUILDTOOLS="${ARCH}-buildtools-${TYPE}-nativesdk-standalone-${RELEASE}.sh"
fi


wget https://downloads.yoctoproject.org/releases/yocto/yocto-${RELEASE}/buildtools/${BUILDTOOLS}.sha256sum
wget https://downloads.yoctoproject.org/releases/yocto/yocto-${RELEASE}/buildtools/${BUILDTOOLS}

echo "${SHA256SUM} ${BUILDTOOLS}" > SHA256SUMS
sha256sum -c SHA256SUMS
rm SHA256SUMS
sha256sum -c ${BUILDTOOLS}.sha256sum
rm ${BUILDTOOLS}.sha256sum

bash ${BUILDTOOLS} -y
rm ${BUILDTOOLS}