Skip to content

Commit abd642e

Browse files
committed
testing: Enable efi tests
Signed-off-by: Alexey Gladkov <[email protected]>
1 parent 1fc4acc commit abd642e

File tree

6 files changed

+131
-251
lines changed

6 files changed

+131
-251
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 159 deletions
Original file line numberDiff line numberDiff line change
@@ -10,118 +10,24 @@ on:
1010
schedule:
1111
- cron: "0 0 * * MON"
1212
jobs:
13-
verify:
14-
name: "Verify"
15-
runs-on: ubuntu-24.04
16-
steps:
17-
- name: "Checkout Repository"
18-
uses: actions/checkout@v4
19-
20-
- name: "Checkout Submodules"
21-
run: |
22-
git submodule set-url external/busybox/upstream https://github.com/mirror/busybox
23-
git submodule update --init --recursive
24-
25-
- name: "Setup host"
26-
run: |
27-
sudo sysctl -w kernel.unprivileged_userns_clone=1 ||:
28-
sudo sysctl -w kernel.apparmor_restrict_unprivileged_unconfined=0 ||:
29-
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 ||:
30-
31-
- name: "Install Tools"
32-
run: |
33-
sudo apt-get -y -qq install \
34-
gcc make automake autoconf pkg-config udev scdoc \
35-
libkmod-dev libz-dev libbz2-dev liblzma-dev libzstd-dev libelf-dev libtirpc-dev libcrypt-dev
36-
sudo apt-get -y -qq install astyle
37-
sudo apt-get -y -qq install shellcheck
38-
39-
- name: "Configure"
40-
run: |
41-
./autogen.sh
42-
./configure --enable-local-build
43-
44-
- name: "Build Sources"
45-
run: |
46-
make
47-
48-
- name: "Prepare Gittree"
49-
run: |
50-
git config --global user.email "[email protected]"
51-
git config --global user.name "GitHubCI commiter"
52-
git commit -a -m 'CI: update git tree'
53-
54-
- name: "Indent-c"
55-
run: |
56-
make indent-c && git diff --exit-code
57-
58-
- name: "ShellCheck"
59-
run: |
60-
make verify
61-
62-
- name: "Check services"
63-
run: |
64-
export PATH="$PWD/external/libshell/upstream:$PATH"
65-
make check-services
66-
67-
- name: "Unit Tests"
68-
run: |
69-
export PATH="$PWD/external/libshell/upstream:$PATH"
70-
make check-unit
71-
72-
7313
e2e-local:
7414
name: "${{ matrix.name }} ${{ matrix.test }} ${{ matrix.testcase }}"
75-
needs: [ verify ]
7615
runs-on: ubuntu-latest
7716
strategy:
7817
matrix:
7918
name: [
80-
"altlinux",
81-
"fedora",
8219
"ubuntu",
8320
]
8421
test: [
8522
"local",
8623
]
8724
testcase: [
88-
"btrfs-subvol",
8925
"efi-partition",
90-
"efi-reqpartition",
91-
"f2fs-partition",
92-
"luks",
93-
"luks+crypttab+noparam",
94-
"luks+lukskey-noparam",
95-
"luks+lukskey-plain",
96-
"luks+lukskey-raw",
97-
"luks-over-lvm",
98-
"luks-over-raid1",
99-
"lvm",
100-
"lvm+luks",
101-
"partition",
102-
"partition+usr",
103-
"pipeline",
104-
"raid1",
105-
"raid1+raid5",
106-
"raid1-degraded",
107-
"raid5",
108-
"sdcard",
109-
"xfs-partition",
110-
"zfs-partition",
11126
]
11227
exclude:
113-
- name: fedora
114-
testcase: efi-partition
115-
- name: fedora
116-
testcase: efi-reqpartition
11728
- name: fedora
11829
testcase: zfs-partition
11930

120-
- name: ubuntu
121-
testcase: efi-partition
122-
- name: ubuntu
123-
testcase: efi-reqpartition
124-
12531
- name: altlinux
12632
testcase: zfs-partition
12733

@@ -184,73 +90,9 @@ jobs:
18490
retention-days: 1
18591

18692

