Re: SOLVED Why initramfs stops although root device is mountable and ready to use

2009-07-09 Thread Gilad Ben-Yossef

Lev Olshvang wrote:




BTW,  is there any way to track next line from /proc/devices
8 sd

   which modules  actually made possible access to  devices  8,0  ???


The information is available via sysfs some where ...

Gilad
 



--
Gilad Ben-Yossef
Chief Coffee Drinker  CTO
Codefidence Ltd.

Web: http://codefidence.com
Cell: +972-52-8260388
Tel: +972-8-9316883 ext. 201
Fax: +972-8-9316884
Email: gi...@codefidence.com

Check out our Open Source technology and training blog - http://tuxology.net

Now the world has gone to bed
 Darkness won't engulf my head
 I can see by infra-red
 How I hate the night.

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: SOLVED Why initramfs stops although root device is mountable and ready to use

2009-07-08 Thread Lev Olshvang

Shachar Shemesh wrote:

Ilya A. Volynets-Evenbakh wrote:


I think it's the other way around - if you exit from your linuxrc when
running from initramfs,
it'll continue on with standard boot sequence, while ending linuxrc in
initrd will panic the kernel
with Trying to kill PID 1 error.

  
An initramfs exists for any 2.6 kernel. Sometimes it's just a very 
small one. The way the kernel decides whether to execute it is to 
check for a */init* file in it. If it finds one, it runs it. If not, 
it does not.


As such, if you have a /linuxrc file in your initramfs, and it simply 
exists at the end, all that will happen is that the kernel will not 
find a /init and will skip running anything from the initramfs at all. 
In that sense you might be said to be right that if your linuxrc 
exists, the normal boot sequence will continue.


The history goes something like this:
Originally, the drivers for the root file system had to be compiled 
into the kernel. This was very difficult, if not impossible, for 
distribution kernels, as the list of potential drivers included, well, 
everything, and the kernels were just too big. Then the idea of initrd 
came - we compile the drivers only for the ram disk and the initrd 
file system (typically, cramfs) into the kernel. The initrd loads the 
relevant drivers into the kernel and quits, restoring the original 
boot sequence. Then someone pointed out that, sometimes, an initrd is 
all you need. The convention then arose to pass boot=/dev/ram0 to 
the kernel, which tells it that the initrd stage is the last one. It 
then became common to put the real boot= option on the kernel 
command line, but then, from initrd, to load the values for 
/dev/ram0 into the proc entry for the boot device from linuxrc, 
manually mount the real root file system, make it the root file system 
using pivot_root, and exec init from there.


Then, for 2.6, people figured that if this is what you normally do 
anyways, there is no point in carrying around the drivers for the ram 
disk and cramfs (compiled into the kernel, which means it cannot be 
unloaded). Instead, use the much lighter tmpfs file system, and use a 
cpio archive for the actual files. The tmpfs file system was made 
mandatory, whether initramfs was used or not, and so you couldn't move 
it from the root (only mount on top of it). This means you cannot use 
pivot_root, and switch_root was invented. While at it, the legacy 
boot sequence was removed. Assuming, as Gilad seems to, that we leave 
initrd is out of the discussion, your options are either run an 
initramfs and perform the entire root mounting from the /init script 
there, or compile the root file system drivers into the kernel and let 
the kernel mount them using the boot= kernel option.


Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
http://www.lingnu.com
  



___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il

  

Many thanks to all of you,

Due to some glitch, initramfs image does not have /init script.
This is the reason boot stopped. (and the required device driver was 
compiled in kernel, so the device was created)




Thanks you Again
Lev.

BTW,  is there any way to track next line from /proc/devices
8 sd

  which modules  actually made possible access to  devices  8,0  ???



___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: SOLVED Why initramfs stops although root device is mountable and ready to use

2009-07-08 Thread Ilya A. Volynets-Evenbakh
Lev Olshvang wrote:

 BTW,  is there any way to track next line from /proc/devices
 8 sd

which modules  actually made possible access to  devices  8,0  ???
Dig through /sys filesystem.

-- 
Ilya A. Volynets-Evenbakh
http://www.total-knowledge.com


___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Why initramfs stops although root device is mountable and ready to use

2009-07-07 Thread Lev Olshvang

Boker  Everybody,


I recently experienced a strange problem:

The system is based on Ubuntu kernel 2.6.28  which I compiled and built
initramfs for it provided with a driver for ide disk (pata_via.ko)

grub should boot this system from the root=/dev/sda1

The boot process stops on a famous message waiting for a root file system.

But then it enters the busybox prompt  and I see that /dev/sda1 is
indeed exist, I can mount it  and access files.


I do not  understand this  : root device is ready, but  boot process  is
stuck ??

Thanks,
Lev

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Why initramfs stops although root device is mountable and ready to use

2009-07-07 Thread Gilad Ben-Yossef

Lev Olshvang wrote:


Boker  Everybody,


I recently experienced a strange problem:

The system is based on Ubuntu kernel 2.6.28  which I compiled and built
initramfs for it provided with a driver for ide disk (pata_via.ko)

grub should boot this system from the root=/dev/sda1

The boot process stops on a famous message waiting for a root file 
system.


But then it enters the busybox prompt  and I see that /dev/sda1 is
indeed exist, I can mount it  and access files.


I do not  understand this  : root device is ready, but  boot process  is
stuck ??


Simple:

You either use an initramfs, and if so your initramfs should mount the 
real root file system itself using switch_root() or you don't use an 
initramfs and let the kernel mount it (but then you need the driver 
compiled into the kernel).


Gilad

--
Gilad Ben-Yossef
Chief Coffee Drinker  CTO
Codefidence Ltd.

Web: http://codefidence.com
Cell: +972-52-8260388
Tel: +972-8-9316883 ext. 201
Fax: +972-8-9316884
Email: gi...@codefidence.com

Check out our Open Source technology and training blog - http://tuxology.net

Now the world has gone to bed
 Darkness won't engulf my head
 I can see by infra-red
 How I hate the night.

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Why initramfs stops although root device is mountable and ready to use

2009-07-07 Thread Shachar Shemesh

Gilad Ben-Yossef wrote:


I do not  understand this  : root device is ready, but  boot process  is
stuck ??


Simple:

You either use an initramfs, and if so your initramfs should mount the 
real root file system itself using switch_root() or you don't use an 
initramfs and let the kernel mount it (but then you need the driver 
compiled into the kernel).


Gilad
As a nitpicking, if you are using initrd, there is a mode of operation 
where the initrd (linuxrc script) loads the kernel module, but the 
kernel does the actual mounting. I'm not sure it's still available in 
modern kernels. Initrd can also work similarly to initramfs (typically 
using pivot_root, though, and not switch_root).


More to the point, however, I believe Lev is using an initramfs 
generated by his distribution, which begs the question why didn't the 
init script on it mount the file system and run switch_root?


Lev, from the prompt you get, can you do cat /init and paste here what 
appears there?


Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
http://www.lingnu.com

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Why initramfs stops although root device is mountable and ready to use

2009-07-07 Thread Gilad Ben-Yossef

Shachar Shemesh wrote:


Gilad Ben-Yossef wrote:


I do not  understand this  : root device is ready, but  boot 
process  is

stuck ??


Simple:

You either use an initramfs, and if so your initramfs should mount 
the real root file system itself using switch_root() or you don't use 
an initramfs and let the kernel mount it (but then you need the 
driver compiled into the kernel).


Gilad
As a nitpicking, if you are using initrd, there is a mode of operation 
where the initrd (linuxrc script) loads the kernel module, but the 
kernel does the actual mounting. I


Yes, but initramfs does not support it AFAIK and I wouldn't recommend 
anyone to use initrd in favour of initramfs for any system with 2.6 kernel.


Gilad


--
Gilad Ben-Yossef
Chief Coffee Drinker  CTO
Codefidence Ltd.

Web: http://codefidence.com
Cell: +972-52-8260388
Tel: +972-8-9316883 ext. 201
Fax: +972-8-9316884
Email: gi...@codefidence.com

Check out our Open Source technology and training blog - http://tuxology.net

Now the world has gone to bed
 Darkness won't engulf my head
 I can see by infra-red
 How I hate the night.

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Why initramfs stops although root device is mountable and ready to use

2009-07-07 Thread Ilya A. Volynets-Evenbakh
Gilad Ben-Yossef wrote:

 Shachar Shemesh wrote:

 Gilad Ben-Yossef wrote:

 I do not  understand this  : root device is ready, but  boot
 process  is
 stuck ??

 Simple:

 You either use an initramfs, and if so your initramfs should mount
 the real root file system itself using switch_root() or you don't
 use an initramfs and let the kernel mount it (but then you need the
 driver compiled into the kernel).

 Gilad
 As a nitpicking, if you are using initrd, there is a mode of
 operation where the initrd (linuxrc script) loads the kernel module,
 but the kernel does the actual mounting. I

 Yes, but initramfs does not support it AFAIK and I wouldn't recommend
 anyone to use initrd in favour of initramfs for any system with 2.6
 kernel.
I think it's the other way around - if you exit from your linuxrc when
running from initramfs,
it'll continue on with standard boot sequence, while ending linuxrc in
initrd will panic the kernel
with Trying to kill PID 1 error.

-- 
Ilya A. Volynets-Evenbakh
http://www.total-knowledge.com


___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: Why initramfs stops although root device is mountable and ready to use

2009-07-07 Thread Shachar Shemesh

Ilya A. Volynets-Evenbakh wrote:


I think it's the other way around - if you exit from your linuxrc when
running from initramfs,
it'll continue on with standard boot sequence, while ending linuxrc in
initrd will panic the kernel
with Trying to kill PID 1 error.

  
An initramfs exists for any 2.6 kernel. Sometimes it's just a very small 
one. The way the kernel decides whether to execute it is to check for a 
*/init* file in it. If it finds one, it runs it. If not, it does not.


As such, if you have a /linuxrc file in your initramfs, and it simply 
exists at the end, all that will happen is that the kernel will not find 
a /init and will skip running anything from the initramfs at all. In 
that sense you might be said to be right that if your linuxrc exists, 
the normal boot sequence will continue.


The history goes something like this:
Originally, the drivers for the root file system had to be compiled into 
the kernel. This was very difficult, if not impossible, for distribution 
kernels, as the list of potential drivers included, well, everything, 
and the kernels were just too big. Then the idea of initrd came - we 
compile the drivers only for the ram disk and the initrd file system 
(typically, cramfs) into the kernel. The initrd loads the relevant 
drivers into the kernel and quits, restoring the original boot sequence. 
Then someone pointed out that, sometimes, an initrd is all you need. The 
convention then arose to pass boot=/dev/ram0 to the kernel, which 
tells it that the initrd stage is the last one. It then became common to 
put the real boot= option on the kernel command line, but then, from 
initrd, to load the values for /dev/ram0 into the proc entry for the 
boot device from linuxrc, manually mount the real root file system, make 
it the root file system using pivot_root, and exec init from there.


Then, for 2.6, people figured that if this is what you normally do 
anyways, there is no point in carrying around the drivers for the ram 
disk and cramfs (compiled into the kernel, which means it cannot be 
unloaded). Instead, use the much lighter tmpfs file system, and use a 
cpio archive for the actual files. The tmpfs file system was made 
mandatory, whether initramfs was used or not, and so you couldn't move 
it from the root (only mount on top of it). This means you cannot use 
pivot_root, and switch_root was invented. While at it, the legacy boot 
sequence was removed. Assuming, as Gilad seems to, that we leave initrd 
is out of the discussion, your options are either run an initramfs and 
perform the entire root mounting from the /init script there, or compile 
the root file system drivers into the kernel and let the kernel mount 
them using the boot= kernel option.


Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
http://www.lingnu.com

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il