From owner-freebsd-bugs@freebsd.org Sat Jan 26 20:49:12 2019 Return-Path: Delivered-To: freebsd-bugs@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 A682F14AE1BD for ; Sat, 26 Jan 2019 20:49:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 282746CF81 for ; Sat, 26 Jan 2019 20:49:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id D776514AE1BC; Sat, 26 Jan 2019 20:49:11 +0000 (UTC) Delivered-To: bugs@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 C5E3014AE1BB for ; Sat, 26 Jan 2019 20:49:11 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::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.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B4586CF80 for ; Sat, 26 Jan 2019 20:49:11 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id 9BABCE9AB for ; Sat, 26 Jan 2019 20:49:10 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id x0QKnA0B039324 for ; Sat, 26 Jan 2019 20:49:10 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id x0QKnAEI039321 for bugs@FreeBSD.org; Sat, 26 Jan 2019 20:49:10 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 235206] add patch to fix starting with a damaged GPT scheme under legacy BIOS Date: Sat, 26 Jan 2019 20:49:10 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: 12.0-RELEASE X-Bugzilla-Keywords: patch X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: kmachine@free.fr X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 20:49:12 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D235206 --- Comment #1 from Emrion --- Created attachment 201423 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D201423&action= =3Dedit Patch to add an automatic GPT recovery feature to gptzfsboot I eventually made a patch for gptzfsboot. It modifies /usr/src/stand/i386/zfsboot/zfsboot.c and add the automatic recovery of a G= PT scheme feature but not only. It also verifies the crc of the GPT header and= the crc of the partition table. I have picked the code in /usr/src/stand/libsa/gpt.c, including mine from t= he previous patch, and adapted it to the zfsboot.c environment. It's a pity that the gpt.c code is used in gptboot but not in gptzfsboot. I think this would require to rewrite a good part of gpt.c and gptboot.c (not forget zfsboot.c itself). Besides that, if I well understood, the code of zfsboot.c is also used for booting a MBR scheme. So there is a mix of MBR a= nd GPT functions & instructions in the same file. Could the design be improved? Well, this is just my little understanding as I'm far to know enough in this matter. --=20 You are receiving this mail because: You are the assignee for the bug.=