Skip to content

Raspberry Pi 4 Support with upgrade to buster #113

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

Closed
wants to merge 8 commits into from
Closed
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
15 changes: 9 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
FROM hypriot/image-builder:latest

ENV HYPRIOT_OS_VERSION=v2.1.0 \
RAW_IMAGE_VERSION=v0.3.1
ENV HYPRIOT_OS_VERSION=v2.2.1 \
RAW_IMAGE_VERSION=v0.3.2

#Note that the checksums and build timestamps only apply when fetching missing
#artifacts remotely is enabled to validate downloaded remote artifacts
ENV FETCH_MISSING_ARTIFACTS=true \
ROOT_FS_ARTIFACT=rootfs-arm64-debian-$HYPRIOT_OS_VERSION.tar.gz \
KERNEL_ARTIFACT=4.19.58-hypriotos-v8.tar.gz \
RPI4_KERNEL_ARTIFACT=bcm2711-kernel-bis \
BOOTLOADER_ARTIFACT=rpi-bootloader.tar.gz \
RAW_IMAGE_ARTIFACT=rpi-raw.img.zip \
DOCKER_ENGINE_VERSION="5:18.09.7~3-0~debian-stretch" \
DOCKER_ENGINE_VERSION="5:18.09.7~3-0~debian-buster" \
CONTAINERD_IO_VERSION="1.2.6-3" \
DOCKER_COMPOSE_VERSION="1.23.1" \
DOCKER_MACHINE_VERSION="0.16.1" \
KERNEL_VERSION="4.19.58" \
ROOTFS_TAR_CHECKSUM="4437ac3ab8278a4a3994aa9aa36f0f00bc409f80ebdffef23a141dfc0286ecb0" \
RAW_IMAGE_CHECKSUM="ccff10498fb45fb76c6064988fb01b3543adfdb70ee7e5fb04b51885573684a6" \
ROOTFS_TAR_CHECKSUM="4745a25a294ac997db2a4ef9c190857178c3708f2af576258a28e197356e3ce7" \
RAW_IMAGE_CHECKSUM="cd66db11608f910b7b18f0e1d5f7943f10d54bacc1fa1dcc526a442a115c4a5a" \
BOOTLOADER_BUILD="20190713-140339" \
KERNEL_BUILD="20190715-111025"
KERNEL_BUILD="20190715-111025" \
RPI4_KERNEL_BUILD="4.19.75.20191001"

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
binfmt-support \
qemu \
qemu-user-static \
xz-utils \
--no-install-recommends && \
rm -rf /var/lib/apt/lists/*

Expand Down
15 changes: 15 additions & 0 deletions builder/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ HYPRIOT_IMAGE_VERSION=${VERSION:="dirty"}
HYPRIOT_IMAGE_NAME="hypriotos-rpi64-${HYPRIOT_IMAGE_VERSION}.img"
export HYPRIOT_IMAGE_VERSION

# Add RPI Kernel
RPI4_KERNEL_ARTIFACT=${RPI4_KERNEL_ARTIFACT}-${RPI4_KERNEL_BUILD}.tar.xz

# create build directory for assembling our image filesystem
rm -rf ${BUILD_PATH}
mkdir ${BUILD_PATH}
Expand Down Expand Up @@ -72,6 +75,18 @@ if [ ! -f "$FILENAME" ]; then
fi
tar -xf "$FILENAME" -C "${BUILD_PATH}"

# Add RPI4 Kernel
FILENAME=/workspace/$RPI4_KERNEL_ARTIFACT
if [ ! -f "$FILENAME" ]; then
if [ "$FETCH_MISSING_ARTIFACTS" == "true" ]; then
fetch --repo="https://github.com/sakaki-/bcm2711-kernel-bis" --tag="$RPI4_KERNEL_BUILD" --release-asset="${RPI4_KERNEL_ARTIFACT}" /workspace
else
echo "Missing artifact ${KERNEL_ARTIFACT}"
exit 255
fi
fi
tar -xJf "$FILENAME" -C "${BUILD_PATH}"

# register qemu-aarch64 with binfmt
# to ensure that binaries we use in the chroot
# are executed via qemu-aarch64
Expand Down
15 changes: 14 additions & 1 deletion builder/chroot-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function get_gpg(){
# get_gpg {GPGKEYID|FINGERPRINT} [URL|FILE]

# device specific settings
HYPRIOT_DEVICE="Raspberry Pi 3 64bit"
HYPRIOT_DEVICE="Raspberry Pi 3/4 64bit"

# set up /etc/resolv.conf
DEST=$(readlink -m /etc/resolv.conf)
Expand Down Expand Up @@ -166,6 +166,17 @@ start_x=0
gpu_mem=16
" >> boot/config.txt

# Add option for custom 64-bit kernel to boot/config.txt
echo "
[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=2
arm_64bit=1
# differentiate from Pi3 64-bit kernels
kernel=kernel8-p4.img
" >> boot/config.txt

# # /etc/modules
# echo "snd_bcm2835
# " >> /etc/modules
Expand Down Expand Up @@ -288,6 +299,8 @@ HYPRIOT_KERNEL_BUILD="${KERNEL_BUILD}"
HYPRIOT_KERNEL_VERSION="${KERNEL_VERSION}"
HYPRIOT_DEVICE="$HYPRIOT_DEVICE"
HYPRIOT_IMAGE_VERSION="$HYPRIOT_IMAGE_VERSION"
HYPRIOT_OS_VERSION="$HYPRIOT_OS_VERSION"
HYPRIOT_OS="HypriotOS/arm64"
EOF
else
cat <<EOF >> /etc/os-release
Expand Down
12 changes: 6 additions & 6 deletions builder/test/os-release_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
expect(stdout).to contain('debian')
end

it "is debian version stretch" do
expect(stdout).to contain('stretch')
it "is debian version buster" do
expect(stdout).to contain('buster')
end

it "is a HypriotOS" do
Expand All @@ -32,12 +32,12 @@
expect(stdout).to contain('^HYPRIOT_OS="HypriotOS/arm64"$')
end

it "is for device 'HYPRIOT_DEVICE=\"Raspberry Pi 3 64bit\"'" do
expect(stdout).to contain('^HYPRIOT_DEVICE="Raspberry Pi 3 64bit"$')
it "is for device 'HYPRIOT_DEVICE=\"Raspberry Pi 3/4 64bit\"'" do
expect(stdout).to contain('^HYPRIOT_DEVICE="Raspberry Pi 3/4 64bit"$')
end

it "uses os-rootfs version 'HYPRIOT_OS_VERSION=\"v2.1.0\"'" do
expect(stdout).to contain('^HYPRIOT_OS_VERSION="v2.1.0"$')
it "uses os-rootfs version 'HYPRIOT_OS_VERSION=\"v2.2.1\"'" do
expect(stdout).to contain('^HYPRIOT_OS_VERSION="v2.2.1"$')
end

if ENV.fetch('TRAVIS_TAG','') != ''
Expand Down
2 changes: 1 addition & 1 deletion travis-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ export GIT_RELTEXT="Auto-released by [Travis-CI build #$TRAVIS_BUILD_NUMBER](htt
curl -sSL https://github.com/tcnksm/ghr/releases/download/v0.5.4/ghr_v0.5.4_linux_amd64.zip > ghr.zip
unzip ghr.zip
./ghr --version
./ghr --debug -u DieterReuter -b "$GIT_RELTEXT" $GIT_TAG builds/$BUILD_NR/
./ghr --debug -u lucashalbert -b "$GIT_RELTEXT" $GIT_TAG builds/$BUILD_NR/