From 925f91390d214788ce01dfb2de08cb963898f5a2 Mon Sep 17 00:00:00 2001 From: Austin English Date: Sun, 20 Dec 2020 00:42:04 -0600 Subject: [PATCH 1/2] kernel/makefile: require image to be built before building kernel --- kernel/makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/makefile b/kernel/makefile index 2fff4b8a9..e027bfb86 100644 --- a/kernel/makefile +++ b/kernel/makefile @@ -53,7 +53,7 @@ KERNEL_ATH9K_INSTALLED := $(KERNEL_ATH9K_FIRMWARES)/htc_9271.fw ### PHONY RULES .PHONY: kernel -kernel: $(PRAWNOS_KERNEL_BUILT) +kernel: filesystem $(PRAWNOS_KERNEL_BUILT) .PHONY: ath9k ath9k: $(ATH9K_BUILT) From 2f7dbb503dcffd9bd4c9a3e66369145696f452e1 Mon Sep 17 00:00:00 2001 From: Austin English Date: Tue, 15 Dec 2020 04:52:11 -0600 Subject: [PATCH 2/2] .github/workflows/build-blobby-kernel-*.yml: test building blobby kernel --- .../workflows/build-blobby-kernel-arm64.yml | 18 +++++ .../workflows/build-blobby-kernel-armhf.yml | 18 +++++ .github/workflows/build-image-arm64.yml | 2 +- .github/workflows/build-image-armhf.yml | 2 +- tests/build-image.sh | 50 -------------- tests/build.sh | 65 +++++++++++++++++++ 6 files changed, 103 insertions(+), 52 deletions(-) create mode 100644 .github/workflows/build-blobby-kernel-arm64.yml create mode 100644 .github/workflows/build-blobby-kernel-armhf.yml delete mode 100755 tests/build-image.sh create mode 100755 tests/build.sh diff --git a/.github/workflows/build-blobby-kernel-arm64.yml b/.github/workflows/build-blobby-kernel-arm64.yml new file mode 100644 index 000000000..15ea59807 --- /dev/null +++ b/.github/workflows/build-blobby-kernel-arm64.yml @@ -0,0 +1,18 @@ +# test building the blobby kernel +# (We don't need to build the libre kernel, as that's done as part of build-image-arm64) +name: build-blobby-kernel-arm64 + +on: [push, pull_request] +jobs: + build: + name: build + runs-on: ubuntu-20.04 + steps: + - name: checkout project + uses: actions/checkout@v2 + - name: build blobby-kernel + run: sudo dpkg -i ./tests/resources/qemu-user-static_5.1+dfsg-4+b1_amd64.deb && + docker run --mount type=bind,source=$PWD,target=/PrawnOS + --privileged -v/dev:/dev debian:bullseye + /bin/bash /PrawnOS/tests/build.sh "$GITHUB_SHA" arm64 Shiba kernel + # FIXME: can we make the binary available without upsetting FSF? diff --git a/.github/workflows/build-blobby-kernel-armhf.yml b/.github/workflows/build-blobby-kernel-armhf.yml new file mode 100644 index 000000000..8bfac718c --- /dev/null +++ b/.github/workflows/build-blobby-kernel-armhf.yml @@ -0,0 +1,18 @@ +# test building the blobby kernel +# (We don't need to build the libre kernel, as that's done as part of build-image-armhf) +name: build-blobby-kernel-armhf + +on: [push, pull_request] +jobs: + build: + name: build + runs-on: ubuntu-20.04 + steps: + - name: checkout project + uses: actions/checkout@v2 + - name: build blobby-kernel + run: sudo dpkg -i ./tests/resources/qemu-user-static_5.1+dfsg-4+b1_amd64.deb && + docker run --mount type=bind,source=$PWD,target=/PrawnOS + --privileged -v/dev:/dev debian:bullseye + /bin/bash /PrawnOS/tests/build.sh "$GITHUB_SHA" armhf Shiba kernel + # FIXME: can we make the binary available without upsetting FSF? diff --git a/.github/workflows/build-image-arm64.yml b/.github/workflows/build-image-arm64.yml index 6f406db8c..ea1852b68 100644 --- a/.github/workflows/build-image-arm64.yml +++ b/.github/workflows/build-image-arm64.yml @@ -14,7 +14,7 @@ jobs: run: sudo dpkg -i ./tests/resources/qemu-user-static_5.1+dfsg-4+b1_amd64.deb && docker run --mount type=bind,source=$PWD,target=/PrawnOS --privileged -v/dev:/dev debian:bullseye - /bin/bash /PrawnOS/tests/build-image.sh "$GITHUB_SHA" arm64 Shiba + /bin/bash /PrawnOS/tests/build.sh "$GITHUB_SHA" arm64 Shiba image - name: publish image uses: actions/upload-artifact@v2 with: diff --git a/.github/workflows/build-image-armhf.yml b/.github/workflows/build-image-armhf.yml index 035575077..b25bc4555 100644 --- a/.github/workflows/build-image-armhf.yml +++ b/.github/workflows/build-image-armhf.yml @@ -14,7 +14,7 @@ jobs: run: sudo dpkg -i ./tests/resources/qemu-user-static_5.1+dfsg-4+b1_amd64.deb && docker run --mount type=bind,source=$PWD,target=/PrawnOS --privileged -v/dev:/dev debian:bullseye - /bin/bash /PrawnOS/tests/build-image.sh "$GITHUB_SHA" armhf Shiba + /bin/bash /PrawnOS/tests/build.sh "$GITHUB_SHA" armhf Shiba image - name: publish image uses: actions/upload-artifact@v2 with: diff --git a/tests/build-image.sh b/tests/build-image.sh deleted file mode 100755 index 9528c1db0..000000000 --- a/tests/build-image.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash - -# This file is part of PrawnOS (https://www.prawnos.com) -# Copyright (c) 2020 Austin English -# Copyright (c) 2020 Hal Emmerich - -# PrawnOS is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 -# as published by the Free Software Foundation. - -# PrawnOS is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with PrawnOS. If not, see . - -set -e -set -x - -GITHUB_SHA="$1" -TEST_TARGET="$2" -RELEASE_VERSION="$3" - -IMG="PrawnOS-${RELEASE_VERSION}-${TEST_TARGET}" -IMAGE="${IMG}.img" -IMAGE_GIT="${IMG}-git-${GITHUB_SHA}.img" - -cd "$(dirname "$0")/.." - -# Get dependencies -apt-get update - -## even farther future TODO: break into tests for each package, step in build process - -#required basic dependencies for build system -apt install -y make git - -make install_dependencies_yes TARGET=$TEST_TARGET - -# Note: there's an error for /proc/modules, but at least building the image works fine: -# libkmod: ERROR ../libkmod/libkmod-module.c:1657 kmod_module_new_from_loaded: could not open /proc/modules: No such file or directory -make image TARGET=$TEST_TARGET - -# rename the image to include git sha: -mv $IMAGE $IMAGE_GIT - -# compress, otherwise downloads take forever -xz -1 $IMAGE_GIT diff --git a/tests/build.sh b/tests/build.sh new file mode 100755 index 000000000..774951c2e --- /dev/null +++ b/tests/build.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +# This file is part of PrawnOS (https://www.prawnos.com) +# Copyright (c) 2020 Austin English +# Copyright (c) 2020 Hal Emmerich + +# PrawnOS is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 +# as published by the Free Software Foundation. + +# PrawnOS is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with PrawnOS. If not, see . + +set -e +set -x + +GITHUB_SHA="$1" +TEST_TARGET="$2" +RELEASE_VERSION="$3" +BUILD_TYPE="$4" + +IMG="PrawnOS-${RELEASE_VERSION}-${TEST_TARGET}" +IMAGE="${IMG}.img" +IMAGE_GIT="${IMG}-git-${GITHUB_SHA}.img" + +cd "$(dirname "$0")/.." + +# Get dependencies: +apt-get update + +# Currently, only kernel/blobby_kernel/image are supported. The prereqs may change if other targets are added: + +# Required basic dependencies for build system: +apt install -y make git +make install_dependencies_yes TARGET=$TEST_TARGET + +## Build stuff: + case "$BUILD_TYPE" in + ## Note: there's an error for /proc/modules, but at least building the kernel/image works fine: + ## libkmod: ERROR ../libkmod/libkmod-module.c:1657 kmod_module_new_from_loaded: could not open /proc/modules: No such file or directory + blobby_kernel) + make blobby_kernel TARGET=$TEST_TARGET + # FIXME: do we want to make it available via github actions? + ;; + image) + make image TARGET=$TEST_TARGET + # rename the image to include git sha: + mv $IMAGE $IMAGE_GIT + # compress, otherwise downloads take forever + xz -1 $IMAGE_GIT + ;; + kernel) + make kernel TARGET=$TEST_TARGET + # FIXME: do we want to make it available via github actions? + ;; + *) + echo "ERROR: BUILD_TYPE must be specified: (blobby_kernel|image|kernel)" + exit 1 + ;; + esac