Page 6 of 7 FirstFirst ... 4567 LastLast
Results 51 to 60 of 67

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

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

    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
    US
    Posts
    72

    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.
    Intel Core i7-4770K, NVIDIA GeForce GTX 980 Ti, Mobo: ASUSTeK, model: Z87-K, Mem: 16GB, Sound Blaster Audigy Series, HD: Western Digital 1TB SSD, OCZ 500GB SSD and a Toshiba 2TB SATA HD

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

    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
    US
    Posts
    72

    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.
    Intel Core i7-4770K, NVIDIA GeForce GTX 980 Ti, Mobo: ASUSTeK, model: Z87-K, Mem: 16GB, Sound Blaster Audigy Series, HD: Western Digital 1TB SSD, OCZ 500GB SSD and a Toshiba 2TB SATA HD

  5. #55
    Join Date
    Jul 2018
    Location
    US
    Posts
    72

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

    Ok, I figured out what is needed in the 06_custom grub menu. It still uses UUIDs as that is how this method works. I've tried using labels and config files but, never got it to work.
    UUIDs are more stable anyway. If the UUID changes, it is because you have done something to change it and then the custom grub file will require editing but, other than that, it should never need modified.

    External USB drives, which may or may not be plugged in during boot should never be included in this; only hard drives/partitions that are plugged in at all times.

    You just need the UUIDs of the system partitions and the swap file to resume from suspend.

    For openSUSE TW:
    Code:
    cavsfan@openSUSE:~> sudo blkid | grep -e swap -e openSUSE
    /dev/sdc5: UUID="bbc771f8-ba61-4e50-aeca-d2754b112aee" TYPE="swap" PARTLABEL="swap" PARTUUID="dc354366-1300-48d4-8a60-133aa2e2ca57"
    /dev/sdc8: LABEL="openSUSE" UUID="2c4c249d-f188-4236-97f6-99129537a5c2" TYPE="ext4" PARTLABEL="openSUSE" PARTUUID="dcaa5edb-0510-4bab-93e4-b238b329dbf7"
    Here is my custom menuentry for openSUSE TW:
    Code:
    menuentry 'openSUSE Tumbleweed' {
        search --no-floppy --fs-uuid --set=root 2c4c249d-f188-4236-97f6-99129537a5c2
        linux /boot/vmlinuz root=UUID=2c4c249d-f188-4236-97f6-99129537a5c2 splash=silent resume=/dev/disk/by-uuid/bbc771f8-ba61-4e50-aeca-d2754b112aee quiet
        initrd /boot/initrd
    }
    I recently installed MX Linux 18.1, which is based on Debian Stretch but, has some MX repos in it as well. I really like it because it seems sturdy enough to be used as a day to day system.
    Plus it has a working Compiz, Fusion Icon, Emerald, etc. I've only had my grub on MX Linux and Arch Linux since I installed it and only use the custom menu.
    I made /etc/grub.d/10_linux, 20_memtest86+, 30_os-prober and 30_uefi-firmware unexecutable, only after I made sure all systems would boot.

    So, this menu is all I use and have no problem whatsoever.

    Here is my entire /etc/grub.d/06_custom file:
    Code:
    #!/bin/sh
    echo 1>&2 "Adding Arch Linux (rolling, fallback and lts), Fedora (Workstation), openSUSE Tumbleweed, MX 18.1 Continuum, Xubuntu (18.04) LTS and Windows 10"
    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.
    menuentry 'Arch Linux' {
        search --no-floppy --fs-uuid --set=root 688D-126B
        linux  /vmlinuz-linux root=UUID=bbca28b2-503e-4dc8-9850-c54bd0492da8 rw  quiet
        initrd /intel-ucode.img /initramfs-linux.img
    }
    menuentry 'Arch Linux (fallback kernel)' {
        search --no-floppy --fs-uuid --set=root 688D-126B
        linux  /vmlinuz-linux root=UUID=bbca28b2-503e-4dc8-9850-c54bd0492da8 rw  quiet
        initrd /initramfs-linux-fallback.img
    }
    menuentry 'Arch Linux (lts kernel)' {
        search --no-floppy --fs-uuid --set=root 688D-126B
        linux    /vmlinuz-linux-lts root=UUID=bbca28b2-503e-4dc8-9850-c54bd0492da8 rw  quiet
        initrd    /intel-ucode.img /initramfs-linux-lts.img
    }
    menuentry 'Arch Linux (lts fallback kernel)' {
        search --no-floppy --fs-uuid --set=root 688D-126B
        linux   /vmlinuz-linux-lts root=UUID=bbca28b2-503e-4dc8-9850-c54bd0492da8 rw single
        initrd  /initramfs-linux-lts-fallback.img
    }
    menuentry 'Fedora (Workstation) 29' {
        search --no-floppy --fs-uuid --set=root 0991ec51-8d49-4a72-a760-d3dc321f6489
        linux  /boot/vmlinuz root=UUID=0991ec51-8d49-4a72-a760-d3dc321f6489 ro rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 resume=UUID=bbc771f8-ba61-4e50-aeca-d2754b112aee rhgb quiet LANG=en_US.UTF-8
        initrd /boot/initrd.img
    }
    menuentry 'openSUSE Tumbleweed' {
        search --no-floppy --fs-uuid --set=root 2c4c249d-f188-4236-97f6-99129537a5c2
        linux /boot/vmlinuz root=UUID=2c4c249d-f188-4236-97f6-99129537a5c2 splash=silent resume=/dev/disk/by-uuid/bbc771f8-ba61-4e50-aeca-d2754b112aee quiet
        initrd /boot/initrd
    }
    menuentry 'MX 18.1 Continuum' {
        search --no-floppy --fs-uuid --set=root 1cb06a9e-c0dd-467a-bef5-2ad3d1b0e494
        linux    /boot/vmlinuz root=UUID=1cb06a9e-c0dd-467a-bef5-2ad3d1b0e494 ro quiet resume=/dev/disk/by-uuid/bbc771f8-ba61-4e50-aeca-d2754b112aee splash
        initrd    /boot/initrd
    }
    menuentry 'Xubuntu (18.04) LTS' {
        search --no-floppy --fs-uuid --set=root 833501fb-4f83-4d51-9903-685d56cb6891
        linux /vmlinuz root=UUID=833501fb-4f83-4d51-9903-685d56cb6891 ro quiet resume=/dev/disk/by-uuid/bbc771f8-ba61-4e50-aeca-d2754b112aee splash
        initrd /initrd.img
    }
    menuentry 'Windows 10' {
        set root='hd2,gpt1'
        search --no-floppy --fs-uuid --set=root 688D-126B
        chainloader /EFI/Microsoft/Boot/bootmgfw.efi
    }
    Intel Core i7-4770K, NVIDIA GeForce GTX 980 Ti, Mobo: ASUSTeK, model: Z87-K, Mem: 16GB, Sound Blaster Audigy Series, HD: Western Digital 1TB SSD, OCZ 500GB SSD and a Toshiba 2TB SATA HD

  6. #56
    Join Date
    Jul 2018
    Location
    US
    Posts
    72

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

    Quote Originally Posted by karlmistelberger View Post
    Starting the thread with a reference to https://help.ubuntu.com/community/Ma...tomGrub2Screen would have made the discussion much easier.
    You are right, I should have mentioned that Wiki in the first post but, since you cannot edit previous posts, I can't change it now.

    But, I have updated that Wiki with what I posted above. Short and to the point.

    The only changes between Legacy/MBR and UEFI/GPT are the menuentries and how to install/re-install grub.

    There are commands to re-install grub for Arch, Ubuntu and openSUSE; Fedora's grub has to be re-installed the hard way.
    MX Linux 18.1 grub has to be re-installed with a Live USB but, it's fairly simple.
    Intel Core i7-4770K, NVIDIA GeForce GTX 980 Ti, Mobo: ASUSTeK, model: Z87-K, Mem: 16GB, Sound Blaster Audigy Series, HD: Western Digital 1TB SSD, OCZ 500GB SSD and a Toshiba 2TB SATA HD

  7. #57
    Join Date
    Dec 2008
    Location
    FL, USA
    Posts
    1,481

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

    Quote Originally Posted by Cavsfan View Post
    Ok, I figured out what is needed in the 06_custom grub menu. It still uses UUIDs as that is how this method works. I've tried using labels and config files but, never got it to work.
    Maybe the difference between your LABELs failing and mine working is where you put your customization, 06_custom. I don't touch the content of 40_custom when I copy it to 06_custom. All mine is in /boot/grub2/custom.cfg, which 06_custom calls directly at boot.
    Reg. Linux User #211409 *** multibooting since 1992
    Primary: 42.3,TW,15.0 & 13.1 on Haswell w/ RAID
    Secondary: eComStation (OS/2)&42.3 on 965P/Radeon
    Tertiary: TW,15.0,42.3,Fedora,Debian,more on Kaby Lake,Q45,Q43,G41,G3X,965G,Cedar,Caicos,Oland,GT218&&&

  8. #58
    Join Date
    Jan 2014
    Location
    Erlangen
    Posts
    825

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

    Quote Originally Posted by Cavsfan View Post
    You are right, I should have mentioned that Wiki in the first post but, since you cannot edit previous posts, I can't change it now.

    But, I have updated that Wiki with what I posted above. Short and to the point.

    The only changes between Legacy/MBR and UEFI/GPT are the menuentries and how to install/re-install grub.

    There are commands to re-install grub for Arch, Ubuntu and openSUSE; Fedora's grub has to be re-installed the hard way.
    MX Linux 18.1 grub has to be re-installed with a Live USB but, it's fairly simple.
    openSUSE encourages User wiki pages, such as https://en.opensuse.org/User:Karlmis...stemd-networkd and global pages: https://en.opensuse.org/Systemd-networkd A concise but yet complete summary of this thread would be helpful.
    AMD Athlon 4850e (2009), openSUSE 13.1, KDE 4, Intel i3-4130 (2014), i7-6700K (2016), i5-8250U (2018), openSUSE Tumbleweed, KDE Plasma 5

  9. #59
    Join Date
    Jul 2018
    Location
    US
    Posts
    72

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

    Installed Slackware Current. I have been playing around and learning about it. It does not even pull in dependencies for packages you install; you have to do the research and install them yourself.
    There may be some help from some utility you install but, it's not for the timid for sure. I believe it was harder that Arch Linux to get it working well. I had to install 3-4 times before I got it just like I wanted it.
    It's still a work in progress.

    It came with lilo or elilo in my case and I was supposed to remove elilo and install grub but, chose not to and just made a custom menu entry on Arch Linux where my grub is currently installed.

    Installed the Nvidia driver from Nvidia.com so had to add nomodeset to it. I was surprised that was all I had to do to blacklist nouveau but, that did it.
    Code:
    menuentry 'Slackware-14.2+ huge kernel' {
            search --no-floppy --fs-uuid --set=root 6a29af23-7324-43a6-9a66-944df79b335e
            linux   /boot/vmlinuz-huge nomodeset root=UUID=6a29af23-7324-43a6-9a66-944df79b335e ro
            initrd  /boot/initrd.gz
    }
    menuentry 'Slackware-14.2+ generic kernel' {
            search --no-floppy --fs-uuid --set=root 6a29af23-7324-43a6-9a66-944df79b335e
            linux   /boot/vmlinuz-generic nomodeset root=UUID=6a29af23-7324-43a6-9a66-944df79b335e ro
            initrd  /boot/initrd.gz
    }
    menuentry 'Slackware-14.2+ huge kernel (recovery mode)' {
            search --no-floppy --fs-uuid --set=root 6a29af23-7324-43a6-9a66-944df79b335e
            linux   /boot/vmlinuz-huge nomodeset root=UUID=6a29af23-7324-43a6-9a66-944df79b335e ro single
            initrd  /boot/initrd.gz
    }
    Intel Core i7-4770K, NVIDIA GeForce GTX 980 Ti, Mobo: ASUSTeK, model: Z87-K, Mem: 16GB, Sound Blaster Audigy Series, HD: Western Digital 1TB SSD, OCZ 500GB SSD and a Toshiba 2TB SATA HD

  10. #60
    Join Date
    Jul 2018
    Location
    US
    Posts
    72

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

    Quote Originally Posted by Cavsfan View Post
    Ok, I figured out what is needed in the 06_custom grub menu. It still uses UUIDs as that is how this method works. I've tried using labels and config files but, never got it to work.
    Quote Originally Posted by mrmazda View Post
    Maybe the difference between your LABELs failing and mine working is where you put your customization, 06_custom. I don't touch the content of 40_custom when I copy it to 06_custom. All mine is in /boot/grub2/custom.cfg, which 06_custom calls directly at boot.
    I missed this post. I'll look into that some time. But, for now, UUIDs are not too hard to work with adding to 40_custom, changing the +3 to +4 so it starts execution at the 4th line instead of the 3rd line, adding the echo line so you see some output and then saving it as 06_custom. It works on everything I've got installed.

    BTW, I deleted the Slackware partition. That was more of a pain than it was worth.
    Intel Core i7-4770K, NVIDIA GeForce GTX 980 Ti, Mobo: ASUSTeK, model: Z87-K, Mem: 16GB, Sound Blaster Audigy Series, HD: Western Digital 1TB SSD, OCZ 500GB SSD and a Toshiba 2TB SATA HD

Page 6 of 7 FirstFirst ... 4567 LastLast

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
  •