187-
e2e-network:
188-
name: "${{ matrix.name }} ${{ matrix.test }} ${{ matrix.testcase }}"
189-
needs: [ verify ]
190-
runs-on: ubuntu-latest
191-
strategy:
192-
matrix:
193-
name: [
194-
"altlinux",
195-
]
196-
test: [
197-
"sshfs",
198-
]
199-
testcase: [
200-
"sshfs-network-dhcp",
201-
"sshfs-network-static1",
202-
]
203-
fail-fast: false
204-
steps:
205-
- name: "Prepare Node"
206-
run: |
207-
for m in kvm kvm-amd kvm-intel; do sudo modprobe -v "$m" ||:; done
208-
test -c /dev/kvm && sudo chmod -v 666 /dev/kvm ||:
209-
210-
- name: "Install packages"
211-
run: |
212-
sudo apt-get -qq -y update
213-
sudo apt-get -qq -y install git qemu-kvm
214-
215-
- name: "Checkout Repository"
216-
uses: actions/checkout@v4
217-
218-
- name: "Checkout submodules"
219-
run: |
220-
git submodule set-url external/busybox/upstream https://github.com/mirror/busybox
221-
git submodule update --init --recursive
222-
223-
- name: "Build Sources"
224-
run: testing/testing-${{ matrix.name }}-${{ matrix.test }} test-root-${{ matrix.testcase }} build-git
225-
226-
- name: "Build Sysimage"
227-
run: testing/testing-${{ matrix.name }}-${{ matrix.test }} test-root-${{ matrix.testcase }} build-sysimage
228-
229-
- name: "Build Other Tools"
230-
run: testing/testing-${{ matrix.name }}-${{ matrix.test }} test-root-${{ matrix.testcase }} build-tools
231-
232-
- name: "Run Services"
233-
run: testing/testing-${{ matrix.name }}-${{ matrix.test }} test-root-${{ matrix.testcase }} run-services
234-
235-
- name: "Boot System"
236-
env:
237-
QEMU_TIMEOUT: 10m
238-
QEMU_MEMORY: 1G
239-
QEMU_DISK_FORMAT: qcow2
240-
run: testing/testing-${{ matrix.name }}-${{ matrix.test }} test-root-${{ matrix.testcase }} run-boot
241-
242-
- name: "Archive Metrics"
243-
uses: actions/upload-artifact@v4
244-
with:
245-
name: "metrics-${{ matrix.name }}-${{ matrix.test }}-${{ matrix.testcase }}"
246-
path: testing/status/artifact-*.txt
247-
if-no-files-found: ignore
248-
retention-days: 1
249-
250-
25193
metrics:
25294
name: "Metrics"
253-
needs: [ e2e-local, e2e-network ]
95+
needs: [ e2e-local ]
25496
runs-on: ubuntu-latest
25597
if: success() || failure()
25698
steps:

features/kickstart/rules.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-3.0-or-later
22
KICKSTART_DIRS := $(shell $(call shell-export-vars) $(FEATURESDIR)/kickstart/bin/get-ks-configs)
33

4-
FAT_MODULES = nls_cp866 nls_utf8 fs-vfat
4+
FAT_MODULES = fs-vfat /fs/nls/
55
ZFS_MODULES = zfs
66

77
MODULES_ADD += $(LUKS_MODULES) drivers/md/raid

testing/packages-fedora

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ MAKE_INITRD_PACKAGES_DEVEL+=" json-c-devel"
1111

1212
KERNEL_PACKAGES="kernel kernel-modules"
1313

14-
BOOTLOADER_EFI_PACKAGES="grub2-efi-x64 grub2-efi-x64-modules"
14+
BOOTLOADER_EFI_PACKAGES="systemd-boot-unsigned"
1515
BOOTLOADER_PC_PACKAGES="grub2-pc grub2-pc-modules"
1616

1717
SYSIMAGE_BASE_PACKAGES="$MAKE_INITRD_PACKAGES $KERNEL_PACKAGES systemd"

testing/packages-ubuntu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ MAKE_INITRD_PACKAGES_DEVEL+=" libjson-c-dev"
1111

1212
KERNEL_PACKAGES="linux-generic"
1313

14-
BOOTLOADER_EFI_PACKAGES="grub-efi"
14+
BOOTLOADER_EFI_PACKAGES="systemd-boot systemd-boot-efi"
1515
BOOTLOADER_PC_PACKAGES="grub-pc"
1616

1717
SYSIMAGE_BASE_PACKAGES="$MAKE_INITRD_PACKAGES $KERNEL_PACKAGES systemd"

testing/testing-fedora-ks-initrd.cfg

Lines changed: 60 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
%post --erroronfail
22
set -xefu
33

4-
mkdir -p /proc
5-
mount -t proc proc /proc
4+
export PATH="/srv/.build/dest/usr/sbin:/srv/.build/dest/usr/bin:$PATH"
5+
kver="$(find /lib/modules -mindepth 1 -maxdepth 1 -printf '%f\n' -quit)"
66

7-
mkdir -p /sys
8-
mount -t sysfs sysfs /sys
7+
mkdir -p /proc /sys /dev
98

10-
mkdir -p /dev
9+
mount -t proc proc /proc
10+
mount -t sysfs sysfs /sys
1111
mount -t devtmpfs devfs /dev
1212

1313
! blkid -L "EFI" >/dev/null ||
@@ -22,23 +22,9 @@
2222
`[ ! -f /etc/initrd.mk.addon ] || cat /etc/initrd.mk.addon`
2323
EOF
2424

