Skip to content

Commit dfcb05c

Browse files
committed
CI: enable boot test for x86
deepin inclusin category: other Reuse the build result to test simple boot from qemu and qemu-kvm. The initrd is from busybox-static. It is cheap to detect some bug early. Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
1 parent 0d3594d commit dfcb05c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

.github/workflows/build-kernel.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,28 @@ jobs:
3232
make deepin_x86_desktop_defconfig
3333
make -j$(nproc)
3434
35+
- name: "Boot kernel Test"
36+
run: |
37+
# mkinitrd
38+
mkdir -p initrd/bin && cp /bin/busybox initrd/bin/
39+
for cmd in sh uname poweroff; do ln -sf busybox initrd/bin/$cmd; done
40+
echo -e '#!/bin/sh\nuname -a\npoweroff -f' > initrd/init && chmod +x initrd/init
41+
(cd initrd && find . | cpio -o -H newc | gzip > ../initrd.cpio.gz)
42+
# boot kernel and shutdown
43+
timeout 10 qemu-system-x86_64 -kernel arch/x86/boot/bzImage -initrd initrd.cpio.gz -append "console=ttyS0 loglevel=7" -serial stdio -display none && echo -e "\n[CI PASS]" || { echo -e "\n[CI FAIL]"; exit 1; }
44+
# boot kernel with kvm
45+
timeout 10 qemu-system-x86_64 --enable-kvm -kernel arch/x86/boot/bzImage -initrd initrd.cpio.gz -append "console=ttyS0 loglevel=7" -serial stdio -display none && echo -e "\n[CI PASS]" || { echo -e "\n[CI FAIL]"; exit 1; }
46+
3547
- name: "Clang build kernel"
3648
run: |
3749
# .config
3850
make LLVM=-18 deepin_x86_desktop_defconfig
3951
make LLVM=-18 -j$(nproc)
52+
53+
- name: "Boot kernel Test"
54+
run: |
55+
# reuse initrd and boot kernel and shutdown
56+
timeout 10 qemu-system-x86_64 -kernel arch/x86/boot/bzImage -initrd initrd.cpio.gz -append "console=ttyS0 loglevel=7" -serial stdio -display none && echo -e "\n[CI PASS]" || { echo -e "\n[CI FAIL]"; exit 1; }
57+
# boot kernel with kvm
58+
timeout 10 qemu-system-x86_64 --enable-kvm -kernel arch/x86/boot/bzImage -initrd initrd.cpio.gz -append "console=ttyS0 loglevel=7" -serial stdio -display none && echo -e "\n[CI PASS]" || { echo -e "\n[CI FAIL]"; exit 1; }
59+

0 commit comments

Comments
 (0)