Page 54 of 56 FirstFirst ... 4445253545556 LastLast
Results 531 to 540 of 555

Thread: How to have a custom Grub2 menu that is maintenance free

  1. #531
    Join Date
    Aug 2009
    Beans
    Hidden!

    Re: How to have a custom Grub2 menu that is maintenance free

    Right now, I just have a wallpaper added, custom font colors, a default boot menuentry and a longer timeout.
    With the way they have added the submenu, after the default menuentry, containing the extra boot entries for a system, that default remains pretty consistent.

  2. #532
    Join Date
    Aug 2009
    Beans
    Hidden!

    Re: How to have a custom Grub2 menu that is maintenance free

    Woo Hoo! I am beginning to see how EFI systems can be customized. I just booted into Arch Linux from a custom entry.

    Let's see how these other systems work and I'll have more to say.

  3. #533
    Join Date
    Aug 2009
    Beans
    Hidden!

    Re: How to have a custom Grub2 menu that is maintenance free

    OK, I successfully booted into Arch Linux, Arch Linux's Fallback kernel, Windows 10, openSUSE Tumbleweed and Bionic Beaver 18.04.1 LTS and all went well.
    This is from within Arch Linux though but, the differences should not be much. Just perhaps different on some Linux distributions.
    Arch Linux uses the UUID of the EFI system partition as well as the UUID of the Arch partition, for reasons unbeknownst to me.

    Here is the custom file I used. I will explain what I did before it's added to the Wiki as I need input from you all to make sure it works first.
    Of course I cheat and change that +3 to a +4 so that we can at least see what is between the quotes when doing an update-grub, that and the picture should be the only things you see (a tip Drs305 taught me).
    Code:
    #!/bin/sh
    echo 1>&2 "Adding Arch Linux, Windows 10, openSUSE Tumbleweed and Xubuntu Bionic Beaver 18.04 LTS"
    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' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-bbca28b2-503e-4dc8-9850-c54bd0492da8' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt
        insmod fat
        set root='hd2,gpt1'
        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)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-bbca28b2-503e-4dc8-9850-c54bd0492da8' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt
        insmod fat
        set root='hd2,gpt1'
        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 '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
    }
    menuentry 'openSUSE Tumbleweed' --class opensuse --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-274e3321-d7af-4544-9afa-b1b3c118c325' {
        insmod part_gpt
        insmod ext2
        set root='hd2,gpt7'
        search --no-floppy --fs-uuid --set=root 274e3321-d7af-4544-9afa-b1b3c118c325
        linux /boot/vmlinuz root=/dev/sdc7 splash=silent resume=/dev/disk/by-uuid/be437b2b-9c95-4590-8d32-4da8e6c90318 quiet
        initrd /boot/initrd
    }
    menuentry 'Ubuntu 18.04.1 LTS' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-899f7460-1d2a-43ab-b98e-5e33953cb0c4' {
        insmod part_gpt
        insmod ext2
        set root='hd2,gpt8'
        search --no-floppy --fs-uuid --set=root 899f7460-1d2a-43ab-b98e-5e33953cb0c4
        linux /vmlinuz root=UUID=899f7460-1d2a-43ab-b98e-5e33953cb0c4 ro quiet splash $vt_handoff
        initrd /initrd.img
    }
    This is my system:
    Code:
    [cavsfan@ArchLinux ~]$ sudo blkid |grep sdc
    [sudo] password for cavsfan: 
    /dev/sdc1: UUID="688D-126B" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="3c1b6d6f-8a24-43da-b595-8c304ceee48d"
    /dev/sdc3: UUID="C4968A52968A44C0" TYPE="ntfs" PARTLABEL="Windows_10" PARTUUID="345c85f4-bce7-4bc7-bbe0-db03eb319cad"
    /dev/sdc4: UUID="701AE4631AE427B4" TYPE="ntfs" PARTUUID="1e337754-b45d-45a5-a971-b8cdcae8a002"
    /dev/sdc5: UUID="be437b2b-9c95-4590-8d32-4da8e6c90318" TYPE="swap" PARTLABEL="Basic data partition" PARTUUID="3a259867-656d-41ed-9931-cf15a3bd0148"
    /dev/sdc6: LABEL="ArchLinux" UUID="bbca28b2-503e-4dc8-9850-c54bd0492da8" TYPE="ext4" PARTLABEL="Arch_Linux" PARTUUID="5312b771-0835-4957-80a6-9a8a7107f24a"
    /dev/sdc7: LABEL="opensuse" UUID="274e3321-d7af-4544-9afa-b1b3c118c325" TYPE="ext4" PARTUUID="25d7851a-f45f-4d60-955a-4a31706f8452"
    /dev/sdc8: LABEL="Bionic" UUID="899f7460-1d2a-43ab-b98e-5e33953cb0c4" TYPE="ext4" PARTLABEL="Bionic_Beaver" PARTUUID="c4e0fdc9-7eac-4661-a7c6-c5a00c9a46fc"
    /dev/sdc10: LABEL="Media" UUID="840ac879-510a-4b8d-be01-9d3a5f37dbb2" TYPE="ext4" PARTLABEL="Media" PARTUUID="61e2e7f9-1a98-44f7-881e-ae85fceaf994"
    /dev/sdc2: PARTLABEL="Microsoft reserved partition" PARTUUID="49992d5b-79cd-4934-a12f-11782bb345bd"
    So, this should boot an Ubuntu system, just the partitions and UUID needs changed to match your system.
    Code:
    #!/bin/sh
    echo 1>&2 "Adding Xubuntu Bionic Beaver 18.04.1 LTS"
    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 'Ubuntu 18.04.1 LTS' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-899f7460-1d2a-43ab-b98e-5e33953cb0c4' {
        insmod part_gpt
        insmod ext2
        set root='hd2,gpt8'
        search --no-floppy --fs-uuid --set=root 899f7460-1d2a-43ab-b98e-5e33953cb0c4
        linux /vmlinuz root=UUID=899f7460-1d2a-43ab-b98e-5e33953cb0c4 ro quiet splash $vt_handoff
        initrd /initrd.img
    }
    Right now I see no way to boot Ubuntu to a backup kernel because there is only a /vmlinuz file and no /vmlinuz.old file. Which may be because I haven't had enough kernels get installed yet.

    So, this is a tad more complicated than the Legacy/MBR partitioned systems were but, at least you do not have to go to the OS where your grub is installed and update the grub there when a kernel is added to a different system.
    Because the default grub has the /vmlinuz and /initrd tied to a kernel number.

    A lot if not all of each entry can be copied from the existing /boot/grub/grub.cfg file and then modified, which makes it MUCH easier.
    Last edited by Cavsfan; August 21st, 2018 at 04:33 PM. Reason: addition to last line, changed colors of sample entry, changed openSUSE linux line to add swap file

  4. #534
    Join Date
    Aug 2009
    Beans
    Hidden!

    Re: How to have a custom Grub2 menu that is maintenance free

    First picture of a customized EFI Grub menu. I just took a picture of the menu, which is sort of small but, could not make out the highlighted color of red taking the whole screen.



    All of them work so I made /etc/grub.d/10_linux and /etc/grub.d/30_os-prober unexecutable.

  5. #535
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: How to have a custom Grub2 menu that is maintenance free

    I use a configfile to boot the grub of my other Ubuntu installs.
    And I now like labels over UUID, but you have to manage labels. When I re-install cosmic and reformat partition, it needs label updated.
    You can then have two entries, one to directly boot kernel, and one to configfile to that installs grub with all its entries. I only have used configile to other grub so far.

    Code:
    menuentry "Cosmic 18.10 on sdb12" {
        configfile (hd2,gpt12)/boot/grub/grub.cfg
    }
    
    menuentry "Cosmic 18.10 on sdb12 test" {
        search --set=root --label cosmic_b --hint hd2,gpt12
        configfile /boot/grub/grub.cfg
    }
    
    menuentry 'Live ISOs on SSD' {
    search --set=root --label iso_ssd --hint hd1,gpt5
    configfile /livecdimage.cfg
    } 
    
    menuentry 'Live ISOs on HDD (boot on SSD)' {
    configfile (hd1,6)/livecdimage.cfg
    }
    For more info on UEFI boot install & repair - Regularly Updated :
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  6. #536
    Join Date
    Aug 2009
    Beans
    Hidden!

    Re: How to have a custom Grub2 menu that is maintenance free

    Quote Originally Posted by oldfred View Post
    I use a configfile to boot the grub of my other Ubuntu installs.
    And I now like labels over UUID, but you have to manage labels. When I re-install cosmic and reformat partition, it needs label updated.
    You can then have two entries, one to directly boot kernel, and one to configfile to that installs grub with all its entries. I only have used configile to other grub so far.

    Code:
    menuentry "Cosmic 18.10 on sdb12" {
        configfile (hd2,gpt12)/boot/grub/grub.cfg
    }
    
    menuentry "Cosmic 18.10 on sdb12 test" {
        search --set=root --label cosmic_b --hint hd2,gpt12
        configfile /boot/grub/grub.cfg
    }
    
    menuentry 'Live ISOs on SSD' {
    search --set=root --label iso_ssd --hint hd1,gpt5
    configfile /livecdimage.cfg
    } 
    
    menuentry 'Live ISOs on HDD (boot on SSD)' {
    configfile (hd1,6)/livecdimage.cfg
    }
    +1
    I never would have guessed you could do that with a config file!

  7. #537
    Join Date
    Aug 2009
    Beans
    Hidden!

    Re: How to have a custom Grub2 menu that is maintenance free

    OK, for EFI, I copied the exact code from above into Xubuntu 18.04 and successfully booted into each operating system so I know that it works on Ubuntu.

    Guess I'll add it to the Wiki when I can.

    Basically everything is the same in /etc/default/grub you just change 2 entries. Also the same in /etc/grub.d/05_debian_theme, the 3 menu colors go after line 122.

    It's just the menu entries in /etc/grub.d/06_custom that have drastically changed.

    One cannot no longer prevent grub from moving from one system to another if grub is updated and installed on that other system.

    It's also best to back up the EFI grub immediately after installing a Ubuntu system if you plan on installing another one.

    I have Arch Linux, Windows 10, openSUSE Tumbleweed and Xubuntu 18.04 LTS installed currently and this is what I mean:
    Code:
    cavsfan@cavsfan-Bionic-Beaver:~$ sudo su
    [sudo] password for cavsfan:
    root@cavsfan-Bionic-Beaver:/home/cavsfan# cd /boot/efi/EFI
    root@cavsfan-Bionic-Beaver:/boot/efi/EFI# ls
    Arch_grub  bionic  Boot  Microsoft  opensuse  ubuntu
    The blue is just meant to denote folders. I copied ubuntu to bionic to back it up.

    The grub install command has also changed drastically for EFI as you may as well already know.
    Code:
    sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi/EFI/ubuntu --bootloader-id=ubuntu  --recheck
    I am not sure if every system is the same, you just have to look for this root owned/read only ubuntu folder to re-install grub back on Ubuntu.

  8. #538
    Join Date
    Aug 2009
    Beans
    Hidden!

    Re: How to have a custom Grub2 menu that is maintenance free

    Since no feedback, I guess I am not going to add EFI booting to the Wiki at this time. Everything you need though is in post #534.

    It contains the contents of /etc/grub.d/06_custom for booting to Ubuntu, Arch Linux, openSUSE and Windows 10.

    It has worked for me very, very well for quite a while now.

  9. #539
    Join Date
    Aug 2009
    Beans
    Hidden!

    Re: How to have a custom Grub2 menu that is maintenance free

    Well, after some time and thought, I think I'll add the menuentries for an UEFI (Unified Extensible Firmware Interface) system (SSD) to the Wiki.

    I've learned there are several ways that one could customize the UEFI grub but, the only sure fire way I have been able to do it is with UUIDs.

    Everything else is the same: the fonts, background picture. Just the menuentries and the way you install grub is different.
    Just like the Legacy/MBR partitioned custom grub, this does not ever require any changes except for the same reasons the Non-UEFI systems would.

    I've learned how to customize UEFI grub for Ubuntu, Arch Linux, Fedora and openSUSE. I will only include Ubuntu and Windows 10 in the Wiki though.
    If anyone would be interested in any of the others, just ask and I will happily provide that too.

    I do not know how long it will take me but, it will be done.

  10. #540
    Join Date
    Aug 2009
    Beans
    Hidden!

    Re: How to have a custom Grub2 menu that is maintenance free

    Ok, I figured out what was necessary and what was superfluous in the previous posts I have made about a custom UEFI grub.

    I updated the Wiki, only the menuentries and way to install grub has changed on Ubuntu. I have been installing and experiencing many different Linux systems.

    I would customize each one and there are various differences from system to system.

    I currently have Arch Linux, Fedora 29, openSUSE Tumbleweed, MX Linux 18.1 Continuum, Xubuntu 18.04 LTS and Windows 10.

    If anyone is interested in more information about anything whatsoever, post it here.

    For example here is how easy one boot entry is for Xubuntu Bionic Beaver 18.04 LTS linking UUIDs:
    Code:
    /dev/sdc4: UUID="bbc771f8-ba61-4e50-aeca-d2754b112aee" TYPE="swap" PARTLABEL="swap" PARTUUID="dc354366-1300-48d4-8a60-133aa2e2ca57"
    /dev/sdc9: LABEL="Bionic" UUID="833501fb-4f83-4d51-9903-685d56cb6891" TYPE="ext4" PARTLABEL="Bionic" PARTUUID="4f579967-b025-47dc-b080-64a0865d7165"
    Code:
    menuentry '18.04 LTS (Bionic Beaver) 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
    }
    Also, let me know if I have made any mistakes.
    Last edited by Cavsfan; April 3rd, 2019 at 07:07 PM.

Page 54 of 56 FirstFirst ... 4445253545556 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

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