25-
grub_install="$( for f in grub-install grub2-install; do type -P "$f" && break; done )"
26-
grub_mkconfig="$( for f in grub-mkconfig grub2-mkconfig; do type -P "$f" && break; done )"
27-
grub_bootdir="$( find /boot -type d \( -name 'grub' -o -name 'grub2' \) )"
28-
grub_params="/etc/default/grub"
29-
30-
kver="$(find /lib/modules -mindepth 1 -maxdepth 1 -printf '%f\n' -quit)"
31-
32-
export PATH="/srv/.build/dest/usr/sbin:/srv/.build/dest/usr/bin:$PATH"
33-
34-
env -i PATH="$PATH" \
35-
/srv/.build/dest/usr/sbin/make-initrd -k "$kver"
36-
3725
tee /sbin/init.once <<-EOF
3826
#!/bin/sh
39-
echo; echo;
40-
echo 'IT WORKS!'
41-
echo; echo;
27+
printf '\n\n\n%s\n\n\n' 'IT WORKS!'
4228
exec systemctl reboot
4329
EOF
4430
chmod +x /sbin/init.once
@@ -49,40 +35,73 @@
4935
DefaultDependencies=no
5036
After=systemd-user-sessions.service plymouth-quit-wait.service
5137
Before=system-getty.slice
52-
5338
[Service]
5439
Type=oneshot
5540
ExecStart=/sbin/init.once
5641
RemainAfterExit=yes
5742
StandardOutput=tty
58-
5943
[Install]
6044
WantedBy=sysinit.target
6145
EOF
6246

6347
systemctl enable init-once
6448

65-
tee -a "$grub_params" <<-EOF
66-
GRUB_CMDLINE_LINUX_DEFAULT='console=ttyS0,115200n8 @CMDLINE@'
67-
GRUB_TIMEOUT=3
68-
GRUB_TERMINAL_INPUT='serial console'
69-
GRUB_TERMINAL_OUTPUT='serial console'
70-
GRUB_SERIAL_COMMAND='serial --unit=0 --speed=115200'
71-
GRUB_DISABLE_LINUX_UUID=true
72-
GRUB_DISABLE_LINUX_PARTUUID=true
73-
GRUB_ENABLE_BLSCFG=false
74-
GRUB_DEVICE=root=LABEL=root
75-
EOF
76-
77-
bootdev=$(findmnt -k -no SOURCE -T /boot)
78-
syspath="$(readlink -ev "/sys/class/block/${bootdev#/dev/}")"
79-
syspath="${syspath%/*}/uevent"
80-
bootdev="$(sed -n -e 's,^DEVNAME=,/dev/,p' "$syspath")"
49+
env -i PATH="$PATH" \
50+
/srv/.build/dest/usr/sbin/make-initrd -k "$kver"
8151

82-
"$grub_install" "$bootdev"
83-
"$grub_mkconfig" -o "$grub_bootdir/grub.cfg"
52+
if blkid -L "EFI" >/dev/null; then
53+
bootctl install
54+
55+
bootdir="$(bootctl --print-esp-path)"
56+
57+
mkdir -p -- "$bootdir"/loader/entries
58+
mv -f -- \
59+
"/boot/vmlinuz-$kver" \
60+
"/boot/initramfs-$kver.img" \
61+
"$bootdir"
62+
63+
tee "$bootdir"/loader/loader.conf <<-EOF
64+
default default-kernel
65+
timeout 0
66+
EOF
67+
68+
tee "$bootdir"/loader/entries/default-kernel.conf <<-EOF
69+
title Default Linux
70+
linux /vmlinuz-$kver
71+
initrd /initramfs-$kver.img
72+
options console=ttyS0,115200n8 @CMDLINE@
73+
EOF
74+
75+
bootctl --no-pager
76+
else
77+
grub_install="$( for f in grub-install grub2-install; do type -P "$f" && break; done )"
78+
grub_mkconfig="$( for f in grub-mkconfig grub2-mkconfig; do type -P "$f" && break; done )"
79+
grub_bootdir="$( find /boot -type d \( -name 'grub' -o -name 'grub2' \) )"
80+
grub_params="/etc/default/grub"
81+
82+
tee -a "$grub_params" <<-EOF
83+
GRUB_CMDLINE_LINUX_DEFAULT='console=ttyS0,115200n8 @CMDLINE@'
84+
GRUB_TIMEOUT=3
85+
GRUB_TERMINAL_INPUT='serial console'
86+
GRUB_TERMINAL_OUTPUT='serial console'
87+
GRUB_SERIAL_COMMAND='serial --unit=0 --speed=115200'
88+
GRUB_DISABLE_LINUX_UUID=true
89+
GRUB_DISABLE_LINUX_PARTUUID=true
90+
GRUB_ENABLE_BLSCFG=false
91+
GRUB_DEVICE=root=LABEL=root
92+
EOF
93+
94+
bootdev=$(findmnt -k -no SOURCE -T /boot)
95+
syspath="$(readlink -ev "/sys/class/block/${bootdev#/dev/}")"
96+
syspath="${syspath%/*}/uevent"
97+
bootdev="$(sed -n -e 's,^DEVNAME=,/dev/,p' "$syspath")"
98+
99+
"$grub_install" "$bootdev"
100+
"$grub_mkconfig" -o "$grub_bootdir/grub.cfg"
101+
102+
cat "$grub_params"
103+
fi
84104

85-
cat "$grub_params"
86105
{
87106
find /boot \! -type d -printf '%M %p\n'
88107
find /boot -type l -printf '%M %p -> %l\n'

0 commit comments

Comments
 (0)