-
Notifications
You must be signed in to change notification settings - Fork 7
65 lines (57 loc) · 2.8 KB
/
mkosi-mainline.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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