From owner-freebsd-current@FreeBSD.ORG Thu Oct 10 14:15:16 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7C083B83 for ; Thu, 10 Oct 2013 14:15:16 +0000 (UTC) (envelope-from kris@pcbsd.org) Received: from mail.iXsystems.com (newknight.ixsystems.com [206.40.55.70]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 540182F4A for ; Thu, 10 Oct 2013 14:15:16 +0000 (UTC) Received: from localhost (mail.ixsystems.com [10.2.55.1]) by mail.iXsystems.com (Postfix) with ESMTP id 1801966CA4; Thu, 10 Oct 2013 07:15:16 -0700 (PDT) Received: from mail.iXsystems.com ([10.2.55.1]) by localhost (mail.ixsystems.com [10.2.55.1]) (maiad, port 10024) with ESMTP id 63619-05; Thu, 10 Oct 2013 07:15:15 -0700 (PDT) Received: from [192.168.0.51] (75-130-56-30.static.kgpt.tn.charter.com [75.130.56.30]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.iXsystems.com (Postfix) with ESMTPSA id CDD9E66C9C; Thu, 10 Oct 2013 07:15:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ixsystems.com; s=newknight0; t=1381414515; bh=L62SmDpQOM3Ah3U7XW6KHMoZf279trJ+r8Fitf5/fwA=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=LIvXmShxcvOAAVsp5LNodExXuttbQxJl9RtgYGCj3vZRRkv5H7LBaCJC/IIa/SKiH jMxO9S8fSvGcgzUcdd/J3zX7LtLr9Jq4DlVJZ6Ypl3ngSPOikGuqL22v1oWUKEv7En dqt3vyiFAxz9QUSJNS5/zBuHNSj+KciXjBuzQBzU= Message-ID: <5256B671.2040105@pcbsd.org> Date: Thu, 10 Oct 2013 10:15:13 -0400 From: Kris Moore User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: Thomas Mueller , freebsd-current@freebsd.org Subject: Re: BE Loader Menu (was Re: rcs) References: <60177810-8DC4-4EA3-8040-A834B79039D2@orthanc.ca> <52538EDC.2080001@freebsd.org> <52541202.3010707@mu.org> <20131008.170444.74714516.sthaug@nethelp.no> <52542BD4.5070706@FreeBSD.org> <52542E1D.9000000@mu.org> <52555D1C.8010407@freebsd.org> <52558577.5020401@allanjude.com> <52558779.2070203@pcbsd.org> <517D65A3D61F684FAE2B2EC2D2DA06C3@fisglobal.com> <13CA24D6AB415D428143D44749F57D720FC4B2A3@LTCFISWMSGMB21.FNFIS.com> <59.81.16944.C6136525@cdptpa-oedge02> In-Reply-To: <59.81.16944.C6136525@cdptpa-oedge02> X-Enigmail-Version: 1.5.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "Teske, Devin" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 10 Oct 2013 14:15:16 -0000 On 10/10/2013 00:47, Thomas Mueller wrote: > Sorry for previous typo in From: line, missing right angle bracket at end. > Then, in a finger error, I resent that message just before finding the error and making the needed correction. > > from Devin Teske: > >> I'm late to the party again ;D (didn't realize the rcs thread had turned BE) >> Both problems can be solved. >> The loading of the kernel *after* choosing your boot device is trivial. >> We've been doing it at $work for *years* (almost a decade?) >> I can put that in, whenever. Probably at the same time as implementing >> the live/dynamic BE menus for selecting the root device. > I'd like to know how to boot FreeBSD >= 9.1 with grub2. > > Following the instructions under $PORTSDIR/sysutils/grub2 > > insmod ufs2 > set root=(hd0,gpt3) > kfreebsd /boot/loader > boot > > stopped working around FreeBSD 9.1-stable. > > I used Super Grub2 Disk image on the System Rescue CD written to USB stick. > > Recently, I built sysutils/grub2, ran mkrescue, wrote that image to the System Rescue USB stick and made the entry in /syslinux/syslinux.cfg, but haven't tested that yet. > > What is the method you or PC-BSD uses? > > I want to use it on FreeBSD 9.2 and 10-current. > > I tried visiting pcbsd.org website but couldn't find any details. > > Tom > > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" We use the same port, but have some custom grub.d/ scripts which builds our /boot/grub/grub.cfg files. https://github.com/pcbsd/pcbsd/tree/master/src-sh/pc-extractoverlay/ports-overlay/usr/local/etc/grub.d The scripts do basic stuff like parsing output of "beadm" and creating a list of Boot-Environment menus to build. Along with parsing /boot/loader.conf, /boot/device.hints and friends. Lastly it even has code to mount each of your BEs and copy the resulting grub.cfg file into each, so that you have a unified menu regardless of which BE you are currently booting. One thing that I really want to fix is detecting which kernel modules have what depends. Currently I have to ensure that /boot/loader.conf has both the target module + depends in order for GRUB to load them properly. If anybody wants to help hack on these and make them more "FreeBSD generic" I think it could eventually go into the ports tree for everybody. When grub-mkconfig is run, it generates a ZFS / BE specific boot-script, with entries that look like this: --------------------------------------------------------------- submenu "PC-BSD (default) - 2013-08-27 14:23" { menuentry "Normal Bootup" { insmod zfs search -s -l tank1 kfreebsd /ROOT/default/@/boot/kernel/kernel kfreebsd_module /ROOT/default/@/boot/zfs/zpool.cache type=/boot/zfs/zpool.cache set kFreeBSD.vfs.root.mountfrom=zfs:tank1/ROOT/default kfreebsd_module_elf /ROOT/default/@/boot/kernel/siis.ko kfreebsd_module_elf /ROOT/default/@/boot/kernel/sdhci.ko kfreebsd_module_elf /ROOT/default/@/boot/kernel/geom_journal.ko kfreebsd_module_elf /ROOT/default/@/boot/kernel/geom_mirror.ko kfreebsd_module_elf /ROOT/default/@/boot/kernel/geom_eli.ko kfreebsd_module_elf /ROOT/default/@/boot/kernel/aesni.ko kfreebsd_module_elf /ROOT/default/@/boot/kernel/zfs.ko kfreebsd_module_elf /ROOT/default/@/boot/kernel/tmpfs.ko kfreebsd_module_elf /ROOT/default/@/boot/modules/nvidia.ko kfreebsd_module_elf /ROOT/default/@/boot/kernel/dummynet.ko kfreebsd_module_elf /ROOT/default/@/boot/kernel/ipfw_nat.ko kfreebsd_module_elf /ROOT/default/@/boot/kernel/ipdivert.ko kfreebsd_module_elf /ROOT/default/@/boot/modules/vboxdrv.ko kfreebsd_module_elf /ROOT/default/@/boot/kernel/zlib.ko kfreebsd_module_elf /ROOT/default/@/boot/kernel/opensolaris.ko kfreebsd_module_elf /ROOT/default/@/boot/kernel/linux.ko kfreebsd_module_elf /ROOT/default/@/boot/kernel/crypto.ko set kFreeBSD.hint.fdc.0.at=isa set kFreeBSD.hint.fdc.0.port=0x3F0 set kFreeBSD.hint.fdc.0.irq=6 set kFreeBSD.hint.fdc.0.drq=2 set kFreeBSD.hint.fd.0.at=fdc0 set kFreeBSD.hint.fd.0.drive=0 set kFreeBSD.hint.fd.1.at=fdc0 set kFreeBSD.hint.fd.1.drive=1 set kFreeBSD.hint.atkbdc.0.at=isa set kFreeBSD.hint.atkbdc.0.port=0x060 set kFreeBSD.hint.atkbd.0.at=atkbdc set kFreeBSD.hint.atkbd.0.irq=1 set kFreeBSD.hint.psm.0.at=atkbdc set kFreeBSD.hint.psm.0.irq=12 set kFreeBSD.hint.sc.0.at=isa set kFreeBSD.hint.sc.0.flags=0x100 set kFreeBSD.hint.uart.0.at=isa set kFreeBSD.hint.uart.0.port=0x3F8 set kFreeBSD.hint.uart.0.flags=0x10 set kFreeBSD.hint.uart.0.irq=4 set kFreeBSD.hint.uart.1.at=isa set kFreeBSD.hint.uart.1.port=0x2F8 set kFreeBSD.hint.uart.1.irq=3 set kFreeBSD.hint.ppc.0.at=isa set kFreeBSD.hint.ppc.0.irq=7 set kFreeBSD.hint.atrtc.0.at=isa set kFreeBSD.hint.atrtc.0.port=0x70 set kFreeBSD.hint.atrtc.0.irq=8 set kFreeBSD.hint.attimer.0.at=isa set kFreeBSD.hint.attimer.0.port=0x40 set kFreeBSD.hint.attimer.0.irq=0 set kFreeBSD.hint.wbwd.0.at=isa set kFreeBSD.hint.psm.0.flags=0x1000 set kFreeBSD.kern.ipc.shmseg=1024 set kFreeBSD.kern.ipc.shmmni=1024 set kFreeBSD.kern.maxproc=10000 set kFreeBSD.legal.intel_ipw.license_ack=1 set kFreeBSD.legal.intel_iwi.license_ack=1 set kFreeBSD.vfs.zfs.prefetch_disable=1 set kFreeBSD.hint.acpi_throttle.0.disabled=1 set kFreeBSD.machdep.disable_mtrrs=1 set kFreeBSD.kern.geom.eli.visible_passphrase=2 } -- Kris Moore PC-BSD Software iXsystems