From owner-freebsd-hackers@FreeBSD.ORG Tue Dec 9 01:29:41 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A4CF1065672; Tue, 9 Dec 2008 01:29:41 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 9890C8FC0C; Tue, 9 Dec 2008 01:29:40 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from kobe.laptop (adsl200-163.kln.forthnet.gr [79.103.13.163]) (authenticated bits=128) by igloo.linux.gr (8.14.3/8.14.3/Debian-5) with ESMTP id mB91TVeb001263 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 9 Dec 2008 03:29:36 +0200 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id mB91TVmd066821; Tue, 9 Dec 2008 03:29:31 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id mB91TS4q066732; Tue, 9 Dec 2008 03:29:28 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) From: Giorgos Keramidas To: Maxim Sobolev References: <493DA269.2070805@FreeBSD.org> <20081208235119.GA46608@onelab2.iet.unipi.it> <493DBBD0.5080705@FreeBSD.org> Date: Tue, 09 Dec 2008 03:29:28 +0200 In-Reply-To: <493DBBD0.5080705@FreeBSD.org> (Maxim Sobolev's message of "Mon, 08 Dec 2008 16:29:04 -0800") Message-ID: <87oczmjfuv.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-MailScanner-ID: mB91TVeb001263 X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-3.957, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.44, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: Luigi Rizzo , hackers@freebsd.org, Luigi Rizzo , "current@freebsd.org" Subject: Re: Enhancing cdboot [patch for review] 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, 09 Dec 2008 01:29:41 -0000 On Mon, 08 Dec 2008 16:29:04 -0800, Maxim Sobolev wrote: > Luigi Rizzo wrote: >> On Mon, Dec 08, 2008 at 02:40:41PM -0800, Maxim Sobolev wrote: >>> Hi, >>> Below please find patch that enhances cdboot with two compile-time options: >> ... >>> Any comments/suggestions are appreciated. If there are no objections I >>> would like to commit the change. The long-term goal is to make >>> CDBOOT_PROMPT default mode for installation CD. >>> >>> http://sobomax.sippysoft.com/~sobomax/cdboot.diff >> >> Looks good. Some comments: > > Thank you for the review and comments. Please see my answers below. > >> 1. since there is plenty of space in the cdboot sector, why don't you >> make the two option always compiled in, controlling which one to >> activate through flags in the bootsector itself, to be set >> patching the binary sector itself using a mechanism similar to >> boot0cfg. >> Of course you cannot alter a cdrom after you burn it, >> but it makes it easier to build CDs with one or the other defaults, >> patching cdboot or the iso image itself before creating/burning it. >> >> 2. in fact, the 'silent' option could be disabled at runtime by >> pressing some key (e.g. adding a short wait loop before proceeding; >> if this is meant for custom, unattended CDs the extra delay should not >> matter much); > > Good idea, I will see if I can put that in. In fact this behavior should > have to be optional as well, since one of the uses for the "silent" > option here is to provide tamper-resistant boot process on custom > hardware. Nice pair of features :-) If there are no pressing space constraints maybe we can build both options in by default, but still make them opt-out when necessary? With a bit of makefile glue we can make it possible to compile with an `src.conf' that includes: WITH_CDBOOT_SILENT=1 WITHOUT_CDBOOT_PROMPT=1 This way the defaults can include support for both options, but we can conditionally compile *out* the bits that are not needed for some custom installation. Something like this can define one or both of these options in CFLAGS, depending on what `src.conf' contains: # When CDBOOT_SILENT is set, the cdboot doesn't produce any messages except # "Loading, please wait..." and it also passes RBX_MUTE flag to the next # stage to silence it as well. This is intended for custom installations # where end-user is not required to see any messages or interfere with the # boot process. .if ${MK_CDBOOT_SILENT} != "no" CFLAGS+= -DCDBOOT_SILENT .endif # When CDBOOT_PROMPT is enabled the cdboot behaves like windows xp or vista # cd loader, that is it reads MBR from the first hard drive in the system # and if the MBR is bootable (i.e. drive has some other operating system # installed on it) then it presents user with "Press any key to boot from # CD" prompt and waits for 20 seconds. If key is not pressed then the # control is passed to the MBR, otherwise CD is booted. This is intended for # installation CD to allow unattended mode and also helps when installation # CD has been unintentionally left in the drive of the machine that is set # to boot off CD. .if ${MK_CDBOOT_PROMPT} != "no" CFLAGS+= -DCDBOOT_PROMPT .endif The defaults for ${MK_CDBOOT_XXX} will have to be explicitly set in `src/share/mk/bsd.own.mk', near line 281: 281 # 282 # MK_* options which default to "yes". 283 # 284 .for var in \ ... But that shouldn't be a problem, AFAICT :-)