Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions util/run-gnu-tests-smack-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,15 @@ echo "Setting up SMACK/ROOTFS test environment..."
rm -rf "$QEMU_DIR"
mkdir -p "$QEMU_DIR"/{rootfs/{bin,lib64,proc,sys,dev,tmp,etc,gnu},kernel}

# Copy Ubuntu kernel (runner's kernel does not work)
# Use Ubuntu kernel and busybox (runner's kernel is missing smack)
sudo apt-get update || :
sudo apt-get install -y linux-image-generic
sudo apt-get install -y --no-install-recommends linux-image-generic busybox #-static
sudo install -Dvm644 "$(ls -1 /boot/vmlinuz-*-generic | head -n 1)" "$QEMU_DIR/kernel/vmlinuz"

# Setup busybox
BUSYBOX=/tmp/busybox
[ -f "$BUSYBOX" ] || curl -sL -o "$BUSYBOX" https://busybox.net/downloads/binaries/1.35.0-x86_64-linux-musl/busybox
chmod +x "$BUSYBOX"
cp "$BUSYBOX" "$QEMU_DIR/rootfs/bin/"
(cd "$QEMU_DIR/rootfs/bin" && "$BUSYBOX" --list | xargs -I{} ln -sf busybox {} 2>/dev/null)
BUSYBOX=/bin/busybox
install -Dm755 "$BUSYBOX" -t "$QEMU_DIR/rootfs/bin"
(cd "$QEMU_DIR/rootfs/bin" && ./busybox --list | xargs -I{} ln -sf busybox {} 2>/dev/null)

# Copy required libraries
for lib in ld-linux-x86-64.so.2 libc.so.6 libm.so.6 libgcc_s.so.1 libpthread.so.0 libdl.so.2 librt.so.1; do
Expand Down Expand Up @@ -104,7 +102,7 @@ for TEST_PATH in $QEMU_TESTS; do

# Hardlink utilities for SMACK/ROOTFS tests
for U in $("$REPO_DIR/target/${PROFILE}/coreutils" --list); do
ln -vf "$REPO_DIR/target/${PROFILE}/coreutils" "$WORK/bin/$U"
ln -f "$REPO_DIR/target/${PROFILE}/coreutils" "$WORK/bin/$U"
done

# Set test script path and user
Expand Down
Loading