LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 12-04-2008, 12:09 AM   #1
galapogos
Member
 
Registered: May 2008
Posts: 227

Rep: Reputation: 30
How to change root_dev for 2.6.27.7 kernel?


Hi,

I'm trying to update the kernel in 1 of my drives from 2.6.22.19 to
the latest stable 2.6.27.7 release. It seems that some changes
happened.

First, arch/i386/boot has been replaced by arch/x86/boot. Also the
boot sector file bootsect no longer exists, and the build command's
syntax has changed to reflect this.

I have previously been able to build an uncompressed kernel whose
rootdev is /dev/sda1 with the following script:
Code:
echo "Builds uncompressed Image here with root device as /dev/sda1"
mknod  /dev/sda1 b 8 1
objcopy -O binary -R .note -R .comment -S vmlinux tmppiggy
cd arch/i386/boot
tools/build -b bootsect setup ../../../tmppiggy /dev/sda1 > ../../../Image_sda
cd -
echo "The uncompressed image can only boot from /dev/sda1 and is
called Image_sda"
However, I'm unable to do this even after changing the directory
names, because the file "setup" doesn't exist.

I have tried manually modifying ROOT_DEV in arch/x86/boot/Makefile
from CURRENT to "/dev/sda1" and the when I do a "file bzImage" it
gives the following output:
Code:
bzImage: Linux kernel x86 boot executable RO-rootFS, root_dev 0x801,
swap_dev 0x1, Normal VGA
My old kernel 2.6.22.19, after running the script, has a swap_dev of
0x2 instead.

I'm not sure what else is different, however I'm having trouble
booting up with the new image in some(not all) systems. It boots up
until the following stage then kernel panics:
Code:
FS: Cannot open root device "801" or unknown-block (8,1)
Please append a correct "root=" boot option; here are the available partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,1)
Any ideas how I can get build to change my root_dev/swap_dev? I've
tried using the setup.elf, as well as copying setp from the 2.6.22.19
kernel and running the command without the "bootsect" parameter, but
it gives me the message:
Code:
Boot block hasn't got boot flag (0xAA55)
Thanks.
 
Old 12-04-2008, 08:41 PM   #2
bapigoo9
Member
 
Registered: Aug 2008
Posts: 107

Rep: Reputation: 16
Quote:
I'm not sure what else is different, however I'm having trouble
booting up with the new image in some(not all) systems. It boots up
until the following stage then kernel panics:
Can you explain what you mean that it boots up on some systems, but not on some other systems? How are you booting? What bootloader are you using, and how are you using the kernel on different systems?
 
Old 12-04-2008, 11:51 PM   #3
galapogos
Member
 
Registered: May 2008
Posts: 227

Original Poster
Rep: Reputation: 30
Sorry. I'm using LILO as my boot loader. The Linux kernel is a very stripped down version and all it does it boots up into a busybox shell. I'm using the kernel the same way on different systems. The idea is to have 1 kernel that works for as many systems as possible - i.e. as long as the drive is connected as /dev/sda it should work. I believe the problem with my new kernel is that I'm not changing root_dev/swap_dev properly as I was with the old kernel. So I'm just wondering how I can do that with the "build" command with the new kernel.
 
Old 12-07-2008, 01:26 AM   #4
bapigoo9
Member
 
Registered: Aug 2008
Posts: 107

Rep: Reputation: 16
Quote:
all it does it boots up into a busybox shell
So, it boots up to a busybox shell on several different computers as long as the harddrive is in /dev/sda? It does not boot up into Linux? To make some things easier, what distro are you mostly using with this kernel?

Quote:
I'm using the kernel the same way on different systems. The idea is to have 1 kernel that works for as many systems as possible
That is what the "generic" Linux kernels from major distros are for.

With the newer kernels, you need an initrd to boot up into Linux on the machine. If you update your distro, it usually includes the initrd too.
 
Old 12-07-2008, 02:44 AM   #5
galapogos
Member
 
Registered: May 2008
Posts: 227

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by bapigoo9 View Post
So, it boots up to a busybox shell on several different computers as long as the harddrive is in /dev/sda? It does not boot up into Linux? To make some things easier, what distro are you mostly using with this kernel?
Yes. That's the basic idea/goal. I'm not using any distro at all. It's completely built from the ground up.

Quote:
That is what the "generic" Linux kernels from major distros are for.

With the newer kernels, you need an initrd to boot up into Linux on the machine. If you update your distro, it usually includes the initrd too.
Well, my kernel does not have initrd. It boots up in several PCs, just not some. Can we get back to the original question about the build command? I believe that's the problem.
 
Old 12-16-2008, 01:53 AM   #6
galapogos
Member
 
Registered: May 2008
Posts: 227

Original Poster
Rep: Reputation: 30
Can anyone help?
 
Old 01-11-2009, 06:10 PM   #7
bapigoo9
Member
 
Registered: Aug 2008
Posts: 107

Rep: Reputation: 16
Quote:
Originally Posted by galapogos View Post
Can anyone help?
We can help if you clarify your questions! What exactly are you trying to do? Build the new kernel?
 
Old 01-11-2009, 08:32 PM   #8
galapogos
Member
 
Registered: May 2008
Posts: 227

Original Poster
Rep: Reputation: 30
OK, I'll try my best to clarify.

I have built the kernel already, and gotten the kernel image. However, the kernel image is default build against my Mandriva Linux installation, which is installed in /dev/sda6 or something. However, this is not what I want, because I'm not building the new image to upgrade my Mandriva Linux, but rather to install it on another Linux installation on another device, which boots up from /dev/sda1 instead. However, this other Linux installation is extremely minimal(it's sort of an embedded device) so it doesn't have gcc and all the other necessary tools for kernel compilation, hence my development PC is another Mandriva Linux box.

With previous kernel versions 2.6.22.19 and earlier, I was able to use the "build" command to change the kernel's root_dev to /dev/sda1, and this boots up just fine.

With the newer kernel versions(I've tried 2.6.27.7), the "build" command syntax has changed and I'm haven't figured out how to use it. However, I've still managed to change the root_dev by manually modifying ROOT_DEV in arch/x86/boot/Makefile
from CURRENT to "/dev/sda1", and I've verified that this does, indeed, change the root_dev of the kernel image.

However, despite doing this, I am still getting kernel panics when booting up from some(not all) PCs, with the following panic message:
Code:
FS: Cannot open root device "801" or unknown-block (8,1)
Please append a correct "root=" boot option; here are the available partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,1)
I'm not sure why this is the case because (8,1) is /dev/sda1 as far as I know

I'm using LILO and my lilo.conf has also been set to boot up from /dev/sda1, so I'm not sure what else I'm missing? My old 2.6.22.19 did not have these kernel panics with these PCs.

I hope that's clear enough?

Thanks!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change root_dev for kernel 2.6.27.7? galapogos Linux - Software 3 12-17-2008 03:42 PM
change kernel I'm using JosephS Slackware 7 06-27-2008 11:25 AM
pacman -Su, kernel upgrade, kernel panic, change distro? jkh Arch 35 03-10-2006 01:14 AM
Change from stock 2.4 kernel to 2.6 kernel jrbush82 Slackware 6 02-11-2006 07:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 11:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration