From owner-svn-src-head@freebsd.org Sat Sep 5 19:03:34 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D49FE3D368D; Sat, 5 Sep 2020 19:03:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BkP8Q59wpz3WS9; Sat, 5 Sep 2020 19:03:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 951C0224CF; Sat, 5 Sep 2020 19:03:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 085J3Y3x015518; Sat, 5 Sep 2020 19:03:34 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 085J3YCE015517; Sat, 5 Sep 2020 19:03:34 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202009051903.085J3YCE015517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 5 Sep 2020 19:03:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365365 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 365365 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Sep 2020 19:03:34 -0000 Author: emaste Date: Sat Sep 5 19:03:34 2020 New Revision: 365365 URL: https://svnweb.freebsd.org/changeset/base/365365 Log: 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 Modified: head/tools/boot/ci-qemu-test.sh Modified: head/tools/boot/ci-qemu-test.sh ============================================================================== --- head/tools/boot/ci-qemu-test.sh Sat Sep 5 17:02:48 2020 (r365364) +++ head/tools/boot/ci-qemu-test.sh Sat Sep 5 19:03:34 2020 (r365365) @@ -1,11 +1,12 @@ #!/bin/sh -# Install loader, kernel, and enough of userland to boot in QEMU and echo -# "Hello world." from init, as a very quick smoke test for CI. Uses QEMU's -# virtual FAT filesystem to avoid the need to create a disk image. While -# designed for CI automated testing, this script can also be run by hand as -# a quick smoke-test. The rootgen.sh and related scripts generate much more -# extensive tests for many combinations of boot env (ufs, zfs, geli, etc). +# Install pkgbase packages for loader, kernel, and enough of userland to boot +# in QEMU and echo "Hello world." from init, as a very quick smoke test for CI. +# Uses QEMU's virtual FAT filesystem to avoid the need to create a disk image. +# While designed for CI automated testing, this script can also be run by hand +# as a quick smoke-test as long as pkgbase packages have been built. The +# rootgen.sh and related scripts generate much more extensive tests for many +# combinations of boot env (ufs, zfs, geli, etc). # # $FreeBSD$ @@ -26,32 +27,22 @@ tempdir_cleanup() tempdir_setup() { # 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 mkdir -p ${ROOTDIR}/${dir} done # Install kernel, loader and minimal userland. + cat<${ROOTDIR}/pkg.conf +REPOS_DIR=[] +repositories={local {url = file://$(dirname $OBJTOP)/repo/\${ABI}/latest}} +EOF + ASSUME_ALWAYS_YES=true INSTALL_AS_USER=true pkg \ + -o ABI_FILE=$OBJTOP/bin/sh/sh \ + -C ${ROOTDIR}/pkg.conf -r ${ROOTDIR} install \ + FreeBSD-kernel-generic FreeBSD-bootloader \ + FreeBSD-clibs FreeBSD-runtime - make -DNO_ROOT DESTDIR=${ROOTDIR} \ - MODULES_OVERRIDE= \ - WITHOUT_DEBUG_FILES=yes \ - WITHOUT_KERNEL_SYMBOLS=yes \ - installkernel - for dir in stand \ - lib/libc lib/libedit lib/ncurses \ - libexec/rtld-elf \ - 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. mv ${ROOTDIR}/boot/loader.efi ${ROOTDIR}/efi/boot/BOOTx64.EFI @@ -80,6 +71,10 @@ EOF : ${SRCTOP:=$(make -V SRCTOP)} if [ -z "${SRCTOP}" ]; then die "Cannot locate top of source tree" +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.