Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED]: Network names
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
ONEEYEMAN
Advocate
Advocate


Joined: 01 Mar 2005
Posts: 3612

PostPosted: Fri Aug 08, 2014 7:19 am    Post subject: [SOLVED]: Network names Reply with quote

Hi, ALL,
I successfully installed Gentoo on my newly acquired laptop alone with GRUB2. By default it does use new naming convention for the network interface names, which I wanted to override.

And so I did edit the GRUB2 configuration file:

Code:

IgorDellGentoo boot # cat /etc/default/grub 
# Copyright 1999-2013 Gentoo Foundation                                                                                                                                                         
# Distributed under the terms of the GNU General Public License v2                                                                                                                             
# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/files/grub.default-2,v 1.4 2013/09/21 18:10:55 floppym Exp $                                                                                   
#                                                                                                                                                                                               
# To populate all changes in this file you need to regenerate your                                                                                                                             
# grub configuration file afterwards:                                                                                                                                                           
#     'grub2-mkconfig -o /boot/grub/grub.cfg'                                                                                                                                                   
#                                                                                                                                                                                               
# See the grub info page for documentation on possible variables and                                                                                                                           
# their associated values.                                                                                                                                                                     
                                                                                                                                                                                               
GRUB_DISTRIBUTOR="Gentoo"                                                                                                                                                                       
                                                                                                                                                                                               
GRUB_DEFAULT=0                                                                                                                                                                                 
GRUB_HIDDEN_TIMEOUT=0                                                                                                                                                                           
GRUB_HIDDEN_TIMEOUT_QUIET=true                                                                                                                                                                 
GRUB_TIMEOUT=10                                                                                                                                                                                 
                                                                                                                                                                                               
# Append parameters to the linux kernel command line                                                                                                                                           
GRUB_CMDLINE_LINUX="net.ifnames=0"                                                                                                                                                             
                                                                                                                                                                                               
# Append parameters to the linux kernel command line for non-recovery entries                                                                                                                   
GRUB_CMDLINE_LINUX_DEFAULT="net.ifnames=0"                                                                                                                                                     
                                                                                                                                                                                               
# Uncomment to disable graphical terminal (grub-pc only)                                                                                                                                       
#GRUB_TERMINAL=console                                                                                                                                                                         
                                                                                                                                                                                               
# The resolution used on graphical terminal.                                                                                                                                                   
# Note that you can use only modes which your graphic card supports via VBE.                                                                                                                   
# You can see them in real GRUB with the command `vbeinfo'.                                                                                                                                     
#GRUB_GFXMODE=640x480                                                                                                                                                                           
                                                                                                                                                                                               
# Path to theme spec txt file.                                                                                                                                                                 
# The starfield is by default provided with use truetype.                                                                                                                                       
# NOTE: when enabling custom theme, ensure you have required font/etc.
#GRUB_THEME="/boot/grub/themes/starfield/theme.txt"

# Background image used on graphical terminal.
# Can be in various bitmap formats.
#GRUB_BACKGROUND="/boot/grub/mybackground.png"

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to kernel
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY=true


However, trying to create the new onfiguration file failed:

Code:

IgorDellGentoo boot # grub2-mkconfig -o /boot/grub/grub.cfg
/usr/sbin/grub2-mkconfig: line 223: /boot/grub/grub.cfg.new: No such file or directory


Now, I am stuck with old naming conventions which I don't like and don't want. I just get used to the old ones.

I also ran just this:

Code:

IgorDellGentoo boot # grub2-mkconfig
Generating grub.cfg ...
#
# 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_gpt
insmod ext2
set root='hd0,gpt4'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt4 --hint-efi=hd0,gpt4 --hint-baremetal=ahci0,gpt4  6e038879-4460-4056-a7c1-f3d6c22d16d4
else
  search --no-floppy --fs-uuid --set=root 6e038879-4460-4056-a7c1-f3d6c22d16d4
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=
  insmod gettext
fi
terminal_output gfxterm
if sleep --interruptible 0 ; then
  set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
