From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 11 00:58:07 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B5F11065679 for ; Tue, 11 Jan 2011 00:58:07 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 419058FC0C for ; Tue, 11 Jan 2011 00:58:06 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id B2FF573098; Tue, 11 Jan 2011 02:12:29 +0100 (CET) Date: Tue, 11 Jan 2011 02:12:29 +0100 From: Luigi Rizzo To: "Andrey V. Elsukov" Message-ID: <20110111011229.GA10711@onelab2.iet.unipi.it> References: <4D295820.20807@tomjudge.com> <20110110233330.GA9190@onelab2.iet.unipi.it> <4D2BA67F.8050801@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D2BA67F.8050801@yandex.ru> User-Agent: Mutt/1.4.2.3i Cc: Tom Judge , freebsd-hackers@freebsd.org Subject: Re: Boot0cfg bug redux (Re: sys/boot/boot0/boot0.S - r186598) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jan 2011 00:58:07 -0000 On Tue, Jan 11, 2011 at 03:38:23AM +0300, Andrey V. Elsukov wrote: > On 11.01.2011 02:33, Luigi Rizzo wrote: > > As a consequence, if we reboot without pressing an F-key, the system > > boots from partition s1 even though the boot loader indicates F2. > > > So, to summarize, I guess that a possible fix (that does not involve > > using gpart, or even worse, modifying boot0.S, which probably does > > not have any spare space) is to modify boot0cfg so that it sets the > > 'active' flag for the partition corresponding to the default entry. > > > > What do people think ? > > I don't remember which behavior was before, but it seems that users > want to change "active" attribute when they use "boot0cfg -s". more than "what was before" the issue is whether the 0x80 flag means ACTIVE (hence is should be set only for one partition) or it means BOOTABLE (so it is ok to have it set for multiple partitions, and bootloaders should ignore partitions with the flag clear, no matter what the selection is). boot0.S' behaviour is closer to ACTIVE than BOOTABLE. Same for fdisk, and the change i was proposing is in line with this interpretation. > And i think it is not so hard to add several lines of code to pass > "set" command to PART class. i don't know how this would help, because i believe the code at the origin of the bug is (or at least used to be) in boot2.c cheers luigi