Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] kexec and initramfs
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Atomic Fusion
n00b
n00b


Joined: 31 Mar 2010
Posts: 18
Location: Alaska, USA

PostPosted: Sun Jun 12, 2011 3:45 am    Post subject: [solved] kexec and initramfs Reply with quote

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
View user's profile Send private message
[n00b@localhost]
Apprentice
Apprentice


Joined: 30 Aug 2004
Posts: 266
Location: London, UK

PostPosted: Sun Jun 12, 2011 1:34 pm    Post subject: Reply with quote

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
View user's profile Send private message
Atomic Fusion
n00b
n00b


Joined: 31 Mar 2010
Posts: 18
Location: Alaska, USA

PostPosted: Sun Jun 12, 2011 7:55 pm    Post subject: Reply with quote

/dev/ram0 was not included. I created (via copypasta) with
Code:
mknod ram0 b 1 0

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
View user's profile Send private message
cach0rr0
Bodhisattva
Bodhisattva


Joined: 13 Nov 2008
Posts: 4123
Location: Houston, Republic of Texas

PostPosted: Sun Jun 12, 2011 8:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
Atomic Fusion
n00b
n00b


Joined: 31 Mar 2010
Posts: 18
Location: Alaska, USA

PostPosted: Sun Jun 12, 2011 8:47 pm    Post subject: Reply with quote

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
View user's profile Send private message
Atomic Fusion
n00b
n00b


Joined: 31 Mar 2010
Posts: 18
Location: Alaska, USA

PostPosted: Sun Jun 12, 2011 9:34 pm    Post subject: Reply with quote

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
View user's profile Send private message
[n00b@localhost]
Apprentice
Apprentice


Joined: 30 Aug 2004
Posts: 266
Location: London, UK

PostPosted: Sun Jun 12, 2011 10:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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