From owner-svn-src-all@freebsd.org Wed Oct 9 05:28:12 2019 Return-Path: Delivered-To: svn-src-all@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 37EDB141431; Wed, 9 Oct 2019 05:28:12 +0000 (UTC) (envelope-from yuripv@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) server-signature RSA-PSS (4096 bits) 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 46p2mq1scWz3x66; Wed, 9 Oct 2019 05:28:11 +0000 (UTC) (envelope-from yuripv@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 1ED92BAB6; Wed, 9 Oct 2019 05:28:11 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x995SAG1065006; Wed, 9 Oct 2019 05:28:10 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x995SAQR065004; Wed, 9 Oct 2019 05:28:10 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201910090528.x995SAQR065004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Wed, 9 Oct 2019 05:28:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353335 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 353335 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.29 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: Wed, 09 Oct 2019 05:28:12 -0000 Author: yuripv Date: Wed Oct 9 05:28:10 2019 New Revision: 353335 URL: https://svnweb.freebsd.org/changeset/base/353335 Log: bsdinstall: fix ESP detection for auto ZFS layout Pass the list of user selected disks from zfsboot to bootconfig so that the latter doesn't rely on ESP autodetection that apparently fails for some cases, e.g. memstick installation with nvme (boot) and sata drives. While here, fix printing of debug messages in bootconfig. Reviewed by: bcran, imp, tsoome Differential Revision: https://reviews.freebsd.org/D21930 Modified: head/usr.sbin/bsdinstall/scripts/bootconfig head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/bootconfig ============================================================================== --- head/usr.sbin/bsdinstall/scripts/bootconfig Wed Oct 9 02:02:22 2019 (r353334) +++ head/usr.sbin/bsdinstall/scripts/bootconfig Wed Oct 9 05:28:10 2019 (r353335) @@ -27,6 +27,9 @@ # # $FreeBSD$ +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 + die() { echo $* exit 1 @@ -47,7 +50,8 @@ if [ "$(uname -m)" = "amd64" ] || [ "$(uname -m)" = "i fi if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" = "UEFI" ]; then - UFSBOOT_ESPS=$(cat /tmp/bsdinstall-esps) + UFSBOOT_ESPS=$(cat /tmp/bsdinstall-esps 2>/dev/null) + ZFSBOOT_DISKS=$(cat /tmp/bsdinstall-zfsboot 2>/dev/null) num_esps=0 if [ -n "$ZFSBOOT_DISKS" ]; then @@ -119,20 +123,20 @@ if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" fi for esp in $ESPS; do - echo "Formatting /dev/${esp} as FAT32" + f_dprintf "Formatting /dev/${esp} as FAT32" newfs_msdos -F 32 -c 1 -L EFISYS "/dev/$esp" > /dev/null 2>&1 if [ $? -ne 0 ]; then die "Failed to format ESP $esp as FAT32" fi mntpt=$(mktemp -d /tmp/stand-test.XXXXXX) - echo "Mounting ESP /dev/${esp}" + f_dprintf "Mounting ESP /dev/${esp}" mount -t msdosfs "/dev/${esp}" "${mntpt}" if [ $? -ne 0 ]; then die "Failed to mount ESP ${dev} on ${mntpt}" fi - echo "Installing loader.efi onto ESP" + f_dprintf "Installing loader.efi onto ESP" mkdir -p "$mntpt/EFI/freebsd" cp "$BSDINSTALL_CHROOT/boot/loader.efi" "${mntpt}/EFI/freebsd/loader.efi" @@ -142,14 +146,14 @@ if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" bootlabel="FreeBSD" fi - echo "Creating UEFI boot entry" + f_dprintf "Creating UEFI boot entry" efibootmgr --create --activate --label "$bootlabel" --loader "${mntpt}/EFI/freebsd/loader.efi" > /dev/null - echo "Unmounting ESP" + f_dprintf "Unmounting ESP" umount "${mntpt}" rmdir "${mntpt}" - echo "Finished configuring /dev/${esp} as ESP" + f_dprintf "Finished configuring /dev/${esp} as ESP" done fi Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Wed Oct 9 02:02:22 2019 (r353334) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Wed Oct 9 05:28:10 2019 (r353335) @@ -1656,6 +1656,9 @@ while :; do zfs_create_boot "$ZFSBOOT_POOL_NAME" \ "$vdev_type" $ZFSBOOT_DISKS || continue + # To be reused by bootconfig + echo "$ZFSBOOT_DISKS" > /tmp/bsdinstall-zfsboot + break # to success ;; ?" $msg_pool_type_disks")