Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
grub2-mkconfig mixing up and selecting wrong kernel
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
awalp
n00b
n00b


Joined: 29 May 2003
Posts: 71

PostPosted: Fri Aug 14, 2015 1:38 pm    Post subject: grub2-mkconfig mixing up and selecting wrong kernel Reply with quote

Simply put, I have Gentoo, Arch Linux, and some other development Gentoo installs on the same harddrive.

Actually I have an SSD with Windows 10 & 7, and an HDD with Gentoo, Arch, and Gentoo-dev.
When it boots I have 'Windows 10', 'Windows 7', 'Gentoo Linux (which reboots laptop and loads grub)
[I thought this would be the hard part but it was the easy part]

All the multiple Linux installations share the same /boot partition,
I just want to be able to configure grub to setup the multiple Linux system with grub2-mkconfig from one system my primary Gentoo installation.

When I run grub2-mkconfig on my main Gentoo system....
...its using vmlinuz-linux (Arch kernel) as my kernel for my Gentoo system.


I have succesfully set my Arch Linux in 40_custom.conf in /etc/grub.d/ which is added at the end of the list.
but its now using vmlinuz-linux(Arch) for the default Gentoo Linux first option.
So when I select Gentoo Linux, It boots gentoo using the arch kernel and things are no good.

My question simply is... how can I get grub2-mkconfig to generate a config file using kernel-genkernel-x86_64-4.1.5-ck? Renaming the kernel files is not an option.


Code:
m17xr3 ~ # ls /boot/     
System.map-genkernel-x86_64-4.0.5-gentoo   initramfs-linux-fallback.img
System.map-genkernel-x86_64-4.1.5-ck       initramfs-linux.img
System.map-genkernel-x86_64-4.1.5-ck-sdb9  kernel-genkernel-x86_64-4.0.5-gentoo
grub                                       kernel-genkernel-x86_64-4.1.5-ck
initramfs-genkernel-x86_64-4.0.5-gentoo    kernel-genkernel-x86_64-4.1.5-ck-sdb9
initramfs-genkernel-x86_64-4.1.5-ck        kernel-genkernel-x86_64-4.1.5-ck.bak
initramfs-genkernel-x86_64-4.1.5-ck-sdb9   lost+found
initramfs-genkernel-x86_64-4.1.5-ck.bak    vmlinuz-linux
m17xr3 ~ #


Code:
m17xr3 ~ # grub2-mkconfig
Generating grub configuration file ...
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  load_env
fi                                                                                                               
if [ "${next_entry}" ] ; then                                                                                   
   set default="${next_entry}"                                                                                   
   set next_entry=                                                                                               
   save_env next_entry                                                                                           
   set boot_once=true                                                                                           
else                                                                                                             
   set default="0"                                                                                               
fi                                                                                                               
                                                                                                                 
if [ x"${feature_menuentry_id}" = xy ]; then                                                                     
  menuentry_id_option="--id"                                                                                     
else                                                                                                             
  menuentry_id_option=""                                                                                         
fi                                                                                                               

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_msdos
insmod xfs
set root='hd1,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5  73c46c5f-b065-43aa-88ba-f6d45a7e2c1a
else
  search --no-floppy --fs-uuid --set=root 73c46c5f-b065-43aa-88ba-f6d45a7e2c1a
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=1920x1080x32
  load_video
  insmod gfxterm
