From nobody Fri Oct 11 18:06:58 2024 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 4XQF2B2LBDz5ZCJ7; Fri, 11 Oct 2024 18:06:58 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XQF2B1t4Yz41DS; Fri, 11 Oct 2024 18:06:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728670018; 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=ZJjU0gEuXUsQaI8LIqm+xqFCCdEK9DIQ9gwseJ9qUPo=; b=FmGLxHhK2Z2wfHGvVQiBnBkBZGSTKb3VwUr3zZXYDcj0jGl97Ky8KdGPe/3aN76PEquLe7 Zs3WM/SB3rwpk9L0lEzNHPTebx63GmmKJmvrOeTZrXYWVb4CA4duu9DISt/fiOHEjI18eX DVApPRs3rb4PbXCYi1dGDdUfxm1CZLEqhWmsE1QtMwwJwmsXMsCmecdWqHM2C349B6Wl90 SWkAKjZUof2ep/mlgZ6B/mIRCBhRDo/SV9Qe3gUMyWmFn1EVTrrk29SS2q+QMKOu173Aen XFHRMseT2ONc9nxoIwLv4zUqqUh0ZxnNA92G2hU4+Qji2j8ZTsIBXpLa7CEKIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728670018; 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=ZJjU0gEuXUsQaI8LIqm+xqFCCdEK9DIQ9gwseJ9qUPo=; b=vPZO1yvIqsnHBh4aBSDEI39O1/sef3muLGQ6xbnaD5/HOjRi61WbdsOkzuOQT9jCoVdf/s XWSR6KCvm1PpxKo/nzURmIgQ+4Z04yj54w32dvg8Serm9oKXT5r609M7KxZSZMhz0MEi3A jtXpXx6Ttb7KaWvCAxfKDNMHrizl2AOzUuVdGGJiG4YdnO6YWUz5CzKko/ap4mP23qUokt L4xPBBe8GCU1dIgFVBRTSdLX7DaJCzu4qT3dQTt5c151eFvct6dJGAUMTWp8YVGDdrNlkL vgE5gtxr+8HAz7KlLF6ySqThuItWric1grlMUBv24nxPCqcg/4X8LQK32FCRZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728670018; a=rsa-sha256; cv=none; b=N22Zd1mBaPJNZzgJ7A0WHaCN7roWfeWhofqyD+ribTkZaTVx+Cw3hkZIp3dfjbUF2N/Y0y th5nMuvL8PUuV+raFkku5v1mxmM3xzElvwg+xKn20yRbIF0bz8j6PrlBeiRb2o73NYzUI0 YWfIJQcas4bdf9ChnjhQqaziLYEdyD7slrE/4PAZAqwK0gKnAp9lvHOjlDx369mSN5ep96 rRcG4BflA9rrdxNZSghQx90NItLnEyk3Fdu25ALCFimkAZfUDnWwWgbBmGZObn462dH6kY c0RmBD0Uj9gO2aLnz6aj/V4eM+wuy8xe33G+FLEnS0BW/9zodC07OBTTN4dC5g== 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 4XQF2B1TBRzrhC; Fri, 11 Oct 2024 18:06:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49BI6w9M011701; Fri, 11 Oct 2024 18:06:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49BI6wcQ011698; Fri, 11 Oct 2024 18:06:58 GMT (envelope-from git) Date: Fri, 11 Oct 2024 18:06:58 GMT Message-Id: <202410111806.49BI6wcQ011698@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 2af5769e3431 - main - fdisk: Make confusing fdisk messages a little less ambiguous 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2af5769e3431f6b5d1bc0ddaac9082e53096e308 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2af5769e3431f6b5d1bc0ddaac9082e53096e308 commit 2af5769e3431f6b5d1bc0ddaac9082e53096e308 Author: Warner Losh AuthorDate: 2024-10-11 16:13:08 +0000 Commit: Warner Losh CommitDate: 2024-10-11 18:06:33 +0000 fdisk: Make confusing fdisk messages a little less ambiguous We print an error when we can't read the MBR. Add minimal messages about continuing anyway. PR: 167036 Sponsored by: Netflix --- sbin/fdisk/fdisk.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sbin/fdisk/fdisk.c b/sbin/fdisk/fdisk.c index 6cfa2b510f22..d9514555ae34 100644 --- a/sbin/fdisk/fdisk.c +++ b/sbin/fdisk/fdisk.c @@ -380,7 +380,8 @@ main(int argc, char *argv[]) printf("******* Working on device %s *******\n",disk); if (I_flag) { - read_s0(); + if (read_s0()) + warnx("Ignoring bad existing MBR."); reset_boot(); partp = &mboot.parts[0]; partp->dp_typ = DOSPTYP_386BSD; @@ -410,8 +411,10 @@ main(int argc, char *argv[]) else print_params(); - if (read_s0()) + if (read_s0()) { + printf("Will replace existing bad MBR\n"); init_sector0(dos_sectors); + } printf("Media sector size is %d\n", secsize); printf("Warning: BIOS sector numbering starts with sector 1\n");