Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[GAVE UP]grub2:grub.cfg gets created without anything useful
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
AgBr
Apprentice
Apprentice


Joined: 06 Nov 2010
Posts: 195

PostPosted: Tue Nov 26, 2013 10:06 pm    Post subject: [GAVE UP]grub2:grub.cfg gets created without anything useful Reply with quote

running grub2-mkconfig -o /boot/grub/grub.cfg I get
Code:


<... some script code removed >


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

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


As far as I understand, in the "10_linux" chapter should be some entries begining with "menuentry ..."
grub2-install doesn't complain but as could be expected I run into the "grub>" prompt on bootup. So obviously there must be something wrong.
I have built grub with: GRUB_PLATFORMS="emu coreboot multiboot efi pc" just to be save that there isn't any feature missing. It's a x86 32Bit machine btw., ordinary Pentium4, no UEFI/GPT

Can someone please put me in the right track here?


Last edited by AgBr on Wed Nov 27, 2013 12:30 pm; edited 1 time in total
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Wed Nov 27, 2013 12:10 am    Post subject: Reply with quote

Code:
GRUB_PLATFORMS="emu coreboot multiboot efi pc"

All those Grub architectures installation can probably cohabitate together, but I only install Grub for the architecture I am using, so for your IBM/PC 32 bits processor I would use
Code:
GRUB_PLATFORMS="pc"

Nothing should be missing and nothing useless will be there too. After reemerge world or grub, grub-install have to be done again.

But I think your real problem is somewhere else. Is some Grub scripts in the /etc/grub.d directory are not executables? This is what grub.cfg show. All those scripts should be executables after emerging Grub. This is the default.

So, have a look to the /etc/grub.d directory and chmod 0755 all the scripts there if they are not. You can only make scripts unexecutables there 'if you know what you are doing'.

Check too the file /etc/default/grub and than
Code:
grub2-mkconfig -o /boot/grub/grub.cfg

_________________
Paul
Back to top
View user's profile Send private message
AgBr
Apprentice
Apprentice


Joined: 06 Nov 2010
Posts: 195

PostPosted: Wed Nov 27, 2013 12:42 pm    Post subject: Reply with quote

As I found out, I can install Grub1 in parallel to Grub2. So I used this as fall back, as I need this box up and running now.
I found out so far, that grub2-install for some reason does not do anything usefull in grub.cfg and in the same time grub2-install does not install anything usefull even if it gets a grub.cfg with some basic configuration:
Code:

#grub.conf
default 0
timeout 5
title=Linux
root (hd0,1)
kernel /boot/vmlinuz root=/dev/sda2
------------------------------
#grub.cfg
default=0
timeout=5

menuentry 'Gentoo Linux'  {
root=hd0,1
linux /boot/vmlinuz root=/dev/sda2 
}

I tried this after recompiling grub2 with GRUB_PLATFORMS="pc"

Thank you for bothering about my problem so far. I will have a look at the problem again, once I have some spare time for this
Back to top
View user's profile Send private message
Fitzcarraldo
Advocate
Advocate


Joined: 30 Aug 2008
Posts: 2034
Location: United Kingdom

PostPosted: Fri Dec 20, 2013 12:45 pm    Post subject: Reply with quote

AgBr, Although my 32-bit Gentoo installation had worked fine with GRUB Legacy, when I upgraded to GRUB 2 by installing grub-2.00_p5107-r2 I had the same problem as you:

Code:
gateway9300 boot # grub2-mkconfig -o /boot/grub/grub.cfg
Generating grub.cfg ...
Found background: /boot/grub/mybackground.png
done
gateway9300 boot #

The /etc/grub.d/10_linux section in /boot/grub/grub.cfg had nothing in it.

(By the way, the grub2-install command had worked correctly and not produced any error messages.)

The kernel image in the /boot directory, which GRUB Legacy had always booted correctly, was simply named 'kernel':
Code:
gateway9300 boot # ls
boot  grub  kernel  lost+found
gateway9300 boot #

So all I needed to do to get the grub2-mkconfig command to recognise the kernel image was to rename it:

Code:
gateway9300 boot # uname -a
Linux gateway9300 3.2.1-gentoo-r2 #13 SMP Sun Apr 21 22:27:20 BST 2013 i686 Pentium III (Coppermine) GenuineIntel GNU/Linux
gateway9300 boot # cp kernel vmlinuz-3.2.1-gentoo-r2
gateway9300 boot # ls
boot  grub  kernel  lost+found  vmlinuz-3.2.1-gentoo-r2
gateway9300 boot # grub2-mkconfig -o /boot/grub/grub.cfg
Generating grub.cfg ...
Found background: /boot/grub/mybackground.png
Found linux image: /boot/vmlinuz-3.2.1-gentoo-r2
done
gateway9300 boot #

By the way, I did also have to modify the file /etc/default/grub before running the grub2-mkconfig command:

Code:
# 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="`cat /proc/cmdline | sed -e 's#BOOT_IMAGE=.* ro ##g'`"

# Append parameters to the linux kernel command line for non-recovery entries             
#GRUB_CMDLINE_LINUX_DEFAULT=""

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

GRUB_VIDEO_BACKEND=vbe
GRUB_GFXPAYLOAD_LINUX=1024x768
GRUB_COLOR_HIGHLIGHT="magenta/black"
GRUB_COLOR_NORMAL="white/black"

# 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=1024x768

# 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

(I had also added GRUB_PLATFORMS="pc" to /etc/make.conf before installing GRUB 2, just to be sure, but I believe GRUB 2 tries to detect the platform automatically if GRUB_PLATFORMS is not declared.)

I hope that helps you.
_________________
Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC udev elogind & KDE on both.

Fitzcarraldo's blog
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