fi
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/initramfs-linux.img
menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-73c46c5f-b065-43aa-88ba-f6d45a7e2c1a' {
        load_video
        set gfxpayload=1920x1080x32
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd1,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  abd330e0-437d-414a-8aef-19651233f86f
        else
          search --no-floppy --fs-uuid --set=root abd330e0-437d-414a-8aef-19651233f86f
        fi
        echo    'Loading Linux linux ...'
        linux   /vmlinuz-linux root=UUID=73c46c5f-b065-43aa-88ba-f6d45a7e2c1a ro 
        echo    'Loading initial ramdisk ...'
        initrd  /initramfs-linux.img
}
submenu 'Advanced options for Gentoo GNU/Linux' $menuentry_id_option 'gnulinux-advanced-73c46c5f-b065-43aa-88ba-f6d45a7e2c1a' {
        menuentry 'Gentoo GNU/Linux, with Linux linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-73c46c5f-b065-43aa-88ba-f6d45a7e2c1a' {
                load_video
                set gfxpayload=1920x1080x32
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd1,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  abd330e0-437d-414a-8aef-19651233f86f
                else
                  search --no-floppy --fs-uuid --set=root abd330e0-437d-414a-8aef-19651233f86f
                fi
                echo    'Loading Linux linux ...'
                linux   /vmlinuz-linux root=UUID=73c46c5f-b065-43aa-88ba-f6d45a7e2c1a ro 
                echo    'Loading initial ramdisk ...'
                initrd  /initramfs-linux.img
        }
        menuentry 'Gentoo GNU/Linux, with Linux linux (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-recovery-73c46c5f-b065-43aa-88ba-f6d45a7e2c1a' {
                load_video
                set gfxpayload=1920x1080x32
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd1,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  abd330e0-437d-414a-8aef-19651233f86f
                else
                  search --no-floppy --fs-uuid --set=root abd330e0-437d-414a-8aef-19651233f86f
                fi
                echo    'Loading Linux linux ...'
                linux   /vmlinuz-linux root=UUID=73c46c5f-b065-43aa-88ba-f6d45a7e2c1a ro single
                echo    'Loading initial ramdisk ...'
                initrd  /initramfs-linux.img
        }
Found linux image: /boot/kernel-genkernel-x86_64-4.1.5-ck-sdb9
Found initrd image: /boot/initramfs-genkernel-x86_64-4.1.5-ck-sdb9
        menuentry 'Gentoo GNU/Linux, with Linux x86_64-4.1.5-ck-sdb9' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-4.1.5-ck-sdb9-advanced-73c46c5f-b065-43aa-88ba-f6d45a7e2c1a' {
                load_video
                set gfxpayload=1920x1080x32
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd1,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  abd330e0-437d-414a-8aef-19651233f86f
                else
                  search --no-floppy --fs-uuid --set=root abd330e0-437d-414a-8aef-19651233f86f
                fi
                echo    'Loading Linux x86_64-4.1.5-ck-sdb9 ...'
                linux   /kernel-genkernel-x86_64-4.1.5-ck-sdb9 root=UUID=73c46c5f-b065-43aa-88ba-f6d45a7e2c1a ro 
                echo    'Loading initial ramdisk ...'
                initrd  /initramfs-genkernel-x86_64-4.1.5-ck-sdb9
        }
        menuentry 'Gentoo GNU/Linux, with Linux x86_64-4.1.5-ck-sdb9 (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-4.1.5-ck-sdb9-recovery-73c46c5f-b065-43aa-88ba-f6d45a7e2c1a' {
                load_video
                set gfxpayload=1920x1080x32
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd1,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  abd330e0-437d-414a-8aef-19651233f86f
                else
                  search --no-floppy --fs-uuid --set=root abd330e0-437d-414a-8aef-19651233f86f
                fi
                echo    'Loading Linux x86_64-4.1.5-ck-sdb9 ...'
                linux   /kernel-genkernel-x86_64-4.1.5-ck-sdb9 root=UUID=73c46c5f-b065-43aa-88ba-f6d45a7e2c1a ro single
                echo    'Loading initial ramdisk ...'
                initrd  /initramfs-genkernel-x86_64-4.1.5-ck-sdb9
        }
