mkosi boot (mainline) #182
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: mkosi boot (mainline) | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '0 10 * * *' | |
jobs: | |
mkosi-mainline: | |
if: ${{ github.repository == 'lkrg-org/lkrg' || github.event_name != 'schedule' }} | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- run: sudo apt-get update | |
- run: sudo apt-get install -y debootstrap qemu-system-x86 systemd-container expect sysvbanner | |
- name: Install mkosi from git | |
# Native focal package seems to be too old (v5) and not even | |
# able to build images properly. | |
run: | | |
sudo python3 -m pip install git+https://github.com/systemd/mkosi.git@v14 | |
sudo sed -i 's/linux-generic/linux-virtual/' /usr/local/lib/python*/dist-packages/mkosi/__init__.py | |
sudo rm -f /dev/kvm | |
echo /usr/local/bin >> $GITHUB_PATH | |
- name: Download mainline kernel from Kernel PPA | |
run: .github/workflows/ubuntu-kernel-daily.sh | |
- name: Enable LKRG debugging options | |
run: | | |
sed -i '/P_LKRG_JUMP_LABEL_STEXT_DEBUG/s/\/\///' src/modules/print_log/p_lkrg_print_log.h | |
git diff | |
- name: Create bootable image using mkosi | |
run: sudo mkosi -r ${{ env.series }} --cache=mkosi.cache --prepare-script=.github/workflows/dpkg-i.sh | |
- name: Boot image on qemu | |
run: | | |
sudo expect <<- EOF | tr -d '\r' | tee boot.log | |
proc abort {} { send_error "ABORT\n"; exit 1 } | |
spawn mkosi qemu -no-reboot | |
expect "Booting" { send "\r" } | |
set timeout 300 | |
expect "login: " {} default abort | |
set timeout 60 | |
expect "# " { send "/lkrg/.github/workflows/run-boot-tests.sh\r" } default abort | |
expect "# " { send "systemctl poweroff\r" } default abort | |
expect timeout abort eof { exit 0 } | |
EOF | |
shell: bash -eo pipefail {0} | |
- name: Check boot.log for 'LKRG initialized successfully' | |
run: | | |
grep 'Linux version' boot.log | |
grep 'LKRG initialized successfully' boot.log | |
- name: Check that boot.log does not contain problems | |
run: "! grep -E 'Kernel panic|BUG:|WARNING:|ALERT:|FAULT:|FATAL:|Oops|Call Trace' boot.log" | |
- name: Check that boot-tests script finished successfully | |
run: grep 'run-boot-tests.sh - SUCCESS' boot.log | |
- name: Check that boot.log contains shutdown sequence | |
run: | | |
grep 'Reached target.*Power.Off' boot.log | |
grep 'reboot: Power down' boot.log | |
# vim: sw=4 |