From owner-freebsd-current@freebsd.org Mon Feb 12 16:58:58 2018 Return-Path: Delivered-To: freebsd-current@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 626A5F0823E for ; Mon, 12 Feb 2018 16:58:58 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x230.google.com (mail-it0-x230.google.com [IPv6:2607:f8b0:4001:c0b::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E95147EE6E for ; Mon, 12 Feb 2018 16:58:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x230.google.com with SMTP id e1so7307983ita.0 for ; Mon, 12 Feb 2018 08:58:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=IDM59U8v9thGzHjiSnxEdRg5htd+gNZ2gyR0Q6wrj5k=; b=kOqOcjD2S2ZY4vjD5zVvO3R5V6a5sMTv/fCbGpR6/KoyihQvInAernGhG0nIA+OWFj BR0cweVSAhnPuezSWUMZDPc9QMe4q/mUsll5jwyWohZ076zIPERpjQrXGcGfB9pmLF8y tr55pZMdYooyaV/yAyBU93cyRrPJnyU1VUygKaSAatUbniJfmBLxvFp05O2K/Jp7+jVO GmiBL/9y2XT4u2OftbibO4Kjvry9mfmqqFb0LGhC0y57lkHWEleyz2I4fXbSIPlEfLa5 B/BawEdVoOp/tBnURkTv528m494picz3pGMMoF98P0Q042Lje5ZdHZt1DyPT9fPLUU9+ 9ToQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=IDM59U8v9thGzHjiSnxEdRg5htd+gNZ2gyR0Q6wrj5k=; b=nRgKgHb2iSZT/m9EoRtdZPulNAkx+syLee0KX6AXd2ifug4DAE7xX2puixC29lW6Sl R8I0dKHs01W1G6s18AyeqKjhlWmycqHnoJwx+u9gtgaLi9m9DWSQp9E0DMzWxrPqmeEB hVT6PNhSnbvF7Z+TbuKta/lnlKBhwhJUt6f5r13EiPldDzxAiW/6BOficXbKkpjBFooP hIt+c6+hSqdvxtyRKoBcS/bSNn/arem9nAAGnrKOUHOXge/3nsBu6QLUQEqCrWRh9nTU rVZJ6QGofv1tyiXNG6eta7CcWYIr4r3jYVQj8uksCpmhqn7+u0fL2q7aqRspfKrRqM+t o5uw== X-Gm-Message-State: APf1xPBvTTHfYMvhBWje1bAQyXI97KVeiVUx+2PNCuIe82LrpHxR1mUs +4Np8kAXsiu7fLir1OnBARm4XXUbqrFILGS0q3Un6A== X-Google-Smtp-Source: AH8x226WD2CR4MG0+wJCbqHWvBWPX4nbH+LjSmEUdzZFNfGW6hzHumskwB4vbbZm9GqxH7icUVi6RAbes7eAZVkbfqA= X-Received: by 10.36.54.66 with SMTP id l63mr6298551itl.50.1518454737243; Mon, 12 Feb 2018 08:58:57 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Mon, 12 Feb 2018 08:58:56 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <741cdd4f-c4f3-5909-26a9-4cc8f5231eea@ixsystems.com> <623bcb5c-8ddb-4d38-7826-0c9e344502a3@ixsystems.com> From: Warner Losh Date: Mon, 12 Feb 2018 09:58:56 -0700 X-Google-Sender-Auth: kpKe4YtJZPo4RdC8ZwPu-6hLUZQ Message-ID: Subject: Re: LUA boot loader coming very soon To: Kris Moore Cc: FreeBSD Current Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 16:58:58 -0000 On Mon, Feb 12, 2018 at 9:51 AM, Warner Losh wrote: > > > On Mon, Feb 12, 2018 at 9:45 AM, Kris Moore wrote: > >> On 02/12/2018 11:31, Warner Losh wrote: >> >> >> >> On Mon, Feb 12, 2018 at 9:26 AM, Kris Moore wrote: >> >>> On 02/12/2018 10:27, Warner Losh wrote: >>> > Greetings, >>> > >>> > As you may know, the Lua (http://www.lua.org) boot loader has been in >>> the >>> > works for some time. It started out life as a GSoC in 2014 by Pedro >>> Souza >>> > mentored by Wojciech A. Koszek. Rui Paulo created a svn project branch >>> to >>> > try to integrate it. I rebased that effort into a github branch which >>> Pedro >>> > Arthur fixed up. Over the past year, I've been cleaning up the boot >>> loader >>> > for other reasons, and found the time was ripe to start integrating >>> this >>> > into the tree. However, those integration efforts have taken a while >>> as my >>> > day-job work on the boot loader took priority. In the mean time, Ed >>> Maste >>> > and the FreeBSD Foundation funded Zakary Nafziger to enhance the >>> original >>> > GSoC Lua scripts to bring it closer to parity with the evolution of the >>> > FORTH menu system since the GSoC project started. >>> > >>> > I'm pleased to announce that all these threads of development have >>> > converged and I'll be pushing the FreeBSD Lua Loader later today. This >>> > loader uses Lua as its scripting language instead of FORTH. While >>> > co-existance is planned, the timeline for it is looking to be a few >>> weeks >>> > and I didn't want to delay pushing this into the tree for that. >>> > >>> > To try the loader, you'll need to build WITHOUT_FORTH=yes and >>> > WITH_LOADER_LUA=yes. Fortunately, you needn't do a full world to do >>> this, >>> > you can do it in src/stand and install the result (be sure to have the >>> > options for both the build and the install). This will replace your >>> current >>> > /boot/loader that is scripted with FORTH to one that's scripted with >>> Lua. >>> > It will install the lua scripts in /boot/lua. The boot is scripted with >>> > /boot/lua/loader.lua instead of /boot/loader.rc. You are strongly >>> advised >>> > to create a backup copy of /boot/loader before testing (eg cp >>> /boot/loader >>> > /boot/loader_forth), since you'll need to boot that from boot2 if >>> something >>> > goes wrong. I've tested it extensively, though, with userboot.so and >>> it's >>> > test program, so all the initial kinks of finding the lua scripts, etc >>> have >>> > been worked out. >>> > >>> > While it's possible to build all the /boot/loader variants with Lua, >>> I've >>> > just tested a BIOS booting /boot/loader both with and without menus >>> > enabled. I've not tested any of the other variants and the >>> instructions for >>> > testing some of them may be rather tedious (especially UEFI, if you >>> want a >>> > simple path to back out). Since there's not been full convergence >>> testing, >>> > you'll almost certainly find bumps in this system. Also, all the >>> > build-system APIs are likely not yet final. >>> > >>> > I put MFC after a month on the commit. Due to the heroic (dare I say >>> > almost crazy) work of Kyle Evans on merging all the revs from -current >>> to >>> > 11, I'm planning a MFC to 11 after the co-existence issues are hammered >>> > out. In 11, FORTH will be the default, and Lua will be built by >>> default, >>> > but users will have to do something to use it. 12, both FORTH and Lua >>> will >>> > be built and installed, with Lua as default (barring unforeseen >>> > complications). Once the co-existence stuff goes in, I imagine we'll >>> make >>> > the switch to Lua by default shortly after that. In 13, FORTH will be >>> > removed unless there's a really really compelling case made to keep it. >>> > >>> > So please give it a spin and give me any feedback, documentation >>> updates >>> > and/or bug fixes. I'm especially interested in reviews from people that >>> > have embedded Lua in other projects or experts in Lua that can improve >>> the >>> > robustness of the menu code. >>> > >>> > Warner >>> > _______________________________________________ >>> > freebsd-current@freebsd.org mailing list >>> > https://lists.freebsd.org/mailman/listinfo/freebsd-current >>> > To unsubscribe, send any mail to "freebsd-current-unsubscribe@f >>> reebsd.org" >>> >>> Warner & Co, >>> >>> Great job all! Been wanting this for years, very excited to see it start >>> landing :) >>> >>> One question, if we switch to Lua loader in TrueOS, do you know if the >>> ZFS boot-environment menus have been implemented / tested yet? >> >> >> I don't think that they have been implemented yet. I've certainly not >> tested them. >> >> Warner >> >> Ok, I'll have to mess about with it. I recall there was some library >> which created to expose ZFS in limited functionality over to the FORTH >> code. That's probably a good place to start and see if that still works and >> Lua can probe the pool for BE information. >> > > OK. There's no such functionality in FORTH in the tree today. However, zfs > sets a number of env vars that loader.getenv() can get in lua. > There's also a 'reloadbe' boot loader command that's independent of interpreter. Sadly, it's reimplemented three times identically, with a single comment being the only difference. Now that's something that's ripe for cleanup... Warner