Found linux image: /boot/kernel-genkernel-x86_64-4.1.5-ck.bak
Found initrd image: /boot/initramfs-genkernel-x86_64-4.1.5-ck.bak
        menuentry 'Gentoo GNU/Linux, with Linux x86_64-4.1.5-ck.bak' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-4.1.5-ck.bak-advanced-73c46c5f-b065-43aa-88ba-f6d45a7e2c1a' {
                load_video
                set gfxpayload=1920x1080x32
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd1,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  abd330e0-437d-414a-8aef-19651233f86f
                else
                  search --no-floppy --fs-uuid --set=root abd330e0-437d-414a-8aef-19651233f86f
                fi
                echo    'Loading Linux x86_64-4.1.5-ck.bak ...'
                linux   /kernel-genkernel-x86_64-4.1.5-ck.bak root=UUID=73c46c5f-b065-43aa-88ba-f6d45a7e2c1a ro 
                echo    'Loading initial ramdisk ...'
                initrd  /initramfs-genkernel-x86_64-4.1.5-ck.bak
        }
        menuentry 'Gentoo GNU/Linux, with Linux x86_64-4.1.5-ck.bak (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-4.1.5-ck.bak-recovery-73c46c5f-b065-43aa-88ba-f6d45a7e2c1a' {
                load_video
                set gfxpayload=1920x1080x32
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd1,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  abd330e0-437d-414a-8aef-19651233f86f
                else
                  search --no-floppy --fs-uuid --set=root abd330e0-437d-414a-8aef-19651233f86f
                fi
                echo    'Loading Linux x86_64-4.1.5-ck.bak ...'
                linux   /kernel-genkernel-x86_64-4.1.5-ck.bak root=UUID=73c46c5f-b065-43aa-88ba-f6d45a7e2c1a ro single
                echo    'Loading initial ramdisk ...'
                initrd  /initramfs-genkernel-x86_64-4.1.5-ck.bak
        }
Found linux image: /boot/kernel-genkernel-x86_64-4.1.5-ck
Found initrd image: /boot/initramfs-genkernel-x86_64-4.1.5-ck
        menuentry 'Gentoo GNU/Linux, with Linux x86_64-4.1.5-ck' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-4.1.5-ck-advanced-73c46c5f-b065-43aa-88ba-f6d45a7e2c1a' {
                load_video
                set gfxpayload=1920x1080x32
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd1,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  abd330e0-437d-414a-8aef-19651233f86f
                else
                  search --no-floppy --fs-uuid --set=root abd330e0-437d-414a-8aef-19651233f86f
                fi
                echo    'Loading Linux x86_64-4.1.5-ck ...'
                linux   /kernel-genkernel-x86_64-4.1.5-ck root=UUID=73c46c5f-b065-43aa-88ba-f6d45a7e2c1a ro 
                echo    'Loading initial ramdisk ...'
                initrd  /initramfs-genkernel-x86_64-4.1.5-ck
        }
        menuentry 'Gentoo GNU/Linux, with Linux x86_64-4.1.5-ck (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-4.1.5-ck-recovery-73c46c5f-b065-43aa-88ba-f6d45a7e2c1a' {
                load_video
                set gfxpayload=1920x1080x32
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd1,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  abd330e0-437d-414a-8aef-19651233f86f
                else
                  search --no-floppy --fs-uuid --set=root abd330e0-437d-414a-8aef-19651233f86f
                fi
                echo    'Loading Linux x86_64-4.1.5-ck ...'
                linux   /kernel-genkernel-x86_64-4.1.5-ck root=UUID=73c46c5f-b065-43aa-88ba-f6d45a7e2c1a ro single
                echo    'Loading initial ramdisk ...'
                initrd  /initramfs-genkernel-x86_64-4.1.5-ck
        }
