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

add tests for blobby_kernel #269

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
18 changes: 18 additions & 0 deletions .github/workflows/build-blobby-kernel-arm64.yml
Original file line number Diff line number Diff line change
@@ -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?
18 changes: 18 additions & 0 deletions .github/workflows/build-blobby-kernel-armhf.yml
Original file line number Diff line number Diff line change
@@ -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?
2 changes: 1 addition & 1 deletion .github/workflows/build-image-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-image-armhf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion kernel/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
50 changes: 0 additions & 50 deletions tests/build-image.sh

This file was deleted.

65 changes: 65 additions & 0 deletions tests/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/bin/bash

# This file is part of PrawnOS (https://www.prawnos.com)
# Copyright (c) 2020 Austin English <austinenglish@gmail.com>
# Copyright (c) 2020 Hal Emmerich <hal@halemmerich.com>

# 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 <https://www.gnu.org/licenses/>.

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