Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Raspberry Pi installation
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
tenspd137
Guru
Guru


Joined: 22 Aug 2006
Posts: 375

PostPosted: Mon Jan 28, 2013 11:59 pm    Post subject: Raspberry Pi installation Reply with quote

Hi all,

Not sure if this goes here or in "Other things Gentoo", so please feel free to move it. Anyway, I received my Pi a while ago and have just gotten around to trying to use it. What I wanted to do, since I heard compiling on the RPi was really slow, was create an image file on my desktop and use crossdev to compile all the packages I want and then dump the image to a SD card. So far, I have figured out how to create a file, make partitions in the file representing /boot and /, and format them. Also, setting up the cross compiler isn't a problem. What I can't seem to figure out how to do is the actual cross compiling. If I use armv6j-hardfloat-gnueabi-emerge, it will install everything to /usr/armv6j-hardfloat-gnueabi/..., but my runtime root is mounted from my image file. If I mount the partitions and use the --root=/my/mounted/image/file (a loop device mounted to a temp directory in my home directory) it seems to build the binary I request, but then all the dependencies are not installed, which would make it unusable on the Pi.

Any tips or suggestions to help clear this up for me. thanks!


Last edited by tenspd137 on Tue Jan 29, 2013 6:00 pm; edited 2 times in total
Back to top
View user's profile Send private message
chithanh
Developer
Developer


Joined: 05 Aug 2006
Posts: 1677
Location: Berlin, Germany

PostPosted: Tue Jan 29, 2013 4:01 pm    Post subject: Reply with quote

The first and easiest option is to use cross-compiling distcc which will help somewhat but the link phase still happens on the Pi. Especially for the 256 MB model, linking can take very long if you hit swap. There is a linker switch to reduce memory usage though.

Another option is to mount the Pi's root directory on a fast computer (via NFS or so) and compile in qemu-user chroot. This is less efficient but should work for all packages. Be sure to have PORTAGE_TMPDIR mounted locally.

The final option where all building happens on a fast machine would be to cross-emerge binpkgs and setup PORTAGE_BINHOST on the Pi, but not all packages cross-compile correctly. Setting ROOT to the remotely mounted Pi's / directory for the cross-emerge (what you did) will achieve something similar.

All methods are described in the embedded handbook: http://www.gentoo.org/proj/en/base/embedded/handbook/
Back to top
View user's profile Send private message
tenspd137
Guru
Guru


Joined: 22 Aug 2006
Posts: 375

PostPosted: Tue Jan 29, 2013 4:17 pm    Post subject: Reply with quote

Ahh - thanks - I'll reread the embedded handbook more closely - I think option 3 was the sort of thing I was looking for. It didn't occur to me to make binpkgs and then just install them over the network. I'll also experiment some more with setting ROOT - maybe I missed something.

Thanks!
Back to top
View user's profile Send private message
tenspd137
Guru
Guru


Joined: 22 Aug 2006
Posts: 375

PostPosted: Tue Jan 29, 2013 6:03 pm    Post subject: Reply with quote

Another question - after using the emerge-wrapper --init command and trying to emerge something, I get an error about the make.profile. For example:

Code:

armv6j-hardfloat-linux-gnueabi-emerge -p --root=/mnt/PIROOT nano


gives

Code:

!!! /usr/armv6j-hardfloat-linux-gnueabi/etc/make.profile is not a symlink and will probably prevent most merges.
!!! It should point into a profile within /usr/portage/profiles/
!!! (You can safely ignore this message when syncing. It's harmless.)



These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] app-editors/nano-2.3.1-r2 to /mnt/PIROOT/ USE="minimal* -ncurses* -nls* -unicode*"

 * IMPORTANT: 6 news items need reading for repository 'gentoo'.
 * Use eselect news to read news items.



even though the link is present:

Code:

ls -l /usr/armv6j-hardfloat-linux-gnueabi/etc/make.profile
lrwxrwxrwx 1 root root 30 Nov 15 11:49 /usr/armv6j-hardfloat-linux-gnueabi/etc/make.profile -> /usr/portage/profiles/embedded


Otherwise, It looks like it wants to install a minimal version of nano to /mnt/PIROOT, which is where I have the Pi's directories mounted.

Should I just ignore this?

Thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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