Found linux image: /boot/kernel-genkernel-x86_64-4.0.5-gentoo
Found initrd image: /boot/initramfs-genkernel-x86_64-4.0.5-gentoo
        menuentry 'Gentoo GNU/Linux, with Linux x86_64-4.0.5-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-4.0.5-gentoo-advanced-73c46c5f-b065-43aa-88ba-f6d45a7e2c1a' {
                load_video
                set gfxpayload=1920x1080x32
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd1,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  abd330e0-437d-414a-8aef-19651233f86f
                else
                  search --no-floppy --fs-uuid --set=root abd330e0-437d-414a-8aef-19651233f86f
                fi
                echo    'Loading Linux x86_64-4.0.5-gentoo ...'
                linux   /kernel-genkernel-x86_64-4.0.5-gentoo root=UUID=73c46c5f-b065-43aa-88ba-f6d45a7e2c1a ro 
                echo    'Loading initial ramdisk ...'
                initrd  /initramfs-genkernel-x86_64-4.0.5-gentoo
        }
        menuentry 'Gentoo GNU/Linux, with Linux x86_64-4.0.5-gentoo (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-4.0.5-gentoo-recovery-73c46c5f-b065-43aa-88ba-f6d45a7e2c1a' {
                load_video
                set gfxpayload=1920x1080x32
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd1,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  abd330e0-437d-414a-8aef-19651233f86f
                else
                  search --no-floppy --fs-uuid --set=root abd330e0-437d-414a-8aef-19651233f86f
                fi
                echo    'Loading Linux x86_64-4.0.5-gentoo ...'
                linux   /kernel-genkernel-x86_64-4.0.5-gentoo root=UUID=73c46c5f-b065-43aa-88ba-f6d45a7e2c1a ro single
                echo    'Loading initial ramdisk ...'
                initrd  /initramfs-genkernel-x86_64-4.0.5-gentoo
        }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# 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" {
        load_video
        set gfxpayload=1920x1080x32
        set root=(hd1,8)
        linux /vmlinuz-linux root=UUID=fe765799-1cf8-42a1-bf25-74ac9e7dc4d1
        initrd /initramfs-linux.img
}
menuentry "Arch Linux /boot" {
        load_video
        set gfxpayload=1920x1080x32
        set root=(hd1,8)
        linux /boot/vmlinuz-linux root=UUID=fe765799-1cf8-42a1-bf25-74ac9e7dc4d1
        initrd  /boot/initramfs-linux.img
}
menuentry 'Gentoo Linux sdb9' {
        load_video
        set gfxpayload=1920x1080x32
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root=(hd1,9)
        echo    'Loading Linux x86_64-4.1.5-ck-sdb2 ...'
        linux   /kernel-genkernel-x86_64-4.1.5-ck-sdb9 root=UUID=7a1a3101-b283-450e-903f-a8e05994198e ro
        echo    'Loading initial ramdisk ...'
        initrd  /initramfs-genkernel-x86_64-4.1.5-ck-sdb9
}

menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-73c46c5f-b065-43aa-88ba-f6d45a7e2c1a' {
        load_video
        set gfxpayload=1920x1080x32
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd1,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  abd330e0-437d-414a-8aef-19651233f86f
        else
          search --no-floppy --fs-uuid --set=root abd330e0-437d-414a-8aef-19651233f86f
        fi
        echo    'Loading Linux x86_64-4.1.5-ck ...'
        linux   /kernel-genkernel-x86_64-4.1.5-ck root=UUID=73c46c5f-b065-43aa-88ba-f6d45a7e2c1a ro 
        echo    'Loading initial ramdisk ...'
        initrd  /initramfs-genkernel-x86_64-4.1.5-ck
}
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
done










Grub was working fine before... here is my backup working configuration file... but it doesn't contain all the kernels I need.


Code:
m17xr3 ~ # cat /boot/grub/grub.cfg.working
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_msdos
insmod xfs
set root='hd1,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos5 --hint-efi=hd1,msdos5 --hint-baremetal=ahci1,msdos5  73c46c5f-b065-43aa-88ba-f6d45a7e2c1a
else
  search --no-floppy --fs-uuid --set=root 73c46c5f-b065-43aa-88ba-f6d45a7e2c1a
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=1920x1080x32
  load_video
  insmod gfxterm
