From nobody Fri May 13 14:35:24 2022 X-Original-To: dev-commits-src-all@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 9F3EC1ADBA6E; Fri, 13 May 2022 14:35:24 +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 4L0B583vjQz3Plb; Fri, 13 May 2022 14:35:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652452524; 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=CgPbZcZ0VPjb3Nf4Y3yTHc+tworVOoIj4S7KJmxabb4=; b=bj7uPoEU38bI4HeWxn4+nLBNpvAKcXL3A+T7dhPvJdPAcJjx3PZwrulfEcq+Be+dJCSjo2 Vuv1K7HY+8Er4xjZfqV6bmeHDhZndOn0jsSNkjNLzXGu/KEtPI7uhu3n/g3XSFIHFOWldr zo7xnR6XJ/wZkpu8s3AdgLCkAWFNpKDW7i3D3QfuvpVWeLUsseYvTatGfPfn+WKSL2ifDG WKX8b+CsrGkoTnoRMgHs2T1x6UonmYHHACLkKm3muAMf8ZvJw/8YOfwEAML3l7e/rhXuJU OwG+lNfZnXc8ZHLCGpiLSqnUnKXOFLxQ/ceGt99EhCKxEAZLAc9yGzEVE8h6DQ== 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 635BC24750; Fri, 13 May 2022 14:35:24 +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 24DEZOrP000123; Fri, 13 May 2022 14:35:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24DEZO0G000122; Fri, 13 May 2022 14:35:24 GMT (envelope-from git) Date: Fri, 13 May 2022 14:35:24 GMT Message-Id: <202205131435.24DEZO0G000122@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brad Davis Subject: git: 964ad27f1e48 - main - bsdinstall: Filter out devices that cannot be opened List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brd X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 964ad27f1e48ec28247142cfe6afdfa1f8bd3182 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652452524; 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=CgPbZcZ0VPjb3Nf4Y3yTHc+tworVOoIj4S7KJmxabb4=; b=raamOcSrs6l+ywY/bpkuP+eeHHAXsUN1v4a+Hlwiohn4XoZHPeOEQ16+PGIot9lwI+f3LN 6zjiEfae2iJLResALXFu+NnS35s/JEo0MTcQ26W2mylKu+Xa8QOCQI9e6YNqim3Z5FloPC nfTwWuZZNsHn1WoJIHmMEguxqjdJRl1Fckmolx/oT+9ICfD7dN8yJvt70F2QLCvkrjc9vf o8vCvMG2UL/SfXXXOpENPEU8RKQ6bvOyZ0cncaFVJQ5oQJ7xWWbh5TaddsfDAZTy525T+m QuxLgGTjK+4BeKV63AkfS13u6/elwPwqdlmKxYtpXSbDxOYmB9GUCSZ2ofZ3uw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1652452524; a=rsa-sha256; cv=none; b=HX3N/6K+zgS4F4XMFaKgJaqKx80XNvtfL9OFPoPP67OmJ3Ec4fd9ixF3Gig7DM3z2udkgW DvjPOVUNmzUKUOMi901BQAoYkI8XPNTAYz/ur51zOzyfeIQ5gIUHJF9fmBF5CoNwpuUt3i 9Qia9Sq0mXLng4xm8ieskxOFUOzoVJSYO0ny0ZRJWr68//K/DMEPniXdIQSUIyXDjumrW3 IZmBDeUXFj3ZFYXf8bTJozipA4TRiW2tPjnn4fwcVHS6gLF1c7iIHIKrjeRyw1B88ePgh6 KQjm3AEcrdIw6ddtiiXQsXcoGowY8wjJlVsgO1UluvlhMbFdMasILjJUaYRXEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by brd: URL: https://cgit.FreeBSD.org/src/commit/?id=964ad27f1e48ec28247142cfe6afdfa1f8bd3182 commit 964ad27f1e48ec28247142cfe6afdfa1f8bd3182 Author: Brad Davis AuthorDate: 2022-05-13 14:33:21 +0000 Commit: Brad Davis CommitDate: 2022-05-13 14:33:21 +0000 bsdinstall: Filter out devices that cannot be opened Devices that cannot be opened are most likely the install media and should not be listed as destinations. Reviewed by: allanjude Approved by: allanjude Differential Revision: https://reviews.freebsd.org/D34879 Sponsored by: Rubicon Communications, LLC ("Netgate") --- usr.sbin/bsdinstall/partedit/part_wizard.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/usr.sbin/bsdinstall/partedit/part_wizard.c b/usr.sbin/bsdinstall/partedit/part_wizard.c index 2ffae7b16829..bc6427f859da 100644 --- a/usr.sbin/bsdinstall/partedit/part_wizard.c +++ b/usr.sbin/bsdinstall/partedit/part_wizard.c @@ -135,6 +135,16 @@ boot_disk_select(struct gmesh *mesh) continue; if (strncmp(pp->lg_name, "cd", 2) == 0) continue; + /* + * Check if the disk is available to be opened for + * write operations, it helps prevent the USB + * stick used to boot from being listed as an option + */ + fd = g_open(pp->lg_name, 1); + if (fd == -1) { + continue; + } + g_close(fd); disks = realloc(disks, (++n)*sizeof(disks[0])); disks[n-1].name = pp->lg_name;