From 87dff0a2c775c5943ca9233e69c81a25f2ed1a77 Mon Sep 17 00:00:00 2001 From: Ilya Leoshkevich Date: Mon, 9 May 2022 12:59:54 +0200 Subject: [PATCH] vmtest: allow building foreign debian rootfs This would allow building s390x images without access to an IBM Z. Signed-off-by: Ilya Leoshkevich --- travis-ci/rootfs/mkrootfs_debian.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/travis-ci/rootfs/mkrootfs_debian.sh b/travis-ci/rootfs/mkrootfs_debian.sh index 2ccbb9f..7d36656 100755 --- a/travis-ci/rootfs/mkrootfs_debian.sh +++ b/travis-ci/rootfs/mkrootfs_debian.sh @@ -2,6 +2,11 @@ # This script builds a Debian root filesystem image for testing libbpf in a # virtual machine. Requires debootstrap >= 1.0.95 and zstd. +# Use e.g. ./mkrootfs_debian.sh --arch=s390x to generate a rootfs for a +# foreign architecture. Requires configured binfmt_misc, e.g. using +# Debian/Ubuntu's qemu-user-binfmt package or +# https://github.com/multiarch/qemu-user-static. + set -e -u -x -o pipefail # Check whether we are root now in order to avoid confusing errors later. @@ -16,7 +21,7 @@ trap 'rm -r "$root"' EXIT # Install packages. packages=binutils,busybox,elfutils,ethtool,iproute2,libcap2,libelf1,strace,zlib1g -debootstrap --include="$packages" --variant=minbase bookworm "$root" +debootstrap --include="$packages" --variant=minbase "$@" bookworm "$root" # Remove the init scripts (tests use their own). Also remove various # unnecessary files in order to save space.