fi
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-73c46c5f-b065-43aa-88ba-f6d45a7e2c1a' {
        load_video
        set gfxpayload=1920x1080x32
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd1,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  abd330e0-437d-414a-8aef-19651233f86f
        else
          search --no-floppy --fs-uuid --set=root abd330e0-437d-414a-8aef-19651233f86f
        fi
        echo    'Loading Linux x86_64-4.1.5-ck ...'
        linux   /kernel-genkernel-x86_64-4.1.5-ck root=UUID=73c46c5f-b065-43aa-88ba-f6d45a7e2c1a ro 
        echo    'Loading initial ramdisk ...'
        initrd  /initramfs-genkernel-x86_64-4.1.5-ck
}
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-73c46c5f-b065-43aa-88ba-f6d45a7e2c1a' {
        load_video
        set gfxpayload=1920x1080x32
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd1,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  abd330e0-437d-414a-8aef-19651233f86f
        else
          search --no-floppy --fs-uuid --set=root abd330e0-437d-414a-8aef-19651233f86f
        fi
        echo    'Loading vmlinuz-linux ...'
        linux   /vmlinuz-linux root=UUID=fe765799-1cf8-42a1-bf25-74ac9e7dc4d1
        echo    'Loading initial ramdisk ...'
        initrd  /initramfs-linux.img
}

submenu 'Advanced options for Gentoo GNU/Linux' $menuentry_id_option 'gnulinux-advanced-73c46c5f-b065-43aa-88ba-f6d45a7e2c1a' {
        menuentry 'Gentoo GNU/Linux, with Linux x86_64-4.1.5-ck' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-4.1.5-ck-advanced-73c46c5f-b065-43aa-88ba-f6d45a7e2c1a' {
                load_video
                set gfxpayload=1920x1080x32
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd1,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  abd330e0-437d-414a-8aef-19651233f86f
                else
                  search --no-floppy --fs-uuid --set=root abd330e0-437d-414a-8aef-19651233f86f
                fi
                echo    'Loading Linux x86_64-4.1.5-ck ...'
                linux   /kernel-genkernel-x86_64-4.1.5-ck root=UUID=73c46c5f-b065-43aa-88ba-f6d45a7e2c1a ro 
                echo    'Loading initial ramdisk ...'
                initrd  /initramfs-genkernel-x86_64-4.1.5-ck
        }
        menuentry 'Gentoo GNU/Linux, with Linux x86_64-4.1.5-ck (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-4.1.5-ck-recovery-73c46c5f-b065-43aa-88ba-f6d45a7e2c1a' {
                load_video
                set gfxpayload=1920x1080x32
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd1,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  abd330e0-437d-414a-8aef-19651233f86f
                else
                  search --no-floppy --fs-uuid --set=root abd330e0-437d-414a-8aef-19651233f86f
                fi
                echo    'Loading Linux x86_64-4.1.5-ck ...'
                linux   /kernel-genkernel-x86_64-4.1.5-ck root=UUID=73c46c5f-b065-43aa-88ba-f6d45a7e2c1a ro single
                echo    'Loading initial ramdisk ...'
                initrd  /initramfs-genkernel-x86_64-4.1.5-ck
        }
        menuentry 'Gentoo GNU/Linux, with Linux x86_64-4.0.5-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-4.0.5-gentoo-advanced-73c46c5f-b065-43aa-88ba-f6d45a7e2c1a' {
                load_video
                set gfxpayload=1920x1080x32
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd1,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  abd330e0-437d-414a-8aef-19651233f86f
                else
                  search --no-floppy --fs-uuid --set=root abd330e0-437d-414a-8aef-19651233f86f
                fi
                echo    'Loading Linux x86_64-4.0.5-gentoo ...'
                linux   /kernel-genkernel-x86_64-4.0.5-gentoo root=UUID=73c46c5f-b065-43aa-88ba-f6d45a7e2c1a ro 
                echo    'Loading initial ramdisk ...'
                initrd  /initramfs-genkernel-x86_64-4.0.5-gentoo
        }
        menuentry 'Gentoo GNU/Linux, with Linux x86_64-4.0.5-gentoo (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-4.0.5-gentoo-recovery-73c46c5f-b065-43aa-88ba-f6d45a7e2c1a' {
                load_video
                set gfxpayload=1920x1080x32
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd1,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1  abd330e0-437d-414a-8aef-19651233f86f
                else
                  search --no-floppy --fs-uuid --set=root abd330e0-437d-414a-8aef-19651233f86f
                fi
                echo    'Loading Linux x86_64-4.0.5-gentoo ...'
                linux   /kernel-genkernel-x86_64-4.0.5-gentoo root=UUID=73c46c5f-b065-43aa-88ba-f6d45a7e2c1a ro single
                echo    'Loading initial ramdisk ...'
                initrd  /initramfs-genkernel-x86_64-4.0.5-gentoo
        }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# 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.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ##



