Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Ubuntu UEFI grub does not add Arch Linux correctly

  1. #11
    Join Date
    Aug 2009
    Beans
    Hidden!
    Distro
    Xubuntu 18.04 Bionic Beaver

    Re: Ubuntu UEFI grub does not add Arch Linux correctly

    Quote Originally Posted by Dennis N View Post
    I agree. This is the only way I know to have a maintenance-free UEFI multiboot setup that includes Fedora. Works with other OS too. In particular, I also use it for Arch-based Manjaro. This was discussed extensively last year in this thread:
    https://ubuntuforums.org/showthread.php?t=2355551
    If you should have two Fedora installations, you can still make the custom menu totally maintenance-free by using two EFI system partitions!
    My own working entry:
    Code:
    #!/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 'FEDORA 28            lvm - menu' {
    insmod part_gpt 
    insmod fat
    search --no-floppy --fs-uuid --set=root DE47-135A
    chainloader /EFI/fedora/shimx64.efi 
    }
    This method was proposed for multi-booting by J.A. Watson in his ZDNet columns:
    https://www.zdnet.com/blog/jamies-mostly-linux-stuff/
    In particular, see the Mar. 24,26,30, 2015 columns.
    Also Fedora does not generate a generic symlink for initrd and vmlinuz like every other Linux OS does just after a new kernel is installed.
    So, I created a script to run when a new kernel is installed. I'm running it manually now but, I am very close to getting it right.

    But, I've got some reading to do it looks like.

    Thanks for all of the input.

  2. #12
    Join Date
    Aug 2009
    Beans
    Hidden!
    Distro
    Xubuntu 18.04 Bionic Beaver

    Re: Ubuntu UEFI grub does not add Arch Linux correctly

    I also had Sabayon Linux installed for a while and had the grub customized with the UUIDs but, I did not like it much. It failed the 2 .img entries for Arch test just like the rest.

    But, so much was missing it wasn't worth the effort to get it right. It's Gentoo-based as it uses Entropy (Equo, Rigo) / Emerge as package managers.

    I didn't even save anything on that partition, I just put Xubuntu 18.04 in it's place.

  3. #13
    Join Date
    Jun 2007
    Location
    Arizona U.S.A.
    Beans
    4,340

    Re: Ubuntu UEFI grub does not add Arch Linux correctly

    Quote Originally Posted by Cavsfan View Post
    Also Fedora does not generate a generic symlink for initrd and vmlinuz like every other Linux OS does just after a new kernel is installed.
    So, I created a script to run when a new kernel is installed. I'm running it manually now but, I am very close to getting it right...
    Symbolic link needed in Fedora? The chain loading in the quoted text would always boot the latest kernel without any symbolic link in Fedora since the newest kernel is always placed first in the Fedora grub menu. That's the advantage of doing it this way, and makes it maintenance free.

  4. #14
    Join Date
    Aug 2009
    Beans
    Hidden!
    Distro
    Xubuntu 18.04 Bionic Beaver

    Re: Ubuntu UEFI grub does not add Arch Linux correctly

    Quote Originally Posted by Cavsfan View Post
    Also Fedora does not generate a generic symlink for initrd and vmlinuz like every other Linux OS does just after a new kernel is installed.
    So, I created a script to run when a new kernel is installed. I'm running it manually now but, I am very close to getting it right.
    Quote Originally Posted by Dennis N View Post
    Symbolic link needed in Fedora? The chain loading in the quoted text would always boot the latest kernel without any symbolic link in Fedora since the newest kernel is always placed first in the Fedora grub menu. That's the advantage of doing it this way, and makes it maintenance free.
    I got the script perfected a while ago, forgot to post it here. Adding this script to /etc/kernel/postinst.d/ also boots into the last installed kernel every time.
    Code:
    #!/bin/bash
    #
    
    # We're passed the kernel version being installed
    KERNEL_VERSION="$1"
    
    ln -s -f "initramfs-"$1".img" /boot/initrd.img
    
    ln -s -f "vmlinuz-"$1 /boot/vmlinuz
    
    echo "   SUCCESS: symlink initrd.img created for "initramfs-"$1".img"" >&2
    echo "   SUCCESS: symlink vmlinuz created for "vmlinuz-"$1" >&2
    
    exit 0
    I just called it symlink-kernel in my home directory.
    You install the script with this command:
    Code:
    sudo install symlink-kernel /etc/kernel/postinst.d/symlink-kernel
    This is my Fedora grub menuentry in Xubuntu 18.04. I've got all of my systems customized because if grub is updated on another system, grub moves to that system.
    Arch Linux, Fedora 29, openSUSE TW and Xubuntu 18.04 LTS all have a working 06_custom file

    Code:
    menuentry 'Fedora 29 (Workstation)' --class fedora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-advanced-1216e907-e6c7-4791-841d-a2d2d7a4dcfc' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt
        insmod ext2
        set root='hd2,gpt8'
        search --no-floppy --fs-uuid --set=root 1216e907-e6c7-4791-841d-a2d2d7a4dcfc
        linux  /boot/vmlinuz root=UUID=1216e907-e6c7-4791-841d-a2d2d7a4dcfc ro resume=UUID=bbc771f8-ba61-4e50-aeca-d2754b112aee rhgb quiet nouveau.modeset=0 LANG=en_US.UTF-8
        initrd /boot/initrd.img
    }
    Code:
    [cavsfan@fedora ~]$ sudo blkid | grep -e "Fedora" -e "swap"
    /dev/sdc4: UUID="bbc771f8-ba61-4e50-aeca-d2754b112aee" TYPE="swap" PARTLABEL="swap" PARTUUID="c39d976b-91cd-4d59-a270-91398b764d3f"
    /dev/sdc8: LABEL="Fedora" UUID="1216e907-e6c7-4791-841d-a2d2d7a4dcfc" TYPE="ext4" PARTLABEL="Fedora" PARTUUID="887a3d2f-73ed-4894-b566-3e37294757e7"
    I'm sure some of that is extraneous but, it works and I don't mind.

    There are many ways to skin a cat and I have the UUID method working to my satisfaction.

    If you did install the script, you would see something like this in the terminal output when a new kernel is installed:
    Code:
    Running scriptlet: kernel-core-4.20.6-200.fc29.x86_64                                                                                                                                                             169/169 
       SUCCESS: symlink initrd.img created for initramfs-4.20.6-200.fc29.x86_64.img
       SUCCESS: symlink vmlinuz created for vmlinuz-4.20.6-200.fc29.x86_64

  5. #15
    Join Date
    Dec 2006
    Location
    Hamburg, Germany
    Beans
    149
    Distro
    Lubuntu 19.04 Disco Dingo

    Re: Ubuntu UEFI grub does not add Arch Linux correctly

    Quote Originally Posted by Cavsfan View Post
    I also had Sabayon Linux installed for a while and had the grub customized with the UUIDs but, I did not like it much. It failed the 2 .img entries for Arch test just like the rest.

    But, so much was missing it wasn't worth the effort to get it right. It's Gentoo-based as it uses Entropy (Equo, Rigo) / Emerge as package managers.

    I didn't even save anything on that partition, I just put Xubuntu 18.04 in it's place.
    Question: When you boot to Arch, do you mount your ESP? If yes, Is it /boot or /boot/efi? Since you are using Ubuntu Grub to boot Arch, I assume you mount ESP in Arch as mount point /boot/efi. Since you boot Arch kernel from Ubuntu GRUB, I think this mount is not needed.
    Question: At Arch, when updating the kernel, are the kernel names changing or always the same name?
    Last edited by pencuse; August 2nd, 2019 at 11:05 PM. Reason: clean up questions
    Dell Latitude E7440 (since Dec 2017). CPU: Intel Core i7-4600U, 2 cores, 4 threads; HDD: PM851 256 GB SSD; RAM: 8 GB DDR3L; Graphics: Intel HD 4400
    Dual-boot /dev/sda5: Lubuntu 19.04, /dev/sda6: Arch Linux

  6. #16
    Join Date
    Aug 2009
    Beans
    Hidden!
    Distro
    Xubuntu 18.04 Bionic Beaver

    Re: Ubuntu UEFI grub does not add Arch Linux correctly

    Quote Originally Posted by Cavsfan View Post
    Also Fedora does not generate a generic symlink for initrd and vmlinuz like every other Linux OS does just after a new kernel is installed.
    So, I created a script to run when a new kernel is installed. I'm running it manually now but, I am very close to getting it right...
    Quote Originally Posted by Dennis N View Post
    Symbolic link needed in Fedora? The chain loading in the quoted text would always boot the latest kernel without any symbolic link in Fedora since the newest kernel is always placed first in the Fedora grub menu. That's the advantage of doing it this way, and makes it maintenance free.
    BTW: The bug is still open on this. Still affected by 2 people.

    I currently have Windows 10 and 9 Linux systems installed. My grub jumps from one system to another when a new version is installed on that system. So, I learned to customize them all.

    It's been a while since I've had time to look at this again. I've gotten the cruft out of my initial custom menuentries so, linking UUIDs doesn't sound so far fetched. 4 lines and the brackets make 6 lines for each system and it works every single time.

    I needed a common way to boot every system and this works very well. Also I have Fedora 30 and recently installed Fedora 31.
    In that situation what would you do? Your 30 /EFI/fedora/shimx64.efi file would have been written over by your 31 /EFI/fedora/shimx64.efi file. Getting grub back on Fedora is nearly impossible.
    Most systems have a command to reinstall grub but, not Fedora.
    Ubuntu: sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi/EFI/ubuntu --bootloader-id=ubuntu
    Arch Linux: sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi/Arch_grub --bootloader-id=Arch_grub

    I installed a drive out of my old computer and grub finds the old legacy Linux installs and adds them. On Fedora 31 normal grub runs for 18-20 minutes on this 4th generation i7 and htop shows it's using 100% CPU during this time.
    My custom grub takes < 10 seconds to execute because 10_linux and 30_os-prober are not executed. Here is my Fedora 30 and 31 menuentries:
    Code:
    menuentry 'Fedora 30 (Thirty)' {
    	search --no-floppy --fs-uuid --set=root 43cd93b8-2442-42df-88a3-7bf069390d49
    	linux  /boot/vmlinuz root=UUID=43cd93b8-2442-42df-88a3-7bf069390d49 ro rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 resume=UUID=b564ed75-b9ee-410f-9f87-04afc30a0ff4 rhgb quiet LANG=en_US.UTF-8
    	initrd /boot/initrd.img
    }
    menuentry 'Fedora 31 (Thirty One)' {
    	search --no-floppy --fs-uuid --set=root 3ba4cef1-ee4e-47a9-acd4-52bccb07a237
    	linux  /boot/vmlinuz root=UUID=3ba4cef1-ee4e-47a9-acd4-52bccb07a237 ro rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 resume=UUID=b564ed75-b9ee-410f-9f87-04afc30a0ff4 rhgb quiet
    	initrd /boot/initrd.img
    }
    Bionic Beaver:
    Code:
    menuentry 'Xubuntu 18.04.3 Bionic Beaver LTS' {
    	search --no-floppy --fs-uuid --set=root 338e6d3b-cbd4-496d-9cc2-b688a90c17c3
    	linux  /vmlinuz root=UUID=338e6d3b-cbd4-496d-9cc2-b688a90c17c3 ro quiet resume=/dev/disk/by-uuid/b564ed75-b9ee-410f-9f87-04afc30a0ff4 splash
    	initrd /initrd.img
    }
    menuentry 'Xubuntu 18.04.3 Bionic Beaver LTS (recovery mode)' {
    	search --no-floppy --fs-uuid --set=root 338e6d3b-cbd4-496d-9cc2-b688a90c17c3
    	linux  /vmlinuz root=UUID=338e6d3b-cbd4-496d-9cc2-b688a90c17c3 ro recovery nomodeset
    	initrd /initrd.img
    }
    Code:
    ~$ sudo blkid | grep -e "sdc1:" -e "sdc5" -e "sdc9:" -e "sdc10:" -e "sdc12:"
    /dev/sdc1: UUID="688D-126B" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="15661847-bc65-401a-84b0-97a157f3949f"
    /dev/sdc5: UUID="b564ed75-b9ee-410f-9f87-04afc30a0ff4" TYPE="swap" PARTLABEL="swap" PARTUUID="dc354366-1300-48d4-8a60-133aa2e2ca57"
    /dev/sdc9: LABEL="Fedora" UUID="43cd93b8-2442-42df-88a3-7bf069390d49" TYPE="ext4" PARTLABEL="Fedora" PARTUUID="ee5e61eb-eab9-4794-aabe-a84a910fe9a0"
    /dev/sdc10: LABEL="Bionic" UUID="338e6d3b-cbd4-496d-9cc2-b688a90c17c3" TYPE="ext4" PARTLABEL="Bionic" PARTUUID="4f579967-b025-47dc-b080-64a0865d7165"
    /dev/sdc12: LABEL="Fedora31" UUID="3ba4cef1-ee4e-47a9-acd4-52bccb07a237" TYPE="ext4" PARTLABEL="Fedora31" PARTUUID="c76d0607-d89b-49b5-82fd-f0460ec47cfe"
    Grub currently is on Fedora 31 but, if grub moves to another installation a grub update on Fedora does not re-install grub there.

    Nothing fancy, no background, no font colors, just a custom menu and timeout.


Page 2 of 2 FirstFirst 12

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
  •