Skip to content

Commit 75b4d5d

Browse files
committed
run-gnu-tests-smack-ci.sh: copy kernel from Ubuntu runner
1 parent 8bff321 commit 75b4d5d

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

util/run-gnu-tests-smack-ci.sh

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
# Run GNU SMACK/ROOTFS tests in QEMU with SMACK-enabled kernel
33
# Usage: run-gnu-tests-smack-ci.sh [GNU_DIR] [OUTPUT_DIR]
4-
# spell-checker:ignore rootfs zstd unzstd cpio newc nographic smackfs devtmpfs tmpfs poweroff libm libgcc libpthread libdl librt sysfs rwxat setuidgid
4+
# spell-checker:ignore commoncap rootfs zstd unzstd cpio newc nographic smackfs devtmpfs tmpfs poweroff libm libgcc libpthread libdl librt sysfs rwxat setuidgid
55
set -e
66

77
: ${PROFILE:=release-small}
@@ -15,18 +15,8 @@ echo "Setting up SMACK/ROOTFS test environment..."
1515
rm -rf "$QEMU_DIR"
1616
mkdir -p "$QEMU_DIR"/{rootfs/{bin,lib64,proc,sys,dev,tmp,etc,gnu},kernel}
1717

18-
# Download Arch Linux kernel (has SMACK built-in)
19-
if [ ! -f /tmp/arch-vmlinuz ]; then
20-
echo "Downloading Arch Linux kernel..."
21-
curl -sL --retry 5 --retry-delay 2 --retry-all-errors \
22-
-o /tmp/arch-kernel.pkg.tar.zst "https://archlinux.org/packages/core/x86_64/linux/download/"
23-
zstd -d /tmp/arch-kernel.pkg.tar.zst -o /tmp/arch-kernel.pkg.tar 2>/dev/null || unzstd /tmp/arch-kernel.pkg.tar.zst -o /tmp/arch-kernel.pkg.tar
24-
VMLINUZ_PATH=$(tar -tf /tmp/arch-kernel.pkg.tar | grep 'vmlinuz$' | head -1)
25-
tar -xf /tmp/arch-kernel.pkg.tar -C /tmp "$VMLINUZ_PATH"
26-
mv "/tmp/$VMLINUZ_PATH" /tmp/arch-vmlinuz
27-
rm -rf /tmp/usr /tmp/arch-kernel.pkg.tar /tmp/arch-kernel.pkg.tar.zst
28-
fi
29-
cp /tmp/arch-vmlinuz "$QEMU_DIR/kernel/vmlinuz"
18+
# Copy runner's kernel
19+
sudo install -Dm644 /boot/vmlinuz-"$(uname -r)" "$QEMU_DIR/kernel/vmlinuz"
3020

3121
# Setup busybox
3222
BUSYBOX=/tmp/busybox
@@ -129,7 +119,7 @@ for TEST_PATH in $QEMU_TESTS; do
129119
OUTPUT=$(timeout 120 qemu-system-x86_64 \
130120
-kernel "$QEMU_DIR/kernel/vmlinuz" \
131121
-initrd "$WORK.gz" \
132-
-append "console=ttyS0 quiet panic=-1 security=smack lsm=smack" \
122+
-append "console=ttyS0 quiet panic=-1 lsm=capability,smack,commoncap security=smack apparmor=0" \
133123
-nographic -m 256M -no-reboot 2>&1) || true
134124

135125
# Determine result

0 commit comments

Comments
 (0)