• [gentoo-user] Re: How to make a boot menu?

    From Martin Vaeth@21:1/5 to Michael on Sun Apr 17 18:50:01 2022
    Michael <confabulate@kintzios.com> wrote:
    From: Michael <confabulate@kintzios.com>
    On Sunday, 17 April 2022 16:52:34 BST Peter Humphrey wrote:

    Why not try rEFInd? It handles UEFI booting simply, without the
    no-longer-needed bloat of GRUB.

    Hm. If I'm reading the wiki right, it can't handle choice of run levels with >> a selected kernel. Or is that wrong?

    From what I understand you should be able to tweak kernel command line options
    in /boot/EFI/gentoo/refind_linux.conf.

    You can only choose between fixed combinations. Nothing like the
    possibilities of grub to choose e.g. options for resolution in one
    variable, options for boot system in another variable etc and to
    combine all of those (without adding an exponential number of
    options to select from). Not to speak about the possibility to
    edit the command line freely.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael@21:1/5 to All on Sun Apr 17 19:04:38 2022
    On Sunday, 17 April 2022 17:48:04 BST Martin Vaeth wrote:
    Michael <confabulate@kintzios.com> wrote:
    From: Michael <confabulate@kintzios.com>

    On Sunday, 17 April 2022 16:52:34 BST Peter Humphrey wrote:
    Why not try rEFInd? It handles UEFI booting simply, without the
    no-longer-needed bloat of GRUB.

    Hm. If I'm reading the wiki right, it can't handle choice of run levels
    with a selected kernel. Or is that wrong?

    From what I understand you should be able to tweak kernel command line options in /boot/EFI/gentoo/refind_linux.conf.

    You can only choose between fixed combinations. Nothing like the possibilities of grub to choose e.g. options for resolution in one
    variable, options for boot system in another variable etc and to
    combine all of those (without adding an exponential number of
    options to select from). Not to speak about the possibility to
    edit the command line freely.

    I see. I never had to customise the default set up in depth, or at all from what I recall. Perhaps GRUB with a manually edited grub.cgf is the solution
    to these particular user requirements.
    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCAAdFiEEXqhvaVh2ERicA8Ceseqq9sKVZxkFAmJcVrYACgkQseqq9sKV ZxkrSQ/8CucawkTwyexS47x42br9VO9Gm2f0uchKYyho+vf4x2PBG81Pk7SmSIMH r9HhdCNGD993R2QKi/51cKxYimXra9cgelPFaPd/zAk/4hOQOv6T9WnYQvJ4ZJUn ber9DGsLOIYZFdGUJISiu5EprSEQLeaGXJ3JNVyOuX60W+Sm6BpsOrHdMKNKYVNP ydHeBriMe7EtL8MNEMPghOb4bNpJTbr7AgEsXUqZqQ5m/nzqCfc+rNqTADEjHupD sgh/t8bWSaT2aYsNuEdmy7Bou6KxTUIHaZENQqCYHkHClmwgjxYIHj4VgIRDdMDq SGcbkCYAok9JBs/6NSUJHOsoMB620e52QDCLHUjbem/lxwVRu+VdCxHfvdGcCLEe rbDk0zwe4UWDwIqqMZ7xEYHsm8M4OkkxcB67SAKjfku/Agl60nZRWCKRH3h51o9h EKQisveTsHP9Ne1ZJiTy1Rh/B+mSBFeeXuKM2Bb32Hc49Fw31fsV4//WyOJGVBZ0 JSMfK867mSuvuV7P0jSjeBeYwrdW5FDTDpdQ4lRyvSSMNz6gzFj3DRGl7i7ss4Ms WAbJsZAHiYGOmpBvCmBxGiBwSXbdYjAtKA/UKNDBvcnyctV3fRUWtaL8MeQmFj1i 9G56W4mPVSRSZiO0MxbgX1JRa0BrhMOmZd0ZGwvIK9k1j7qDji8=
    =K779
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Martin Vaeth@21:1/5 to Michael on Sun Apr 17 21:10:01 2022
    Michael <confabulate@kintzios.com> wrote:
    On Sunday, 17 April 2022 17:48:04 BST Martin Vaeth wrote:
    Michael <confabulate@kintzios.com> wrote:
    From: Michael <confabulate@kintzios.com>

    On Sunday, 17 April 2022 16:52:34 BST Peter Humphrey wrote:
    Why not try rEFInd? It handles UEFI booting simply, without the
    no-longer-needed bloat of GRUB.

    Hm. If I'm reading the wiki right, it can't handle choice of run levels >> >> with a selected kernel. Or is that wrong?

    From what I understand you should be able to tweak kernel command line
    options in /boot/EFI/gentoo/refind_linux.conf.

    You can only choose between fixed combinations. Nothing like the
    possibilities of grub to choose e.g. options for resolution in one
    variable, options for boot system in another variable etc and to
    combine all of those (without adding an exponential number of
    options to select from). Not to speak about the possibility to
    edit the command line freely.

    I see. I never had to customise the default set up in depth, or at all from what I recall. Perhaps GRUB with a manually edited grub.cgf is the solution to these particular user requirements

    Yes, without a manually written grub.cfg you get none of these features -
    the default grub.cfg is just horrible.
    Well, the most powerful feature is probably still available:
    The possibility to edit the kernel's command line, partition and path which theoretically can cover everything else, though it is rather inconvenient.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rich Freeman@21:1/5 to martin@mvath.de on Mon Apr 18 02:00:01 2022
    On Sun, Apr 17, 2022 at 3:00 PM Martin Vaeth <martin@mvath.de> wrote:

    Yes, without a manually written grub.cfg you get none of these features -
    the default grub.cfg is just horrible.
    Well, the most powerful feature is probably still available:
    The possibility to edit the kernel's command line, partition and path which theoretically can cover everything else, though it is rather inconvenient.

    The GRUB bootloader just parses its config file, which can be manually
    edited as you point out. You also have grub-mkconfig which outputs a
    config file for the bootloader to use, and it is typically used to
    scan /boot and find all the kernels/initramfs present and create menu
    items.

    grub-mkconfig just runs a bunch of shell scripts to generate
    everything, so you can have it autogenerate anything you want. It
    seems like a rough way to do it would be to just copy the regular
    linux once for each runlevel so that you end up with each kernel show
    up more than once, and then the individual runlevels can be tweaked accordingly. Obviously it would be more elegant to add a loop over a configuration variable.

    I'm not aware of anybody having actually done this, however, so you'd
    have to DIY.

    --
    Rich

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Martin Vaeth@21:1/5 to Rich Freeman on Mon Apr 18 07:40:01 2022
    Rich Freeman <rich0@gentoo.org> wrote:
    On Sun, Apr 17, 2022 at 3:00 PM Martin Vaeth <martin@mvath.de> wrote:

    Yes, without a manually written grub.cfg you get none of these features -
    the default grub.cfg is just horrible.
    Well, the most powerful feature is probably still available:
    The possibility to edit the kernel's command line, partition and path which >> theoretically can cover everything else, though it is rather inconvenient.

    Just to clarify: I mean to edit the kernel's command line immediately
    before booting (that is, for instance, in emergency cases like a non-booting new kernel together with a damaged init-system. Or when you are at a
    conference with your laptop and need to connect to a beamer which for some reason did not display anything so that perhaps forcing a different
    resolution helps. I had all this, and wouldn't like to miss grub in such situations).

    The GRUB bootloader just parses its config file, which can be manually
    edited as you point out.

    This config file has many shell-like features like functions and variables
    and can source helper libraries. I suggest to use of all this! (See below.)

    You also have grub-mkconfig

    grub-mkconfig is meant for binary distributions. A gentoo user typically compiles the kernel manually, anyway, and they typically know precisely
    which kernel they want to boot. So they have no use for any of the (mis-)features from grub-mkconfig.
    They might use it *once* to get some grub.cfg to start with, but then
    I recommend to dump grub-mkconfig.

    grub-mkconfig just runs a bunch of shell scripts to generate
    everything [...] Obviously it would be more elegant to add a loop over
    a configuration variable.

    That's not what I meant. I meant to dump grub-mkconfig completely and
    not writing any substitute for it. Instead, write your grub.cfg manually, making full use of its features like variables and functions.

    For instance, I have one menu entry for each init-system (openrc,
    systems, and 3 more for emergency shells). But selecting such an
    entry just changes a (grub.cfg) variable and does not boot yet.

    Then there are menu entries for selecting/editing the resolution
    variables, etc.

    And only a few menu entries are for actually choosing the kernel and
    booting it (according to the previously set variables).

    Of course, there are default values for the variables if I make no
    selection and a default boot entry as well which normally is
    auto-booted after a few seconds.

    Note that if I would like to have a separate entry for each
    combination I might ever have a need for, I would need hundreds of
    menu entries, as their number is exponential in the number of
    variables which are used.

    I'm not aware of anybody having actually done this, however, so you'd
    have to DIY.

    https://github.com/vaeth/grub-cfg-mv/releases/
    You can install it with sys-boot/grub-cfg-mv in the mv overlay, but
    you still have to read the instructions and write the "main" grub.cfg
    by yourself (although you can start from the example and from the
    grub.cfg generated by one initial call of grub-mkconfig).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Neil Bothwick@21:1/5 to Rich Freeman on Mon Apr 18 19:40:01 2022
    On Sun, 17 Apr 2022 19:50:41 -0400, Rich Freeman wrote:

    grub-mkconfig just runs a bunch of shell scripts to generate
    everything, so you can have it autogenerate anything you want. It
    seems like a rough way to do it would be to just copy the regular
    linux once for each runlevel so that you end up with each kernel show
    up more than once, and then the individual runlevels can be tweaked accordingly. Obviously it would be more elegant to add a loop over a configuration variable.

    I'm not aware of anybody having actually done this, however, so you'd
    have to DIY.

    Actually, that's how I do it on my remaining MBR/BIOS systems. A script
    that loops through the kernels and writes the relevant configs after
    reading settings from a config file (that makes it easier to use the same script on differing machines).


    --
    Neil Bothwick

    When companies ship Styrofoam, what do they pack it in?

    -----BEGIN PGP SIGNATURE-----

    iQIzBAEBCAAdFiEE8k9T/rX16EJxEKG692eFu0QSMJgFAmJdoagACgkQ92eFu0QS MJi8QA//X8i76BdsIjvnpc8xPObZ/wzhHD4DaB4JtQzgclfAmktnE4rVdos50nVO S+HyLSMZsiGjVahPQ4V3gs0kxmkcgucnbodRBSTABV+syTkXMo6D7BgHabmidmH1 jMCwSW+qYm3HEDVIPgCNkRcANKlnt/6nwZdoXqvckJW59guLpQbXueud7UbOe2JP rPGI7uYj8JcorFW8LwucSPugt+Ng5ZE3supGPR6Aw1EtppF6TxHabRm9JOMpop3h UAfQOmXmxw6LdLiaAzMgQK0baiDAzqQFZXTpq0MdtL/IWn3RBsgtuzJOVBh6Z+WH ZCn7SujkmZ/xFyxsPdKVHEQ6nhc0AmkwjyNM7+TbbuBfXYL4X6KD7pvlOGpJmCWt yUNvNolIN91WZDuTIVCm26/9Opc0yS2fj45By0GMuHSXOxHEQtRpDfXIhrQ1sZWz XlxfznySv0R3U5a8xbWPWVJ2W3WoaztPVitZ/PvFUYLMLEAlckBGv84/CzPol6NN kaGLIteTAAZf0txVlg0cyUd5YI5tSxwvwBy1PNPAlOkRr6Y/CbC2cKT3ZohOPl/Q 7rnQxjpjdcmlqquhZWm2qqaYohQfo5jvoQa9g4h/R0H+bQ8ADV4NXLTI8KTnIBjW 38FsxGshs17jFIML88FKD3qorAlRtsG4dpNA8UOuDTElkWfDR5I=
    =0cch
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Neil Bothwick@21:1/5 to Martin Vaeth on Mon Apr 18 19:40:01 2022
    On Sun, 17 Apr 2022 16:48:04 -0000 (UTC), Martin Vaeth wrote:

    Hm. If I'm reading the wiki right, it can't handle choice of run
    levels with a selected kernel. Or is that wrong?

    From what I understand you should be able to tweak kernel command
    line options in /boot/EFI/gentoo/refind_linux.conf.

    You can only choose between fixed combinations. Nothing like the possibilities of grub to choose e.g. options for resolution in one
    variable, options for boot system in another variable etc and to
    combine all of those (without adding an exponential number of
    options to select from). Not to speak about the possibility to
    edit the command line freely.

    I haven't used it for some years, but I recall configuring it manually,
    as I have the same approach as Peter with multiple runlevels.


    --
    Neil Bothwick

    "Designing pages in HTML is like having sex in a bathtub. If you don't
    know anything about sex, it won't help to know a lot about bathtubs."

    -----BEGIN PGP SIGNATURE-----

    iQIzBAEBCAAdFiEE8k9T/rX16EJxEKG692eFu0QSMJgFAmJdoSUACgkQ92eFu0QS MJixdRAAkWsomwWm2Ip5JORSbC9I+zjAHv+vgjA87JLj7zAJC85zDpTo6DftfwIC 31KLhqeeMsHXmP6Jftv0UCR1OILD+HlaRySLAHa1ovecr7Voil/3K3tRar31IRhA eil/E6O2bgyGBMtNdNG4G8SS4cKEFw0L0M3uajArJ3dhlexCKhnFYl4E/nqDtZpd BhiobKvkG783RRuGrMKhVfQMe8dA5iu6/HTn5kweOfSfbWyrfRnysckNy+tekg7i iOK33YA9Ct/vjz+jwHfGAym8L9ZQBJfEcLfoU6BNDARWWd51L4EkulbkQ5tKae8i q/ICl0G9t32m76NZ9h/PiTux0ZY5V5VOH+XtvuAlmMtuw2/7ibcfJojOCT7eraWn GU/QJ4TyAh32Crs30/o0lZ+U76OCBZw4lGjstnMxNOoNe7nKTI2ef/cRK+mvviSH N/tgWOMEsOlxnw+QJp8I/CcvuYPrN7NUrr63+sp4aZuZzc/X5i/jQXiDwSWtQRe8 8ww7nTkTar3SEWIKXgU11WxQsqE6FhUglO0QDDxa6NuRMaEOj4ybHvZutWIcqo/R reX4d4Kd0vIYpnsEllMMGQoe+EefjEDZZmwcgeLe5CaOboGbhSCaLZydO2+fPgUA tcF+rqutTrO9LFJ8ayWymT/t8/LazjFmZ/78FWW/vI1m0Psbit4=
    =/fuJ
    -----END PGP SIGNATURE-----

    --- So