Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
genkernel - create initramfs from a crossdev environment
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
Mardok45
n00b
n00b


Joined: 21 Jun 2008
Posts: 69
Location: Right behind you

PostPosted: Fri Sep 14, 2018 10:23 pm    Post subject: genkernel - create initramfs from a crossdev environment Reply with quote

Is there a way to create an initramfs from a crossdev root? I have /usr/armv6j-hardfloat-linux-gnueabi/ that was created from crossdev and want to create an initramfs from it with genkernel. My goal is to have my RPI mount my crossdev environment as the root via NFS.
_________________
Bones McCracker wrote:
Somebody needs to sig that.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54317
Location: 56N 3W

PostPosted: Fri Sep 14, 2018 11:01 pm    Post subject: Reply with quote

Mardok45,

You don't need an initrd to mount an NFS root on a Raspberry Pi.
The kernel can do that with the right kernel command line.
You may need to change the kernel configuration so that it has the right support built in.

Build the Pi kernel by cross compiling. The kernel is one of the easier packages to cross compile.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54317
Location: 56N 3W

PostPosted: Fri Sep 14, 2018 11:01 pm    Post subject: Reply with quote

Moved from Other Things Gentoo to Gentoo on ARM.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Mardok45
n00b
n00b


Joined: 21 Jun 2008
Posts: 69
Location: Right behind you

PostPosted: Sat Sep 15, 2018 4:32 pm    Post subject: Reply with quote

I wanted to use its wifi connection instead of its ethernet, which will require pulling in some modules and firmware (as well as writing some custom scripts). I would like to use a tool to automate this. Is there anything else out there?
_________________
Bones McCracker wrote:
Somebody needs to sig that.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54317
Location: 56N 3W

PostPosted: Sat Sep 15, 2018 4:57 pm    Post subject: Reply with quote

Mardok45,

There is a script provided by the kernel.
You feed it with a list of files to include in the initrd and an init script and it builds your initrd.
The hard bit is the init script.

You can build all the required kernel code and firmware into your kernel binary. This is a good thing.
Your initrd then becomes kernel agnostic as it only contains user space tools. That means there is no need to update it with every kernel.

The script is /usr/src/linux/usr/gen_init_cpio. I've never tried it in a cross environment.

The hard bit of doing root over NFS is not to restart the network connection when the system boots, or at least, if you do, you need to be sure to keep the same IP.

Root over NFS over WiFi will be horribly slow. WiFi is only half duplex.

If you haven't done root over NFS before, make it work with wired first, or do you have to go straight to WiFi?

-- edit --

There is another way. It is possible to chroot into your /usr/armv6j-hardfloat-linux-gnueabi/ root filesystem from the build host, with the aid of QEMU.
Then your build host runs your armv6j code.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM 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