From owner-svn-src-head@freebsd.org Mon Jun 18 23:16:48 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 162881004F13; Mon, 18 Jun 2018 23:16:48 +0000 (UTC) (envelope-from imp@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 B77DD792BB; Mon, 18 Jun 2018 23:16:47 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 775512D7A; Mon, 18 Jun 2018 23:16:47 +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 w5INGlsj046601; Mon, 18 Jun 2018 23:16:47 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5INGliB046600; Mon, 18 Jun 2018 23:16:47 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806182316.w5INGliB046600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 18 Jun 2018 23:16:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335349 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 335349 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.26 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, 18 Jun 2018 23:16:48 -0000 Author: imp Date: Mon Jun 18 23:16:47 2018 New Revision: 335349 URL: https://svnweb.freebsd.org/changeset/base/335349 Log: Switch to creating UEFI ESPs using loader.efi instead of boot1.efi. Cope for the fact that laoder.efi, not being boot1, doesn't read /boot.config by setting boot_serial and force the serial console. Also add sysctl so we can display the boot method. Provide a variable, do_boot1_efi, if you want to use boot1 for testing. But since it's transient, it's just a variable and not available on the command line. Modified: head/tools/boot/rootgen.sh Modified: head/tools/boot/rootgen.sh ============================================================================== --- head/tools/boot/rootgen.sh Mon Jun 18 23:00:15 2018 (r335348) +++ head/tools/boot/rootgen.sh Mon Jun 18 23:16:47 2018 (r335349) @@ -2,6 +2,8 @@ # $FreeBSD$ +do_boot1_efi=0 + # # Builds all the bat-shit crazy combinations we support booting from, # at least for amd64. It assume you have a ~sane kernel in /boot/kernel @@ -29,6 +31,29 @@ cpsys() { (cd $src ; tar cf - .) | (cd $dst; tar xf -) } +make_esp() +{ + local src dst md mntpt + src=$1 + dst=$2 + + if [ "${do_boot1_efi}" -eq 1 ]; then + cp ${src}/boot/boot1.efifat ${dst} + else + dd if=/dev/zero of=${dst} count=1 seek=$((100 * 1024 * 1024 / 512)) + md=$(mdconfig -f ${dst}) + newfs_msdos -a 32 /dev/${md} + mntpt=$(mktemp -d /tmp/stand-test.XXXXXX) + mount -t msdos /dev/${md} ${mntpt} +# mkdir -p ${mntpt}/efi/freebsd # not yet + mkdir -p ${mntpt}/efi/boot + cp ${src}/boot/loader.efi ${mntpt}/efi/boot/bootx64.efi + umount ${mntpt} + rmdir ${mntpt} + mdconfig -d -u ${md} + fi +} + mk_nogeli_gpt_ufs_legacy() { src=$1 img=$2 @@ -50,8 +75,7 @@ mk_nogeli_gpt_ufs_uefi() { cat > ${src}/etc/fstab < ${src}/etc/fstab < ${mntpt}/boot/loader.conf <> ${mntpt}/boot/loader.conf < ${mntpt}/boot/loader.conf <> ${mntpt}/boot/loader.conf < ${mntpt}/boot/loader.conf <> ${mntpt}/boot/loader.conf < ${src}/etc/fstab < ${src}/etc/fstab < ${mntpt}/boot/loader.conf <> ${mntpt}/boot/loader.conf < ${mntpt}/boot/loader.conf <> ${mntpt}/boot/loader.conf < ${mntpt}/boot/loader.conf <> ${mntpt}/boot/loader.conf < ${mntpt}/boot/loader.conf <> ${mntpt}/boot/loader.conf < ${mntpt}/boot/loader.conf <> ${mntpt}/boot/loader.conf < ${DESTDIR}/boot.config +cat > ${DESTDIR}/boot/loader.conf < ${DESTDIR}/etc/rc <