Page 6 of 6 FirstFirst ... 456
Results 51 to 54 of 54

Thread: How to have a custom UEFI grub menu for a multiboot system

  1. #51
    Join Date
    Jan 2014
    Location
    Erlangen
    Posts
    674

    Default Re: How to have a custom UEFI grub menu for a multiboot system

    Quote Originally Posted by Cavsfan View Post
    The 06_custom file is taken from the 40_custom file as follows and is saved as 06_custom so that it appears at the top of the grub menu:
    The +3 is changed to +4 so that execution begins at the 4th line down instead of the 3rd and lets you list the operating systems in the output of grub-mkconfig.
    Code:
    #!/bin/sh
    echo 1>&2 "Adding blah, blah, blah, and blah blah blah"
    exec tail -n +4 $0
    # This file provides an easy way to add custom menu entries.  Simply type the
    # menu entries you want to add after this comment.  Be careful not to change
    # the 'exec tail' line above.
    And yes it absolutely is "maintenance free" once you set it; it's done.
    If you change a UUID for anything, then it's up to you to update the 06_custom file.

    Just like it's up to you to change the file if you add or remove an operating system.

    But, other than what you do to your system it is totally maintenance free.
    If you do not do any of the above, you never have to touch anything and your system will multi boot systems much better than without it.
    If you have one Linux system, this is not worth your time but, if you have Windows 10 and several Linux systems it is well worth the effort.

    All these systems symlink the kernels to the initrd and vmlinuz so they need no modification when a new kernel gets installed, which is the primary purpose I did this in the first place.

    That is all except one - Fedora does not use or create symlinks for it's kernels. However, I created a script that does that for you..
    I already posted the configuration of host erlangen: https://forums.opensuse.org/showthre...60#post2888160

    yast2-partitioner and yast2-bootloader were used for setup relying on UUIDs only. Menu entries are for the root device (10_linux) and systems found by os-prober (30_os-prober). No tinkering required, even when randomly interchanging SATA plugs! See also: https://doc.opensuse.org/documentati...cha.grub2.html

    Yesterday I added the following custom menus:
    Code:
    erlangen:~ # cat /etc/grub.d/40_custom
    #!/bin/sh
    exec tail -n +3 $0
    # This file provides an easy way to add custom menu entries.  Simply type the
    # menu entries you want to add after this comment.  Be careful not to change
    # the 'exec tail' line above.
    
    menuentry 'Tumbleweed /dev/sdb3' {
        search --fs-uuid --no-floppy --set=root 4A24-B10D 
        chainloader /EFI/opensuse/grubx64.efi
    }
    
    menuentry 'Xubuntu 18.04 /dev/sdb2' {
        search --fs-uuid --no-floppy --set=root 6DEC-64F9
        chainloader /EFI/ubuntu/grubx64.efi
    }
    
    menuentry 'Fedora 29 /dev/nvme0n1p1' {
        search --fs-uuid --no-floppy --set=root 6DEC-64F9
        chainloader /EFI/fedora/grubx64.efi
    }
    erlangen:~ #
    These menus start the native boot loaders of the systems found by os-prober. They obviate entering uefi for selecting the boot device.

    I maintain a Wiki for Ubuntu on how to do this with Legacy/MBR partitioned drives and haven't needed to make a change to it in at least 3 years.
    It is used, I've been told my many people. If you google "how to have a custom grub" it will be near the top.

    Not intending to brag, just state a fact. While I have to dispel your statement that it is not maintenance free in the long term, I'm certain that it is indeed just that.
    I presume you refer to: https://help.ubuntu.com/community/Ma...tomGrub2Screen which is indeed helpful. You may want to be more concise and more precise, e.g.

    menuentry 'Fedora 29 /dev/nvme0n1p1' {
    search --fs-uuid --no-floppy --set=root 6DEC-64F9
    chainloader /EFI/fedora/grubx64.efi
    }
    vs.
    menuentry 'Windows 10' --class windows --class os $menuentry_id_option 'osprober-efi-688D-126B' {
    insmod part_gpt
    insmod fat
    set root='hd2,gpt1'
    search --no-floppy --fs-uuid --set=root 688D-126B
    chainloader /EFI/Microsoft/Boot/bootmgfw.efi
    }
    or the requirements for the EFI system partition (discussed above) and more prerequisites.
    AMD Athlon 4850e (2009), openSUSE 13.1, KDE 4, Intel i3-4130 (2014), i7-6700K (2016), i5-8250U (2018), openSUSE Tumbleweed, KDE Plasma 5

  2. #52
    Join Date
    Jul 2018
    Location
    Florida, US
    Posts
    64

    Default Re: How to have a custom UEFI grub menu for a multiboot system

    @mrmazda, Thanks for the kind reply.

    @
    karlmistelberger, Sorry, I missed that post. Yes, that is the wiki I was referring to. A guy I knew that knew Grub2 through and though on the Ubuntu forums came up with that idea and explained it to me.
    So, I asked him if I could make a How to thread and he said go for it. That was when the fun began. They were changing grub from time to time and so, I had to change it. They both had over 200,000 combined views and then Ubuntu forum stopped counting views for some reason.
    That is a problem that they are supposed to be working on but, I have not seen much progress. one can get a feel for how popular a thread is from the view count.
    Then they wanted me to make it into a Wiki and they closed the How to thread. So, I did that and then made it more streamlined and have not needed to touch it in a long time.
    Ubuntu/Debian distros have a /etc/grub.d/05_debian_theme file where you can add three font colors: one for the words that display at the top and bottom of the box that has the menu selections, one for the highlighted line and one for all of the other lines inside the box.
    First you must add a background picture to /boot/grub because that is what makes it look for the font colors in 05_debian_theme.

    If you have a non-SSD, you can use that and once you set it up, you can make 10_linux and 30_os-prober unexecutable as you'll not need to change that. It will just work forever or until you add or remove an operating system.
    It only boots to the latest installed kernel but, I have never had the need to boot into an older kernel. I say the latest installed kernel because if you install an older kernel, the symlinks will point to whatever kernel was installed last

    That looks like a good way to do it with the chainloader entries. I agree that there are more than one way to accomplish a custom grub but, so far with my 1 year of experience with an SSD and UEFI I'm going with UUIDs and the fluff (maybe unnecessary lines) that I have posted.

    But, why use 40_custom and not 06_custom so that the custom entries are above the default ones?
    You may want to be more concise and more precise...
    I see no reason as what is between the quotes is what I alone see during boot up.

    Bottom line: I will eventually get this but, it will take me some time. But, I thought I had accomplished something by getting anything to work.
    Current: Arch Linux, Fedora 29, openSUSE TW, Xubuntu 18.04 LTS and Windows 10.
    Intel Core i7-4770K, NVIDIA GeForce GTX 980 Ti, Mobo: ASUSTeK, model: Z87-K, Mem: 16GB,
    HD: OCZ VERTEX460 480GB SSD, 2 Toshiba 2TB SATA drives, Sound Blaster Audigy Series

  3. #53
    Join Date
    Jan 2014
    Location
    Erlangen
    Posts
    674

    Default Re: How to have a custom UEFI grub menu for a multiboot system

    Quote Originally Posted by Cavsfan View Post
    @mrmazda, Thanks for the kind reply.

    @
    karlmistelberger, Sorry, I missed that post. Yes, that is the wiki I was referring to. A guy I knew that knew Grub2 through and though on the Ubuntu forums came up with that idea and explained it to me.
    So, I asked him if I could make a How to thread and he said go for it. That was when the fun began. They were changing grub from time to time and so, I had to change it. They both had over 200,000 combined views and then Ubuntu forum stopped counting views for some reason.
    That is a problem that they are supposed to be working on but, I have not seen much progress. one can get a feel for how popular a thread is from the view count.
    Then they wanted me to make it into a Wiki and they closed the How to thread. So, I did that and then made it more streamlined and have not needed to touch it in a long time.
    Ubuntu/Debian distros have a /etc/grub.d/05_debian_theme file where you can add three font colors: one for the words that display at the top and bottom of the box that has the menu selections, one for the highlighted line and one for all of the other lines inside the box.
    First you must add a background picture to /boot/grub because that is what makes it look for the font colors in 05_debian_theme.

    If you have a non-SSD, you can use that and once you set it up, you can make 10_linux and 30_os-prober unexecutable as you'll not need to change that. It will just work forever or until you add or remove an operating system.
    It only boots to the latest installed kernel but, I have never had the need to boot into an older kernel. I say the latest installed kernel because if you install an older kernel, the symlinks will point to whatever kernel was installed last

    That looks like a good way to do it with the chainloader entries. I agree that there are more than one way to accomplish a custom grub but, so far with my 1 year of experience with an SSD and UEFI I'm going with UUIDs and the fluff (maybe unnecessary lines) that I have posted.

    But, why use 40_custom and not 06_custom so that the custom entries are above the default ones?
    I used os-prober because it's there and it worked for all distributions installed so far. However it fails with Arch. This didn't affect me directly, but made me search for a better solution. I thought tinkering with Grub2 would be cumbersome. When I read your original post I noticed that adding custom menu entries is straight forward. While I would never have a custom entry for the root system, I wanted to have chain loader entries for the additional systems. As shown in your top post this can be done easily. Furthermore adding these to 40_custom, running grub2-mkconfig -o /boot/grub2/grub.cfg and rebooting worked on the first try. This never happened to me before when tinkering with Grub2. Now I go with:

    Code:
    openSUSE Tumbleweed
    
    Advanced options for openSUSE Tumbleweed
      openSUSE Tumbleweed, with Linux 4.19.12-1-default
      openSUSE Tumbleweed, with Linux 4.19.11-1-default
    
    Tumbleweed /dev/sdb3
    
    Xubuntu 18.04 /dev/sdb2
    
    Fedora 29 /dev/nvme0n1p1
    I see no reason as what is between the quotes is what I alone see during boot up.
    I didn't comment on your boot menu. Starting the thread with a reference to https://help.ubuntu.com/community/Ma...tomGrub2Screen would have made the discussion much easier.

    Bottom line: I will eventually get this but, it will take me some time. But, I thought I had accomplished something by getting anything to work.
    Learning by doing is great. And your 06_custom does what you want it to do. But a tutorial is a different thing.
    AMD Athlon 4850e (2009), openSUSE 13.1, KDE 4, Intel i3-4130 (2014), i7-6700K (2016), i5-8250U (2018), openSUSE Tumbleweed, KDE Plasma 5

  4. #54
    Join Date
    Jul 2018
    Location
    Florida, US
    Posts
    64

    Default Re: How to have a custom UEFI grub menu for a multiboot system

    Quote Originally Posted by karlmistelberger View Post
    But a tutorial is a different thing.
    If you are referring to this thread, it is not a tutorial, it is just a post about how you can have a custom grub menu if you so choose.

    If you're referring to https://help.ubuntu.com/community/Ma...tomGrub2Screen

    It's good as is, I've received a number of compliments on how well it's laid out, etc. An admin told me they point that Wiki out to anyone and everyone so they can use it.

    They both will accomplish a custom grub menu, that does not need modification.

    There may be 14 different ways to have a custom grub menu and mine is but, one of them. Use it or don't, it's totally up to you.
    Current: Arch Linux, Fedora 29, openSUSE TW, Xubuntu 18.04 LTS and Windows 10.
    Intel Core i7-4770K, NVIDIA GeForce GTX 980 Ti, Mobo: ASUSTeK, model: Z87-K, Mem: 16GB,
    HD: OCZ VERTEX460 480GB SSD, 2 Toshiba 2TB SATA drives, Sound Blaster Audigy Series

Page 6 of 6 FirstFirst ... 456

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •