Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Difficulties with putting my new kernel up
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
jimstapleton
n00b
n00b


Joined: 30 Jun 2006
Posts: 28

PostPosted: Fri Aug 18, 2006 12:45 pm    Post subject: Difficulties with putting my new kernel up Reply with quote

I just installed Gentoo, and recompiled my kernel so I could use apps that require kernel source to compile (and I'm on a notebook, so I want some things available).

I modified my grub.conf so it would give me the option of booting my new kernel, but that didn't show up, it still auto-booted to the old kernel (installed from the CD, everthing else I tried failed)

Next, since I had luck with it before on other linuxes, I tried lilo (I just had bad luck with *EVERYTHING* else)
it kept giving me an error about not being able to find device 801

So, I tried fiddling with grub some more, and I set it up to something that looks right, and tried reinstalling it, I booted to the live CD, mounted the root partition, changed to there, and chrooted:
livecd grub # mkdir /mnt/local
livecd grub # mount /dev/sda1 /mnt/local
livecd grub # mount /dev/sda3 /mnt/local/usr
livecd grub # cd /mnt/local
livecd grub # chroot .
livecd grub # grub-install /dev/sda
Could not find device for /boot: Not found or not a block device.
livecd grub # grub-install hd0
Could not find device for /boot: Not found or not a block device.
livecd grub # grub-install (hd0)
bash: syntax error near unexpected token `hd0'

livecd grub # grub --config-file=/boot/grub/grub.conf
grub> setup (hd0)

Error 12: Invalid device requested

grub> setup hd0

Error 11: Unrecognized device string

grub> setup (sda)

Error 23: Error while parsing number

grub> setup (/dev/sda)

Error 23: Error while parsing number

grub> setup /dev/sda

Error 11: Unrecognized device string




: Kernel Version: 2.6.17-gentoo-r4
: Kernel name/path: /boot/custom-kern-2006-08-17
: /boot is in the root partition (I know, a lot of people don't recommend it, but it's easier for me). "/" is /dev/sda1, which grub sees as (hd0)

: /boot contents:
lrwxrwxrwx 1 root root 27 Aug 17 19:08 System.map -> System.map-2.6.17-gentoo-r4
-rw-r--r-- 1 root root 723499 Aug 17 19:08 System.map-2.6.17-gentoo-r4
lrwxrwxrwx 1 root root 1 Aug 15 15:28 boot -> .
-rw-r--r-- 1 root root 512 Aug 17 20:22 boot.0800
-rw-r--r-- 1 root root 512 Aug 18 03:34 boot.0801
lrwxrwxrwx 1 root root 23 Aug 17 19:08 config -> config-2.6.17-gentoo-r4
-rw-r--r-- 1 root root 39464 Aug 17 19:08 config-2.6.17-gentoo-r4
-rw-r--r-- 1 root root 1491439 Aug 17 19:43 custom-kern-2006-08-17
drwxr-xr-x 2 root root 4096 Aug 18 04:25 grub
-rw-r--r-- 1 root root 4035800 Feb 22 12:46 initramfs-genkernel-x86-2.6.15-gentoo-r5
-rw-r--r-- 1 root root 1683424 Feb 22 12:43 kernel-genkernel-x86-2.6.15-gentoo-r5
lrwxrwxrwx 1 root root 24 Aug 17 19:08 vmlinuz -> vmlinuz-2.6.17-gentoo-r4
-rw-r--r-- 1 root root 1491439 Aug 17 19:08 vmlinuz-2.6.17-gentoo-r4

: /boot/grub contents:
-rw-r--r-- 1 root root 30 Aug 18 04:09 device.map
-rw-r--r-- 1 root root 7956 Aug 18 04:18 e2fs_stage1_5
-rw-r--r-- 1 root root 7684 Aug 18 04:18 fat_stage1_5
-rw-r--r-- 1 root root 6996 Aug 18 04:18 ffs_stage1_5
-rw-r--r-- 1 root root 15 Aug 15 15:54 glidevice.map
-rw-r--r-- 1 root root 354 Aug 18 04:25 grub.conf
-rw-r--r-- 1 root root 1624 Aug 18 04:18 grub.conf.sample
-rw-r--r-- 1 root root 330 Aug 18 04:23 grub.conf~
-rw-r--r-- 1 root root 7028 Aug 18 04:18 iso9660_stage1_5
-rw-r--r-- 1 root root 8448 Aug 18 04:18 jfs_stage1_5
lrwxrwxrwx 1 root root 9 Aug 15 15:54 menu.lst -> grub.conf
-rw-r--r-- 1 root root 7188 Aug 18 04:18 minix_stage1_5
-rw-r--r-- 1 root root 9396 Aug 18 04:18 reiserfs_stage1_5
-rw-r--r-- 1 root root 33856 Aug 18 04:18 splash.xpm.gz
-rw-r--r-- 1 root root 512 Aug 18 04:18 stage1
-rw-r--r-- 1 root root 104008 Aug 18 04:18 stage2
-rw-r--r-- 1 root root 104008 Aug 15 15:54 stage2.old
-rw-r--r-- 1 root root 104008 Aug 18 04:18 stage2_eltorito
-rw-r--r-- 1 root root 7272 Aug 18 04:18 ufs2_stage1_5
-rw-r--r-- 1 root root 6612 Aug 18 04:18 vstafs_stage1_5
-rw-r--r-- 1 root root 9308 Aug 18 04:18 xfs_stage1_5

: grub.conf:
default 0
timeout 30
splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title=Custom Kernel
root (hd0,0)
kernel (hd0,0)/boot/custom-kern-2006-08-17K

title=Original Kernel
root (hd0,0)
kernel (hd0,0)/boot/kernel-genkernel-x86-2.6.15-gentoo-r5 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/sda1
initrd /boot/initramfs-genkernel-x86-2.6.15-gentoo-r5



Any suggestions? I'm in need of help here pretty badly.
Thanks,
-Jim
Back to top
View user's profile Send private message
sageman
Guru
Guru


Joined: 04 May 2005
Posts: 363
Location: New Hampshire

PostPosted: Fri Aug 18, 2006 2:01 pm    Post subject: Re: Difficulties with putting my new kernel up Reply with quote

jimstapleton wrote:

: grub.conf:
default 0
timeout 30
splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title=Custom Kernel
root (hd0,0)
kernel (hd0,0)/boot/custom-kern-2006-08-17K

title=Original Kernel
root (hd0,0)
kernel (hd0,0)/boot/kernel-genkernel-x86-2.6.15-gentoo-r5 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/sda1
initrd /boot/initramfs-genkernel-x86-2.6.15-gentoo-r5


You don't have a System.map that corresponds to "custom-kern-2006-08-17K" in /boot. Did you just compile 2.6.17-r4, from the gentoo-sources? That's the "vmlinuz-2.6.17-gentoo-r4" in /boot, with corresponding "System.map-2.6.17-gentoo-r4" (those are automatically put in /boot, if mounted, when you do "make install", so you don't need to copy anything there). Kernels should be named "vmlinuz-foo" with a "System.map-foo" corresponding to it.

Try this for grub.conf:
Code:

...
title=Custom Kernel
    root (hd0,0)
    kernel (hd0,0)/boot/vmlinuz-2.6.17-gentoo-r4 root=/dev/sda1
...


(with every thing not mentioned left unchanged). Any luck?
_________________
Carlton Stedman
Gentoo Metalheads on Last.fm: http://www.last.fm/group/Gentoo+Metalheads
Back to top
View user's profile Send private message
jimstapleton
n00b
n00b


Joined: 30 Jun 2006
Posts: 28

PostPosted: Fri Aug 18, 2006 2:20 pm    Post subject: Reply with quote

so it should look like this:

Code:

default 0
timeout 30
splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title=Custom Kernel
root (hd0,0)
kernel (hd0,0)/boot/vmlinuz-2.6.17-gentoo-r4

title=Original Kernel
root (hd0,0)
kernel (hd0,0)/boot/kernel-genkernel-x86-2.6.15-gentoo-r5 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/sda1
initrd /boot/initramfs-genkernel-x86-2.6.15-gentoo-r5



or am I still doing something wrong? I suspect the latter:

Code:

livecd boot # grub-install /dev/sda
Could not find device for /boot: Not found or not a block device.
livecd boot # grub-install hd0
Could not find device for /boot: Not found or not a block device.


Thanks,
-Jim
Back to top
View user's profile Send private message
sageman
Guru
Guru


Joined: 04 May 2005
Posts: 363
Location: New Hampshire

PostPosted: Fri Aug 18, 2006 2:27 pm    Post subject: Reply with quote

You don't need to do grub-install after changing grub.conf, you know. Plus, it should be "grub-install /dev/sda1", I believe, since sda isn't a parition -- sda1 is.

Code is close, but you want to add a "root=/dev/sda1" onto the kernel line for your custom kernel, so it knows where the root directory is (that isn't the same as "root (hd0,0)").
_________________
Carlton Stedman
Gentoo Metalheads on Last.fm: http://www.last.fm/group/Gentoo+Metalheads
Back to top
View user's profile Send private message
cyrillic
Watchman
Watchman


Joined: 19 Feb 2003
Posts: 7313
Location: Groton, Massachusetts USA

PostPosted: Fri Aug 18, 2006 4:57 pm    Post subject: Re: Difficulties with putting my new kernel up Reply with quote

jimstapleton wrote:
: /boot is in the root partition (I know, a lot of people don't recommend it, but it's easier for me). "/" is /dev/sda1, which grub sees as (hd0)

It is fine to not have a separate /boot partition, just make sure you delete the /boot line from your /etc/fstab so that you don't have it referring to a partition that does not exist.
Back to top
View user's profile Send private message
jimstapleton
n00b
n00b


Joined: 30 Jun 2006
Posts: 28

PostPosted: Sat Aug 19, 2006 10:44 am    Post subject: Reply with quote

Actually, I did need to reinstall grub because I had installed lilo.

I gave up on grub-install or the method of going through grub, and did the manul method of catting the grub loader that lilo backed up into /dev/sda (btw, booting from the MBR and not the first partition)

Anyway. I found out a lot of my problems stemmed from having a 1.5MB kernel. I tried to make a ramdisk image and use that, but it kept giving me a "VFS: cannot read device (100)" error, and then panic during boot. After having tried for several hours with no luck, I figured I really screwed something up (although I could boot from the original kernel again, got it to work in both lilo and grub, whichever I decided to use). But, since nothing I could do would get the new kernel running, I just went back and did a clean install, since that was recommended, and this time I have a /boot partition, 64MB.
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