From nobody Tue Aug 16 21:39:44 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4M6l0x0Pngz4ZWC7; Tue, 16 Aug 2022 21:39:45 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4M6l0w71NFz3kkd; Tue, 16 Aug 2022 21:39:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660685985; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OhMmcisi52JdMvZgheTBg679uqFQYqYjxmNQ9gSBKeg=; b=DG1HdjAtZcb7vHd1dKmFnhIll/xZ+96sRxieBcJEJXYSLSrKMHydxukaksYzBvtlJLHtbJ CGgCC3fR9/GEj9u5j+/QvB3jPAvufO1KTxKgUQcYiKZ3riYs4mi2tzESKQsZ6xBjXuflxu /j26Sz0uoJjQJ+KDs7CE5ijQpxFVGFQqUnLKIV5vNLI/0Cm8kWQeX3zDB0roJ9Ibp+SILs lTxVqfmCi5gRviHRgOCffgnOxFGtUriV1V/4lkLP2wn0j9JGZTDwGNSIKSRd2lSQ1mSy+W 585vkPUVa7fB6+oO5FWIXFkTUUUChxxdQ7x4ehkijVY3Nxm6BS1uZfgRv5tQLA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4M6l0w64SFzPcq; Tue, 16 Aug 2022 21:39:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 27GLdih8000869; Tue, 16 Aug 2022 21:39:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27GLdiKx000868; Tue, 16 Aug 2022 21:39:44 GMT (envelope-from git) Date: Tue, 16 Aug 2022 21:39:44 GMT Message-Id: <202208162139.27GLdiKx000868@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 3d3f2fb069d9 - main - stand: Make makeroot.sh use makefs for ZFS List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3d3f2fb069d972785763e7ed4244d62e4e85cce0 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660685985; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OhMmcisi52JdMvZgheTBg679uqFQYqYjxmNQ9gSBKeg=; b=l/Ux82UK/2hv2yCdLsavzepL5F+NiKfbAhkDblymOnjz7fTsv5kcHO9BKPdj5JltNdgpVf zRnKbn65XFulNmvN2w3sKfg4lmzoMXPsnzizJYubCeXxmQwph5qLl7ROm9Bf6bB3JlM+oq VNw3xZq8se79AYXQqUkitKbd2evgb3rSltOWA/4r1oFPyMfuRUmuP4t+KofgsWYa2h+R+P s7nO1nYh2/3mgDh2zlC6X8nRu5zinsuEP3gHZOT2lGIbs88Ad5Vb7wdNSHrDNUPl0GewIr 5pwbTWVBIjlTjpY5T+yCf9t/tzfNSfhQRXLUfXCu4NyVrHsm2KwNJZ27a8gTbA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660685985; a=rsa-sha256; cv=none; b=AkwJxPStF65dT1psDsdiE1f7/1njalpi1k55xKIv/51oDD2bNLT41Vc3B326H/5V/gR5cs OerUsZrKFkqnZa/+e1X5bYsIQoZ9FzKzS87hxHt1k2ZVuNy9WJGEaMELOrAgD+2Qj8Ji14 zOlare37zI8sPGcqeydwr8QO+D/lc2biuKVwDQtnTPDKpETNb8xhVjyYeyWjx+Bt5bzU3R SLZFLe8/JqapVYRfYkdC+Sk29foWTFiq9E3SC2HLe97uzHaZ5qQ1NK3I4ZYpm8bLNamvPM nFdtVPG8Vsu2q+PcYA7fXIMwRvnSxquOCwxRDEAgMz+OL4/MXc08b1TOdo/QZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3d3f2fb069d972785763e7ed4244d62e4e85cce0 commit 3d3f2fb069d972785763e7ed4244d62e4e85cce0 Author: Warner Losh AuthorDate: 2022-08-16 17:29:25 +0000 Commit: Warner Losh CommitDate: 2022-08-16 21:36:55 +0000 stand: Make makeroot.sh use makefs for ZFS Start to use makefs for ZFS. This covers the gpt nogeli variants. ZFS MBR booting is tricky and complicated, so will need some additional tweaks that makefs/mkimg isn't able to do at the moment. This means that all gpt nogeli amd64 combinations can be built w/o root. In addition, tweak the generated qemu.sh files to use stdio for the console. We grep the output for SUCCESS and report each of the booting types. Create a all.sh that will run these automatically. These all can also run w/o root. In the future, I'll add support for a make univers followed by this script to create other architectures' tests and/or generate stand tests for /usr/tests... Sponsored by: Netflix --- tools/boot/rootgen.sh | 173 ++++++++++++++++++++++++-------------------------- 1 file changed, 82 insertions(+), 91 deletions(-) diff --git a/tools/boot/rootgen.sh b/tools/boot/rootgen.sh index 80554fb1b77d..f087afa5ad49 100755 --- a/tools/boot/rootgen.sh +++ b/tools/boot/rootgen.sh @@ -35,9 +35,9 @@ cpsys() { } ufs_fstab() { - src=$1 + dir=$1 - cat > ${src}/etc/fstab < ${dir}/etc/fstab < ${dst}/boot/loader.conf.local <> ${mntpt}/boot/loader.conf <> ${mntpt}/boot/loader.conf <> ${mntpt}/boot/loader.conf < $sh + echo "echo -n $(basename $sh .sh):' '" > $sh + echo "(qemu-system-x86_64 -m 256m --drive file=${img},format=raw ${qser} | tee $log 2>&1 | grep -q SUCCESS) && echo legacy pass || echo legacy fail" >> $sh chmod 755 $sh } @@ -664,8 +641,10 @@ qemu_amd64_uefi() { img=$1 sh=$2 + log=$(log_for $2) - echo "qemu-system-x86_64 -m 256m -bios ~/bios/OVMF-X64.fd --drive file=${img},format=raw ${qser}" > $sh + echo "echo -n $(basename $sh .sh):' '" > $sh + echo "(qemu-system-x86_64 -m 256m -bios ~/bios/OVMF-X64.fd --drive file=${img},format=raw ${qser} | tee $log 2>&1 | grep -q SUCCESS) && echo uefi pass || echo uefi fail" >> $sh chmod 755 $sh } @@ -673,9 +652,12 @@ qemu_amd64_both() { img=$1 sh=$2 + log=$(log_for $2) - echo "qemu-system-x86_64 -m 256m --drive file=${img},format=raw ${qser}" > $sh - echo "qemu-system-x86_64 -m 256m -bios ~/bios/OVMF-X64.fd --drive file=${img},format=raw ${qser}" >> $sh + echo "echo -n $(basename $sh .sh):' '" > $sh + echo "(qemu-system-x86_64 -m 256m --drive file=${img},format=raw ${qser} | tee $log 2>&1 | grep -q SUCCESS) && echo legacy pass || echo legacy fail" >> $sh + echo "echo -n $(basename $sh .sh):' '" >> $sh + echo "(qemu-system-x86_64 -m 256m -bios ~/bios/OVMF-X64.fd --drive file=${img},format=raw ${qser} | tee -a $log 2>&1 | grep -q SUCCESS) && echo uefi pass || echo uefi fail" >> $sh chmod 755 $sh } @@ -724,6 +706,8 @@ make_one_image() # Create sparse file and mount newly created filesystem(s) on it img=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.img sh=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.sh + echo "$sh" >> ${IMGDIR}/all.sh + echo date >> ${IMGDIR}/all.sh echo "vvvvvvvvvvvvvv Creating $img vvvvvvvvvvvvvvv" rm -f ${img}* eval mk_${geli}_${scheme}_${fs}_${bios} ${DESTDIR} ${img} ${MNTPT} ${geli} ${scheme} ${fs} ${bios} @@ -753,6 +737,7 @@ cp /boot/kernel/kernel ${DESTDIR}/boot/kernel echo -h -D -S115200 > ${DESTDIR}/boot.config cat > ${DESTDIR}/boot/loader.conf < ${IMGDIR}/all.sh +chmod +x ${IMGDIR}/all.sh + if [ $# -eq 5 ]; then make_one_image $* + echo ${IMGDIR}/all.sh exit fi # OK. Let the games begin for arch in amd64; do - for geli in nogeli geli; do + for geli in nogeli; do # geli for scheme in gpt mbr; do - for fs in ufs zfs; do + for fs in ufs ; do # zfs for bios in legacy uefi both; do make_one_image ${arch} ${geli} ${scheme} ${fs} ${bios} done @@ -797,6 +787,7 @@ for arch in amd64; do done done done +echo ${IMGDIR}/all.sh rmdir ${MNTPT}