View previous topic :: View next topic |
Author |
Message |
Atomic Fusion n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 31 Mar 2010 Posts: 18 Location: Alaska, USA
|
Posted: Sun Jun 12, 2011 3:45 am Post subject: [solved] kexec and initramfs |
|
|
I'm trying to boot Gentoo using my own initramfs from kexec.
When I repackage it into an initrd image, and specify root=/dev/ram0 on the kernel command line, it boots. With my initramfs, it merely fails with a kernel panic about not having a root.
I created my initramfs with:
Code: | find . -print0 | cpio --null -ov --format=newc | gzip -9 > /boot/main/initramfs.cpio.gz |
What could I be doing wrong?
Last edited by Atomic Fusion on Mon Jun 13, 2011 4:44 pm; edited 1 time in total |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
[n00b@localhost] Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/19483153504151da3a80ce8.gif)
Joined: 30 Aug 2004 Posts: 266 Location: London, UK
|
Posted: Sun Jun 12, 2011 1:34 pm Post subject: |
|
|
Could you post the output of Code: | gzip -dc /boot/main/initramfs.cpio.gz | cpio -tv |
This will list the contents of your initramfs and make sure that everything needed has actually been included. My guess is that the device node /dev/ram0 isn't included in your initramfs. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Atomic Fusion n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 31 Mar 2010 Posts: 18 Location: Alaska, USA
|
Posted: Sun Jun 12, 2011 7:55 pm Post subject: |
|
|
/dev/ram0 was not included. I created (via copypasta) with
I remade my initramfs and checked, and it was there. When I then used kexec on it, it failed in the same way.
Is there more of a difference between initramfs and initrd than I'm getting? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
cach0rr0 Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/14936637654ee19d6630f96.gif)
Joined: 13 Nov 2008 Posts: 4123 Location: Houston, Republic of Texas
|
Posted: Sun Jun 12, 2011 8:41 pm Post subject: |
|
|
how about mounting a devtmpfs at /dev within your initramfs?
be surprised if that didnt give you every device node you needed _________________ Lost configuring your system?
dump lspci -n here | see Pappy's guide | Link Stash |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Atomic Fusion n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 31 Mar 2010 Posts: 18 Location: Alaska, USA
|
Posted: Sun Jun 12, 2011 8:47 pm Post subject: |
|
|
Wouldn't I need to get into userspace to do that, or do you mean compiling it into the kernel?
I tried an Ubuntu initramfs, and it worked... It used lzma for compression rather than gzip. Might that be an issue? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Atomic Fusion n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 31 Mar 2010 Posts: 18 Location: Alaska, USA
|
Posted: Sun Jun 12, 2011 9:34 pm Post subject: |
|
|
I think... I found the issue...
I copied my initscript from /sbin/init to /init. I also modified them to display which one was being run. Upon remaking my initramfs and booting, it worked, and reported that /init was run.
Does anyone know if this is true, that for initrd, /sbin/init is executed, while for initramfs, /init is executed? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
[n00b@localhost] Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/19483153504151da3a80ce8.gif)
Joined: 30 Aug 2004 Posts: 266 Location: London, UK
|
Posted: Sun Jun 12, 2011 10:57 pm Post subject: |
|
|
I know that, at least for an initramfs, it is /init that is run and not /sbin/init.
Wikipedia says that for an initrd it is /linuxrc that is run. Last time I used an initrd I seem to remember /linuxrc being a symlink to /sbin/init. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|