ci-qemu-test.sh: use pkgbase
Reviewed by: bcran (earlier), manu (earlier), imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24276
This commit is contained in:
parent
4fa9815a3d
commit
08d0b468f1
@ -1,11 +1,12 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Install loader, kernel, and enough of userland to boot in QEMU and echo
|
# Install pkgbase packages for loader, kernel, and enough of userland to boot
|
||||||
# "Hello world." from init, as a very quick smoke test for CI. Uses QEMU's
|
# in QEMU and echo "Hello world." from init, as a very quick smoke test for CI.
|
||||||
# virtual FAT filesystem to avoid the need to create a disk image. While
|
# Uses QEMU's virtual FAT filesystem to avoid the need to create a disk image.
|
||||||
# designed for CI automated testing, this script can also be run by hand as
|
# While designed for CI automated testing, this script can also be run by hand
|
||||||
# a quick smoke-test. The rootgen.sh and related scripts generate much more
|
# as a quick smoke-test as long as pkgbase packages have been built. The
|
||||||
# extensive tests for many combinations of boot env (ufs, zfs, geli, etc).
|
# rootgen.sh and related scripts generate much more extensive tests for many
|
||||||
|
# combinations of boot env (ufs, zfs, geli, etc).
|
||||||
#
|
#
|
||||||
# $FreeBSD$
|
# $FreeBSD$
|
||||||
|
|
||||||
@ -26,31 +27,21 @@ tempdir_cleanup()
|
|||||||
tempdir_setup()
|
tempdir_setup()
|
||||||
{
|
{
|
||||||
# Create minimal directory structure and populate it.
|
# Create minimal directory structure and populate it.
|
||||||
# Caller must cd ${SRCTOP} before calling this function.
|
|
||||||
|
|
||||||
for dir in dev bin efi/boot etc lib libexec sbin usr/lib usr/libexec; do
|
for dir in dev bin efi/boot etc lib libexec sbin usr/lib usr/libexec; do
|
||||||
mkdir -p ${ROOTDIR}/${dir}
|
mkdir -p ${ROOTDIR}/${dir}
|
||||||
done
|
done
|
||||||
|
|
||||||
# Install kernel, loader and minimal userland.
|
# Install kernel, loader and minimal userland.
|
||||||
|
cat<<EOF >${ROOTDIR}/pkg.conf
|
||||||
make -DNO_ROOT DESTDIR=${ROOTDIR} \
|
REPOS_DIR=[]
|
||||||
MODULES_OVERRIDE= \
|
repositories={local {url = file://$(dirname $OBJTOP)/repo/\${ABI}/latest}}
|
||||||
WITHOUT_DEBUG_FILES=yes \
|
EOF
|
||||||
WITHOUT_KERNEL_SYMBOLS=yes \
|
ASSUME_ALWAYS_YES=true INSTALL_AS_USER=true pkg \
|
||||||
installkernel
|
-o ABI_FILE=$OBJTOP/bin/sh/sh \
|
||||||
for dir in stand \
|
-C ${ROOTDIR}/pkg.conf -r ${ROOTDIR} install \
|
||||||
lib/libc lib/libedit lib/ncurses \
|
FreeBSD-kernel-generic FreeBSD-bootloader \
|
||||||
libexec/rtld-elf \
|
FreeBSD-clibs FreeBSD-runtime
|
||||||
bin/sh sbin/init sbin/shutdown sbin/sysctl; do
|
|
||||||
make -DNO_ROOT DESTDIR=${ROOTDIR} INSTALL="install -U" \
|
|
||||||
WITHOUT_DEBUG_FILES= \
|
|
||||||
WITHOUT_MAN= \
|
|
||||||
WITHOUT_PROFILE= \
|
|
||||||
WITHOUT_TESTS= \
|
|
||||||
WITHOUT_TOOLCHAIN= \
|
|
||||||
-C ${dir} install
|
|
||||||
done
|
|
||||||
|
|
||||||
# Put loader in standard EFI location.
|
# Put loader in standard EFI location.
|
||||||
mv ${ROOTDIR}/boot/loader.efi ${ROOTDIR}/efi/boot/BOOTx64.EFI
|
mv ${ROOTDIR}/boot/loader.efi ${ROOTDIR}/efi/boot/BOOTx64.EFI
|
||||||
@ -81,6 +72,10 @@ EOF
|
|||||||
if [ -z "${SRCTOP}" ]; then
|
if [ -z "${SRCTOP}" ]; then
|
||||||
die "Cannot locate top of source tree"
|
die "Cannot locate top of source tree"
|
||||||
fi
|
fi
|
||||||
|
: ${OBJTOP:=$(make -V OBJTOP)}
|
||||||
|
if [ -z "${OBJTOP}" ]; then
|
||||||
|
die "Cannot locate top of object tree"
|
||||||
|
fi
|
||||||
|
|
||||||
# Locate the uefi firmware file used by qemu.
|
# Locate the uefi firmware file used by qemu.
|
||||||
: ${OVMF:=/usr/local/share/uefi-edk2-qemu/QEMU_UEFI_CODE-x86_64.fd}
|
: ${OVMF:=/usr/local/share/uefi-edk2-qemu/QEMU_UEFI_CODE-x86_64.fd}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user