Results 1 to 5 of 5

Thread: linux or linux efi commands generated by grub2-mkconfig

  1. #1

    Arrow linux or linux efi commands generated by grub2-mkconfig

    I wanted to install Windows 8.1 on my sda and openSuSE 13.2 on sdb. I can't remember all the steps I tried but the final step to get things working correctly was a manual adjustment to the grub.cfg file created by grub2-mkconfig. grub2 documentation is still somewhat sparse but I found articles onand
    System_Administrators_Guide/ch-Working_with_the_GRUB_2_Boot_Loader.html)
    helpful, in particular the comment that

    Statement 1:
    doing an EFI boot grub2 will read its grub.cfg from the EFI System Partition (EFI/opensuse/grub.cfg), not from /boot/grub2/grub.cfg.

    My system looked like
    sda - GPT partitioned with protective MBR (for Windows 8.1)
    sda1 - Windows 8.1 on sda1 Windows 8.1 - GPT partitioning and secure boot
    sda2 - theEFI System Partition sda6 - openSuse 13.2
    sda6 - openSuSE 13.2
    sbd - GPT partitioned with hybrid MBR (selected by openSuSE install)
    sdb1 - openSuSE 13.2

    I think the old MBR scheme with its 'extended partition' is clumsy compared to the much cleaner GPT scheme so I got rid of the hybrid MBR running gdisk expert menu -n option.

    With sdb1 as root and having mounted the EFI System Partition on /boot/efi running
    Code:
       grub2-mkconfig -o /boot/efi/EFI/opensuse grub
    created a config file with the grub2 menuentry for booting from sdb1 executing linux and initrd commands.
    Code:
     ... 
    menuentry 'openSUSE' --class opensuse --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-cb726bc4-faee-4de8-b5e5-77b40cbe0ae6' {
         load_video
         set gfxpayload=keep
         insmod gzio
         insmod part_gpt
         insmod ext2
         set root='hd0,gpt1'
         if [ x$feature_platform_search_hint = xy ]; then
           search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt1 --hint-efi=hd1,gpt1 --hint-baremetal=ahci1,gpt1 --hint='hd0,gpt1'  cb726bc4-faee-4de8-b5e5-77b40cbe0ae6
         else
           search --no-floppy --fs-uuid --set=root cb726bc4-faee-4de8-b5e5-77b40cbe0ae6
         fi
         echo    'Loading Linux 3.16.7-21-desktop ...'
         linux    /boot/vmlinuz-3.16.7-21-desktop root=UUID=cb726bc4-faee-4de8-b5e5-77b40cbe0ae6   quiet resume=/dev/sdb10 splash=silent quiet showopts
         echo    'Loading initial ramdisk ...'
         initrd    /boot/initrd-3.16.7-21-desktop
    }
     ...
    menuentry 'openSUSE 13.2 (x86_64) (on /dev/sda6)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-eeab051c-993a-4ed3-8230-267a2e94c6d8' {
         insmod part_gpt
          insmod ext2
         set root='hd1,gpt6'
         if [ x$feature_platform_search_hint = xy ]; then
           search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt6 --hint-efi=hd0,gpt6 --hint-baremetal=ahci0,gpt6 --hint='hd1,gpt6'  eeab051c-993a-4ed3-8230-267a2e94c6d8
         else
           search --no-floppy --fs-uuid --set=root eeab051c-993a-4ed3-8230-267a2e94c6d8
         fi
         linux /boot/vmlinuz-3.16.6-2-desktop root=UUID=eeab051c-993a-4ed3-8230-267a2e94c6d8 ro BOOT_IMAGE=/boot/x86_64/loader/linux ramdisk_size=512000 ramdisk_blocksize=4096 resume=/dev/disk/by-uuid/3c71e2fd-afc5-47df-bc50-0d76e6d26a65 splash=silent quiet showopts
         initrd /boot/initrd-3.16.6-2-desktop
     }
    That didn't work. Manually editing the commands to linuxefi and initrdefi does work. I have never seen any documentation (yet) about the linuxefi and initrdefi but assume they imply some kind of booting using a GPT partition rather than MBR. If so then:

    Statement 2
    It would seem logical that grub2-mkconfig seeing a root device on a GPT partitioned disk with a protective MBR should the generate linuxefi and inirdefi commands for the grub.cfg file

    Could someone comment whether statements 1 and/or 2 are correct.

    If 2 is correct, is grub2-mkconfig behaviour a openSuSE or a grub problem?

    Finally, what is the difference between .mod and .module as in /usr/lib/grub2/x86_64-efi/ntfs.mod /usr/lib/grub2/x86_64-efi/ntfs.module

    Appreciate any comments.
    Enno

  2. #2
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    9,164
    Blog Entries
    3

    Default Re: linux or linux efi commands generated by grub2-mkconfig

    Quote Originally Posted by fennema View Post
    doing an EFI boot grub2 will read its grub.cfg from the EFI System Partition (EFI/opensuse/grub.cfg), not from /boot/grub2/grub.cfg.
    Not quite right. There can be a grub.cfg in the EFI partition, but that normally tells it to read the grub.cfg in "/boot/grub2".

    Manually editing the commands to linuxefi and initrdefi does work.
    If you turn off secure-boot in your BIOS settings, then you won't need to do that editing. I'm not suggesting that, just explaining what is happening. When you use "linuxefi" it loads the kernel in a different way, and does the signature checking that secure-boot requires.

    Add the line
    Code:
    GRUB_USE_LINUXEFI=true
    to "/etc/default/grub". It might already be there, but commented out. With that line added, it should generate the "linuxefi" commands when you run "grub2-mkconfig".

    Normally that's there. But if you originally installed grub2 in the MBR, and later switched to using EFI, then it fails to add that line.

    Finally, what is the difference between .mod and .module as in /usr/lib/grub2/x86_64-efi/ntfs.mod /usr/lib/grub2/x86_64-efi/ntfs.module
    On my system, the files all end in ".mod". I suspect that your ".module" file was added manually, and may be bogus.
    opensuse Leap 42.3; KDE Plasma 5;
    opensuse tumbleweed; KDE Plasma 5 (test system);

  3. #3
    Join Date
    Sep 2012
    Posts
    4,135

    Default Re: linux or linux efi commands generated by grub2-mkconfig

    Quote Originally Posted by fennema View Post
    Finally, what is the difference between .mod and .module
    .mod is final binary that is loaded at boot time and .module is intermediate unstripped object file that contains symbol and debug information.

  4. #4

    Default Re: linux or linux efi commands generated by grub2-mkconfig

    GRUB_USE_LINUXEFI was not in the original /etc/default/grub file but adding it worked like a song.
    I added the comment that this variable controlled whether loading was in secure mode or not.
    Thanks.

  5. #5
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    9,164
    Blog Entries
    3

    Default Re: linux or linux efi commands generated by grub2-mkconfig

    I'm glad you have things working now.
    opensuse Leap 42.3; KDE Plasma 5;
    opensuse tumbleweed; KDE Plasma 5 (test system);

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
  •