How can I tell Grub which kernels go with which Linux system.... Right now I'm going to have to be doing it manually.
I expect with mature software like grub2 there should be a way to properly configure this.
Back to top
View user's profile Send private message
skiwarz
Tux's lil' helper
Tux's lil' helper


Joined: 23 Feb 2014
Posts: 128

PostPosted: Mon Aug 17, 2015 8:41 pm    Post subject: Reply with quote

Since no one else had anything to say, I'll try to help. One thing you could do, but not sure how you like it, is to get rid of your /boot partition and put all your kernels on their respective root partitions. It doesn't solve the issue of mkconfig, but you wouldn't ever have to manually edit it anymore.
Back to top
View user's profile Send private message
grumblebear
Tux's lil' helper
Tux's lil' helper


Joined: 26 Feb 2008
Posts: 141

PostPosted: Thu Aug 20, 2015 9:11 pm    Post subject: Reply with quote

You could edit /etc/grub.d/10_linux to not detect /boot/vmlinuz-* as valid kernels. There is a
Code:
list=for i in ...
line where you can simply delete the /boot-vmlinuz-* entry.
Back to top
View user's profile Send private message
awalp
n00b
n00b


Joined: 29 May 2003
Posts: 71

PostPosted: Sun Aug 23, 2015 12:20 pm    Post subject: Reply with quote

skiwarz wrote:
Since no one else had anything to say, I'll try to help. One thing you could do, but not sure how you like it, is to get rid of your /boot partition and put all your kernels on their respective root partitions. It doesn't solve the issue of mkconfig, but you wouldn't ever have to manually edit it anymore.

I really would like to keep the kernel in /boot like it is suppose to be.

grumblebear wrote:
You could edit /etc/grub.d/10_linux to not detect /boot/vmlinuz-* as valid kernels. There is a
Code:
list=for i in ...
line where you can simply delete the /boot-vmlinuz-* entry.


I'll have to look into this.

I'm about to have a 5-way boot (Windows 10, Windows 7, Grub [Gentoo, Arch, openSuSE])
and would like to have it spit out a valid grub.cfg file.

It really is no big deal to edit the file (takes only a min), but it may get confusing with more kernels.
If I can manually specify the kernels in /etc/grub.d/ it would prevent me from making an error.
Back to top
View user's profile Send private message
awalp
n00b
n00b


Joined: 29 May 2003
Posts: 71

PostPosted: Mon Aug 24, 2015 4:15 pm    Post subject: Reply with quote

I found an excellent solution to this problem/situation.

Grub2 supports reading not only ext2/ext3 but ext4, btrfs, xfs, etc,
removing the requirement for a dedicated ext2 /boot partition.

SOLVED answer: chainloading

----

I'm just installing the other linux installations without a separate boot partition.

Then I can just load the module for the filesystem and chainload into each system's menu.

[SOLVED]

Code:

### BEGIN /etc/grub.d/40_custom ###
menuentry "OpenSuSE Chainloader" {
        load_video
        set gfxpayload=1920x1080x32
   insmod gzio
   insmod part_msdos
   insmod ext2
   insmod btrfs
   insmod chain
   chainloader (hd1,8)+1
}
### END /etc/grub.d/40_custom ###



---------------

While this does not answer origianl question of ability to specifiy grub auto configuration, it provided an even better alternative solution enable each Distro's unique grub2 configuartions.[/code]
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum