From owner-freebsd-arch@FreeBSD.ORG Mon Oct 8 17:41:20 2012 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 65E8D1065674; Mon, 8 Oct 2012 17:41:20 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) by mx1.freebsd.org (Postfix) with ESMTP id 0D0E18FC20; Mon, 8 Oct 2012 17:41:19 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.17]) by ltcfislmsgpa04.fnfis.com (8.14.4/8.14.4) with ESMTP id q98HfHqb027778 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 8 Oct 2012 12:41:18 -0500 Received: from [10.0.0.103] (10.14.152.61) by smtp.fisglobal.com (10.132.206.17) with Microsoft SMTP Server (TLS) id 14.2.309.2; Mon, 8 Oct 2012 12:40:46 -0500 MIME-Version: 1.0 (Apple Message framework v1283) From: Devin Teske In-Reply-To: Date: Mon, 8 Oct 2012 10:40:41 -0700 Message-ID: <5318C0C7-5534-4633-8F4C-40C106CFF0FE@fisglobal.com> References: <0655B56F-AD43-402B-872C-568378E650F9@fisglobal.com> <5071D6B5.1010609@FreeBSD.org> <50726C73.10506@FreeBSD.org> To: Devin Teske X-Mailer: Apple Mail (2.1283) X-Originating-IP: [10.14.152.61] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.7.7855, 1.0.431, 0.0.0000 definitions=2012-10-08_03:2012-10-08, 2012-10-08, 1970-01-01 signatures=0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Doug Barton , freebsd-arch@freebsd.org Subject: Re: New Boot Loader Menu X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Devin Teske List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Oct 2012 17:41:20 -0000 Oops=85 This time with the attachments (below). NOTE: Don't forget to diff each one to see how we go from what's in HEAD to= day to each other demo NOTE: vimdiff works better than diff, because it can highlight the differen= ces *within* each line (showing a more succinct pattern of changes). On Oct 8, 2012, at 10:21 AM, Devin Teske wrote: >>>> Bonus points if you can make it easy to add a submenu via >>>> loader.conf. >>>>=20 >>>=20 >>> Done. There's zero difference in configuring menus in a "menu.rc" >>> file than in "loader.conf" file. >>=20 >> Ok, different file, same idea. Can you post some sample menu.rc code so >> we can get an idea of what "easy" means to you? >>=20 >=20 > Gladly! Thank you for asking! >=20 > I'll post the 4 different "menu.rc" files that I am planning on demonstra= ting this Thursday at BAFUG. >=20 > Please find attached the following files (with accompanying descriptions = below): >=20 > menu.rc.1.current-head > This is what is in HEAD, CURRENT, and RELENG_9 **right now** >=20 > NOTE: Each of the following menu.rc examples *require* the new patchset t= hat I'm sending through my mentor(s) to import to FreeBSD. We currently can= 't utilize _any_ of these features without the addition of "menusets.4th" (= for example; among other changes). >=20 > menu.rc.2.submenu-head > This is the menu.rc file that replicates the images posted at the beginni= ng of this thread. > Though, currently, I'm thinking I ought to craft a new menu.rc to show wh= at Alexander Leidinger proposes. >=20 > menu.rc.3.submenu-cycler > This menu.rc shows things that DruidBSD offers (but FreeBSD cannot). In o= ther words, don't get too exciting about the *actual* menu items, get more = excited about "what the menu can do" by this example. This example goes to = show that (if we need it), we can accommodate "cycling" menu items (where a= single menu item on a single stateful menu can exhibit a total of 10 usabl= e states). These menu items "cycle" -- meaning when you reach the last conf= igured item, it cycles back to the first. The text for these cyclic menu it= ems (just like toggle menu items) are completely arbitrary (explaining that= the "1of2" and "2of2" etc. text is configurable). >=20 > NOTE: The next example consists of two files. The menu.rc _and_ a very sm= all devicemenu.4th file which serves as a stand-in for C callbacks. In othe= r words, the code that is in the accompanying "devicemenu.4th" is actually = mimicking what *ought* to instead be a series of C callbacks exposed to the= FICL layer from something like base/head/sys/boot/ficl/loader.c >=20 > menu.rc.4.submenu-dynamic > devicemenu.4th >=20 > This menu.rc shows how you can configure a menu that has not only dynamic= menu *items* but that whole menus can be dynamic themselves (the menu item= s themselves are dynamically generated at runtime). >=20 > To make a dynamic menu, you have to back it by some runtime code. In this= example, I've backed the callbacks with Forth code, but ***you don't have = to*** and in-fact, my plans are to have these callbacks instead be provided= by the POSIX C layer, namely base/head/sys/boot/ficl/loader.c (as one plac= e where the C code exposes FICL constructs -- which ultimately are to be pa= ssed into the menu as a callback, configured via appropriately-named enviro= nment variables). >=20 > What's imperative to see in the demo of these 4 menu.rc files is that no = Forth needs to be changed. Just drop in the appropriate menu.rc and reboot = (SEE BELOW WARNING!) >=20 > WARNING!!! as previously explained,=85 you _MUST_ have the patches that I= sent to avg and mav to be able to "just drop in these menu.rc files and re= boot" -- if you drop anything but the HEAD menu.rc into a HEAD copy of /boo= t =85 you=85 will=85 not=85 boot=85 !!! >=20 > For a copy of what I sent to avg and mav, check out my twitter account or= drop me a line. --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you.