From owner-svn-src-head@freebsd.org Mon Jul 2 22:51:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 855C0FE0E48; Mon, 2 Jul 2018 22:51:49 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 314487DEC9; Mon, 2 Jul 2018 22:51:49 +0000 (UTC) (envelope-from ian@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 EC5C613D19; Mon, 2 Jul 2018 22:51:48 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w62MpmK5015048; Mon, 2 Jul 2018 22:51:48 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w62MpmlW015047; Mon, 2 Jul 2018 22:51:48 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201807022251.w62MpmlW015047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 2 Jul 2018 22:51:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335876 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 335876 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.27 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: Mon, 02 Jul 2018 22:51:49 -0000 Author: ian Date: Mon Jul 2 22:51:48 2018 New Revision: 335876 URL: https://svnweb.freebsd.org/changeset/base/335876 Log: Allow making just one flavor of boot-test image based on cmdline args. Modified: head/tools/boot/rootgen.sh Modified: head/tools/boot/rootgen.sh ============================================================================== --- head/tools/boot/rootgen.sh Mon Jul 2 21:20:36 2018 (r335875) +++ head/tools/boot/rootgen.sh Mon Jul 2 22:51:48 2018 (r335876) @@ -740,6 +740,25 @@ qemu_i386_both() echo "qemu-system-i386 -bios ~/bios/OVMF-X32.fd --drive file=${img},format=raw ${qser}" >> $sh } +make_one_image() +{ + local arch=${1?} + local geli=${2?} + local scheme=${3?} + local fs=${4?} + local bios=${5?} + + # 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 "vvvvvvvvvvvvvv Creating $img vvvvvvvvvvvvvvv" + rm -f ${img}* + eval mk_${geli}_${scheme}_${fs}_${bios} ${DESTDIR} ${img} ${MNTPT} ${geli} ${scheme} ${fs} ${bios} + eval qemu_${arch}_${bios} ${img} ${sh} + [ -n "${SUDO_USER}" ] && chown ${SUDO_USER} ${img}* + echo "^^^^^^^^^^^^^^ Created $img ^^^^^^^^^^^^^^^" +} + # mips # qemu-system-mips -kernel /path/to/rootfs/boot/kernel/kernel -nographic -hda /path/to/disk.img -m 2048 @@ -791,6 +810,13 @@ echo "RC COMMAND RUNNING -- SUCCESS!!!!!" halt -p EOF +# If we were given exactly 5 args, go make that one image. + +if [ $# -eq 5 ]; then + make_one_image $* + exit +fi + # OK. Let the games begin for arch in amd64; do @@ -798,15 +824,7 @@ for arch in amd64; do for scheme in gpt mbr; do for fs in ufs zfs; do for bios in legacy uefi both; do - # 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 "vvvvvvvvvvvvvvvvvvvvvv Creating $img vvvvvvvvvvvvvvvvvvvvvvv" - rm -f ${img}* - eval mk_${geli}_${scheme}_${fs}_${bios} ${DESTDIR} ${img} ${MNTPT} ${geli} ${scheme} ${fs} ${bios} - eval qemu_${arch}_${bios} ${img} ${sh} - [ -n "${SUDO_USER}" ] && chown ${SUDO_USER} ${img}* - echo "^^^^^^^^^^^^^^^^^^^^^^ Creating $img ^^^^^^^^^^^^^^^^^^^^^^^" + make_one_image ${arch} ${geli} ${scheme} ${fs} ${bios} done done done @@ -824,15 +842,7 @@ for arch in i386; do for scheme in gpt mbr; do for fs in ufs zfs; do for bios in legacy; do - # 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 "vvvvvvvvvvvvvvvvvvvvvv Creating $img vvvvvvvvvvvvvvvvvvvvvvv" - rm -f ${img}* - eval mk_${geli}_${scheme}_${fs}_${bios} ${DESTDIR} ${img} ${MNTPT} ${geli} ${scheme} ${fs} ${bios} - eval qemu_${arch}_${bios} ${img} ${sh} - [ -n "${SUDO_USER}" ] && chown ${SUDO_USER} ${img}* - echo "^^^^^^^^^^^^^^^^^^^^^^ Creating $img ^^^^^^^^^^^^^^^^^^^^^^^" + make_one_image ${arch} ${geli} ${scheme} ${fs} ${bios} done done done @@ -843,15 +853,7 @@ for arch in arm aarch64; do for scheme in gpt mbr; do fs=ufs for bios in uboot efi; do - # 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 "vvvvvvvvvvvvvvvvvvvvvv Creating $img vvvvvvvvvvvvvvvvvvvvvvv" - rm -f ${img}* - eval mk_${geli}_${scheme}_${fs}_${bios} ${DESTDIR} ${img} ${MNTPT} ${geli} ${scheme} ${fs} ${bios} - eval qemu_${arch}_${bios} ${img} ${sh} - [ -n "${SUDO_USER}" ] && chown ${SUDO_USER} ${img}* - echo "^^^^^^^^^^^^^^^^^^^^^^ Creating $img ^^^^^^^^^^^^^^^^^^^^^^^" + make_one_image ${arch} ${geli} ${scheme} ${fs} ${bios} done done done @@ -860,15 +862,7 @@ for arch in powerpc powerpc64; do for scheme in ppc-wtf; do fs=ufs for bios in ofw uboot chrp; do - # 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 "vvvvvvvvvvvvvvvvvvvvvv Creating $img vvvvvvvvvvvvvvvvvvvvvvv" - rm -f ${img}* - eval mk_${geli}_${scheme}_${fs}_${bios} ${DESTDIR} ${img} ${MNTPT} ${geli} ${scheme} ${fs} ${bios} - eval qemu_${arch}_${bios} ${img} ${sh} - [ -n "${SUDO_USER}" ] && chown ${SUDO_USER} ${img}* - echo "^^^^^^^^^^^^^^^^^^^^^^ Creating $img ^^^^^^^^^^^^^^^^^^^^^^^" + make_one_image ${arch} ${geli} ${scheme} ${fs} ${bios} done done done @@ -878,15 +872,7 @@ for arch in sparc64; do for scheme in vtoc8; do for fs in ufs; do for bios in ofw; do - # 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 "vvvvvvvvvvvvvvvvvvvvvv Creating $img vvvvvvvvvvvvvvvvvvvvvvv" - rm -f ${img}* - eval mk_${arch}_${geli}_${scheme}_${fs}_${bios} ${DESTDIR} ${img} ${MNTPT} ${geli} ${scheme} ${fs} ${bios} - eval qemu_${arch}_${bios} ${img} ${sh} - [ -n "${SUDO_USER}" ] && chown ${SUDO_USER} ${img}* - echo "^^^^^^^^^^^^^^^^^^^^^^ Creating $img ^^^^^^^^^^^^^^^^^^^^^^^" + make_one_image ${arch} ${geli} ${scheme} ${fs} ${bios} done done done