From owner-svn-src-all@freebsd.org Tue Dec 19 00:18:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1A2AE95346; Tue, 19 Dec 2017 00:18:18 +0000 (UTC) (envelope-from imp@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 mx1.freebsd.org (Postfix) with ESMTPS id 99E6878A15; Tue, 19 Dec 2017 00:18:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJ0IHhI089557; Tue, 19 Dec 2017 00:18:17 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJ0IHn4089556; Tue, 19 Dec 2017 00:18:17 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712190018.vBJ0IHn4089556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 19 Dec 2017 00:18:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326954 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 326954 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 00:18:18 -0000 Author: imp Date: Tue Dec 19 00:18:17 2017 New Revision: 326954 URL: https://svnweb.freebsd.org/changeset/base/326954 Log: Support more images (but still no geli) Print a qemu line to a shell script to ease testing each image Start to support multiple architectures (still very green) Create /etc/rc that echos success and halts the system for better automation (also include halt) Create /etc/fstab on a per-boot type to test loader's passing root to kernel. This lets me run a test, connect to it with telnet and get either a timeout, or a report of success. Sponsored by: Netflix Modified: head/tools/boot/rootgen.sh Modified: head/tools/boot/rootgen.sh ============================================================================== --- head/tools/boot/rootgen.sh Mon Dec 18 23:35:14 2017 (r326953) +++ head/tools/boot/rootgen.sh Tue Dec 19 00:18:17 2017 (r326954) @@ -33,28 +33,41 @@ mk_nogeli_gpt_ufs_legacy() { src=$1 img=$2 - rm -f ${img} ${img}.p2 + cat > ${src}/etc/fstab < ${src}/etc/fstab < ${src}/etc/fstab < ${src}/etc/fstab < $sh +# https://wiki.freebsd.org/arm64/QEMU also has +# -device virtio-net-device,netdev=net0 +# -netdev user,id=net0 +} + +# Amd64 qemu +qemu_amd64_legacy() +{ + img=$1 + sh=$2 + + echo "qemu-system-x86_64 --drive file=${img},format=raw ${qser}" > $sh +} + +qemu_amd64_uefi() +{ + img=$1 + sh=$2 + + echo "qemu-system-x86_64 -bios ~/bios/OVMF-X64.fd --drive file=${img},format=raw ${qser}" > $sh +} + +qemu_amd64_both() +{ + img=$1 + sh=$2 + + echo "qemu-system-x86_64 --drive file=${img},format=raw ${qser}" > $sh + echo "qemu-system-x86_64 -bios ~/bios/OVMF-X64.fd --drive file=${img},format=raw ${qser}" > $sh +} + +# arm +# nothing listed? + +# i386 +qemu_i386_legacy() +{ + img=$1 + sh=$2 + + echo "qemu-system-i386 --drive file=${img},format=raw ${qser}" > $sh +} + +# Not yet supported +qemu_i386_uefi() +{ + img=$1 + sh=$2 + + echo "qemu-system-i386 -bios ~/bios/OVMF-X32.fd --drive file=${img},format=raw ${qser}" > $sh +} + +# Needs UEFI to be supported +qemu_i386_both() +{ + img=$1 + sh=$2 + + echo "qemu-system-i386 --drive file=${img},format=raw ${qser}" > $sh + echo "qemu-system-i386 -bios ~/bios/OVMF-X32.fd --drive file=${img},format=raw ${qser}" > $sh +} + +# mips +# qemu-system-mips -kernel /path/to/rootfs/boot/kernel/kernel -nographic -hda /path/to/disk.img -m 2048 + +# Powerpc -- doesn't work but maybe it would enough for testing -- needs details +# powerpc64 +# qemu-system-ppc64 -drive file=/path/to/disk.img,format=raw + +# sparc64 +# 10.3 works, 12-current (which one?) hangs +# qemu-system-sparc64 -drive file=/path/to/disk.img,format=raw + + # Misc variables SRCTOP=$(make -v SRCTOP) cd ${SRCTOP}/stand @@ -188,27 +299,115 @@ echo -h -D -S115200 > ${DESTDIR}/boot.config cp /boot/device.hints ${DESTDIR}/boot/device.hints # Assume we're already built make install DESTDIR=${DESTDIR} MK_MAN=no MK_INSTALL_AS_USER=yes -# Copy init, /bin/sh and minimal libraries -mkdir -p ${DESTDIR}/sbin ${DESTDIR}/bin ${DESTDIR}/lib ${DESTDIR}/libexec -for f in /sbin/init /bin/sh $(ldd /bin/sh | awk 'NF == 4 { print $3; }') /libexec/ld-elf.so.1; do +# Copy init, /bin/sh, minimal libraries and testing /etc/rc +mkdir -p ${DESTDIR}/sbin ${DESTDIR}/bin \ + ${DESTDIR}/lib ${DESTDIR}/libexec \ + ${DESTDIR}/etc ${DESTDIR}/dev +for f in /sbin/halt /sbin/init /bin/sh $(ldd /bin/sh | awk 'NF == 4 { print $3; }') /libexec/ld-elf.so.1; do cp $f ${DESTDIR}/$f done -mkdir ${DESTDIR}/dev +cat > ${DESTDIR}/etc/rc <