Found linux image: /boot/vmlinuz-3.12.20-gentoo
menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-6e038879-4460-4056-a7c1-f3d6c22d16d4' {
        load_video
        insmod gzio
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt4'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt4 --hint-efi=hd0,gpt4 --hint-baremetal=ahci0,gpt4  6e038879-4460-4056-a7c1-f3d6c22d16d4
        else
          search --no-floppy --fs-uuid --set=root 6e038879-4460-4056-a7c1-f3d6c22d16d4
        fi
        echo    'Loading Linux 3.12.20-gentoo ...'
        linux   /boot/vmlinuz-3.12.20-gentoo root=/dev/sda4 ro net.ifnames=0 net.ifnames=0
}
submenu 'Advanced options for Gentoo GNU/Linux' $menuentry_id_option 'gnulinux-advanced-6e038879-4460-4056-a7c1-f3d6c22d16d4' {
        menuentry 'Gentoo GNU/Linux, with Linux 3.12.20-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.12.20-gentoo-advanced-6e038879-4460-4056-a7c1-f3d6c22d16d4' {
                load_video
                insmod gzio
                insmod part_gpt
                insmod ext2
                set root='hd0,gpt4'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt4 --hint-efi=hd0,gpt4 --hint-baremetal=ahci0,gpt4  6e038879-4460-4056-a7c1-f3d6c22d16d4
                else
                  search --no-floppy --fs-uuid --set=root 6e038879-4460-4056-a7c1-f3d6c22d16d4
                fi
                echo    'Loading Linux 3.12.20-gentoo ...'
                linux   /boot/vmlinuz-3.12.20-gentoo root=/dev/sda4 ro net.ifnames=0 net.ifnames=0
        }
        menuentry 'Gentoo GNU/Linux, with Linux 3.12.20-gentoo (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.12.20-gentoo-recovery-6e038879-4460-4056-a7c1-f3d6c22d16d4' {
                load_video
                insmod gzio
                insmod part_gpt
                insmod ext2
                set root='hd0,gpt4'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt4 --hint-efi=hd0,gpt4 --hint-baremetal=ahci0,gpt4  6e038879-4460-4056-a7c1-f3d6c22d16d4
                else
                  search --no-floppy --fs-uuid --set=root 6e038879-4460-4056-a7c1-f3d6c22d16d4
                fi
                echo    'Loading Linux 3.12.20-gentoo ...'
                linux   /boot/vmlinuz-3.12.20-gentoo root=/dev/sda4 ro single net.ifnames=0
        }
Found linux image: /boot/vmlinuz-3.12.20-gentoo.old
        menuentry 'Gentoo GNU/Linux, with Linux 3.12.20-gentoo.old' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.12.20-gentoo.old-advanced-6e038879-4460-4056-a7c1-f3d6c22d16d4' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                set root='hd0,gpt4'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt4 --hint-efi=hd0,gpt4 --hint-baremetal=ahci0,gpt4  6e038879-4460-4056-a7c1-f3d6c22d16d4
                else
                  search --no-floppy --fs-uuid --set=root 6e038879-4460-4056-a7c1-f3d6c22d16d4
                fi
                echo    'Loading Linux 3.12.20-gentoo.old ...'
                linux   /boot/vmlinuz-3.12.20-gentoo.old root=/dev/sda4 ro net.ifnames=0 net.ifnames=0
        }
        menuentry 'Gentoo GNU/Linux, with Linux 3.12.20-gentoo.old (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.12.20-gentoo.old-recovery-6e038879-4460-4056-a7c1-f3d6c22d16d4' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_gpt
                insmod ext2
                set root='hd0,gpt4'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt4 --hint-efi=hd0,gpt4 --hint-baremetal=ahci0,gpt4  6e038879-4460-4056-a7c1-f3d6c22d16d4
                else
                  search --no-floppy --fs-uuid --set=root 6e038879-4460-4056-a7c1-f3d6c22d16d4
                fi
                echo    'Loading Linux 3.12.20-gentoo.old ...'
                linux   /boot/vmlinuz-3.12.20-gentoo.old root=/dev/sda4 ro single net.ifnames=0
        }
}

### 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 ###
done


What am I missing? How do I regenerate the GRUB2 configuration files? Or maybe they already regenerated?

Thank you.


Last edited by ONEEYEMAN on Fri Aug 08, 2014 9:53 am; edited 1 time in total
Back to top
View user's profile Send private message
ulenrich
Veteran
Veteran


Joined: 10 Oct 2010
Posts: 1480

PostPosted: Fri Aug 08, 2014 7:32 am    Post subject: Reply with quote

grub2-mkconfig -o /boot/grub/grub.cfg
Your parameter set to =0 should work there.
Back to top
View user's profile Send private message
ONEEYEMAN
Advocate
Advocate


Joined: 01 Mar 2005
Posts: 3612

PostPosted: Fri Aug 08, 2014 8:16 am    Post subject: Reply with quote

Hi,
Not sure I understand.
Are you saying that my grub configuration is already regenerated?

Thank you.
Back to top
View user's profile Send private message
wraeth
Developer
Developer


Joined: 08 May 2007
Posts: 72
Location: Australia

PostPosted: Fri Aug 08, 2014 9:02 am    Post subject: Reply with quote

When you run `grub2-mkconfig` by itself with no options, it's generating the config but only printing it to screen. The config it's generating will have the new "predictable device naming" disabled and fall back to interface names like eth0 as can be seen by the line
Code:
linux   /boot/vmlinuz-3.12.20-gentoo root=/dev/sda4 ro net.ifnames=0 net.ifnames=0

As for for the error it reported when you tried specifying the grub.cfg file, was your /boot partition mounted at the time that you ran it? It may have tried creating the configuration file in /boot/grub, but if /boot wasn't mounted, the grub folder may not have been there.
Back to top
View user's profile Send private message
ulenrich
Veteran
Veteran


Joined: 10 Oct 2010
Posts: 1480

PostPosted: Fri Aug 08, 2014 9:41 am    Post subject: Reply with quote

ONEEYEMAN wrote:
Not sure I understand.

man grub2-mkconfig
would have answered your question - but thanks @wraeth!
Back to top
View user's profile Send private message
ONEEYEMAN
Advocate
Advocate


Joined: 01 Mar 2005
Posts: 3612

PostPosted: Fri Aug 08, 2014 9:53 am    Post subject: Reply with quote

Thank you, guys.
/boot was not mounted and after mounting everything worked.
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