Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] armv6j stage with busybox and uclibc
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures
View previous topic :: View next topic  
Author Message
hcaulfield57
Tux's lil' helper
Tux's lil' helper


Joined: 13 Mar 2012
Posts: 148

PostPosted: Sat Sep 15, 2012 9:50 pm    Post subject: [SOLVED] armv6j stage with busybox and uclibc Reply with quote

I should be getting a Raspberry Pi soon, and being an avid fan of Gentoo, I wanted to install it on it. It looks like many people have had success with Gentoo on the RPi, and following the wiki looks straight forward enough. However I was hoping to create a smaller environment on the RPi using busybox and uclibc. As far as I can tell there are no stages for this available. Is there a way to set up this environment with Gentoo, or should I just try the normal armv6j stages or make my own setup outside of Gentoo.

Last edited by hcaulfield57 on Wed Sep 19, 2012 2:20 am; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sat Sep 15, 2012 10:39 pm    Post subject: Reply with quote

hcaulfield57,

There are lots of Gentoo learning opportunities without going down the busybox ulibc path.
You will want to use NFS or a USB HDD if you will build anything on the Pi. Cross compiling with distcc is very useful too.

Just now, my Pi is powered off a USB port on my HP Microserver, which provides all of its filesystems except /boot over NFS.
/boot must be on the SD card.

Once its up and running play with ulibc and busybox. I can tell you busybox works well as I build it static for a rescue shell.
_________________
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
hcaulfield57
Tux's lil' helper
Tux's lil' helper


Joined: 13 Mar 2012
Posts: 148

PostPosted: Sat Sep 15, 2012 10:59 pm    Post subject: Reply with quote

I hadn't thought of NFS, might look into that. So how would I go about having a busybox/uclibc system though? Because the stage3 online is just a normal GNU system, unless I'm mistaken? Thank you for the input, it should be fun to see what I can do with this.

EDIT: Looked some more at NFS, looks pretty straight forward, I assume then you can just have /boot and an initramfs on the RPi for mounting the other partitions?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sat Sep 15, 2012 11:23 pm    Post subject: Reply with quote

hcaulfield57,

I don't use an initrd. There is no need, provided /usr and /var are on / (root)
I don't use ip=dhcp either, but I suppose I should.

As you say, the armv6j stage 3 is a normal stage3.

You will need crossdev set up, as per the wiki. What you put into its rootfs at the start is up to you. You can start with nothing excapt a cross tool chain.
That fails fairly early on as perl and python are very cross compile hostile.
Parts of the python build system are built and need to run on the host during the build ... thats two packages best build on the Pi with the help of distcc and your cross compiler.
_________________
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
hcaulfield57
Tux's lil' helper
Tux's lil' helper


Joined: 13 Mar 2012
Posts: 148

PostPosted: Sat Sep 15, 2012 11:45 pm    Post subject: Reply with quote

Ah, I see about just starting from a crossdev toolchain. Question though, if you have everything but /boot on NFS, how does the kernel mount the root filesystem without initramfs? Or am I misunderstanding something. Thanks for the input, looking at distcc and crossdev, this should be fun, just trying to think of a purpose for it now. Was going to say hulu on my widescreen television, but unfortunately (or fortunately) no flash.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sun Sep 16, 2012 12:54 pm    Post subject: Reply with quote

hcaulfield57,

The kernel needs tp contain everything needed to mount root over nfs, the same as it does to mount root over usb or root on a local HDD, when you don't use an initrd.
I can give your a kernel command line that works on Raspberry Pi if you like but that might spoil your adventure, so I'll wait until you ask.

Before youu get your pi you can try crossdev with an empty root filesystem and see how far emerge -e @system gets you inside emerge-wrapper.
Turn on FEATURES=buildpkg in th cross environment so you save your arm packages and can use emerge -K on the Pi to install them there without a rebuild.
Don't get too carried away - expect s chroot into the arm environment to fail :)
_________________
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
hcaulfield57
Tux's lil' helper
Tux's lil' helper


Joined: 13 Mar 2012
Posts: 148

PostPosted: Sun Sep 16, 2012 5:46 pm    Post subject: Reply with quote

Thanks :) Yea, I did a little research last night, and didn't realize that you could tell the kernel the root was over NFS from the boot loader, I was under the impression that initramfs was necessary for that, but turns out it's not.

I actually started last night, with:
Code:

crossdev -v -t armv6j-hardfloat-linux-uclibc

but unfortunately that failed with the first build of gcc. I'm not sure if it's because a) computer I was compiling on is hardened or b) because of the change of gnueabi to uclibc. So, going to keep trying. I assume some people have got it work, so it's not impossible!
Back to top
View user's profile Send private message
roarinelk
Guru
Guru


Joined: 04 Mar 2004
Posts: 520

PostPosted: Sun Sep 16, 2012 6:30 pm    Post subject: Reply with quote

the "v6j" in the triplet gave me headaches as well.
Something like this worked for me:
EXTRA_ECONF="--with-arch=armv6j" crossdev -t armel-hardfloat-linux-uclibc
Back to top
View user's profile Send private message
hcaulfield57
Tux's lil' helper
Tux's lil' helper


Joined: 13 Mar 2012
Posts: 148

PostPosted: Sun Sep 16, 2012 7:46 pm    Post subject: Reply with quote

Thanks for the tip, I will give that a try, if reinstalling non-hardened Gentoo does not work.
Back to top
View user's profile Send private message
hcaulfield57
Tux's lil' helper
Tux's lil' helper


Joined: 13 Mar 2012
Posts: 148

PostPosted: Mon Sep 17, 2012 5:45 am    Post subject: Reply with quote

I've tried a couple things all of which have failed:

EXTRA_ECONF="--with-arch=armv6j" crossdev -t armel-hardfloat-linux-uclibc
--> fails on gcc
EXTRA_ECONF="--with-arch=armv6j" crossdev -t arm-hardfloat-linux-uclibc
--> fails on uclibc

I'm going to try with just glibc now, I would like to use uclibc, but I'm not sure why it's not working.

EDIT: Okay, I tried crossdev -S -v -t armv6j-hardfloat-linux-gnueabi now, and that gets through the second compile of gcc, and then fails on the 3rd and last compile of gcc. Very discouraging, I'm done trying for a little while.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Mon Sep 17, 2012 5:49 pm    Post subject: Reply with quote

hcaulfield57,

crossdev -S -v -t armv6j-hardfloat-linux-gnueabi works for me without the -S on both harened and non hardened ~amd64 /non-multilib/ installs.

It may be useful to read or post at bugs.gentoo.org
_________________
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
hcaulfield57
Tux's lil' helper
Tux's lil' helper


Joined: 13 Mar 2012
Posts: 148

PostPosted: Mon Sep 17, 2012 6:19 pm    Post subject: Reply with quote

Thanks, I'm going to try a few more things, going to try and lower my MAKEFLAGS to -j1 and see if that helps, dunno why it would help, but I think I saw it somewhere that builds were failing with higher amount of jobs. There is nothing weird about this install, so it should work, and more than you have told me that they were able to build a armv6j-hardfloat-linux-gnueabi toolchain, so I'm not sure what the problem is, if I can't figure it out, I will post a bug.
Back to top
View user's profile Send private message
hcaulfield57
Tux's lil' helper
Tux's lil' helper


Joined: 13 Mar 2012
Posts: 148

PostPosted: Wed Sep 19, 2012 2:19 am    Post subject: Reply with quote

Okay, I filed a bug, and turns out this is a bug other people were having with crossdev on x86. There is something wrong with GNU Fortran and the crossdev build environment, however if USE="-fortran" is enabled, crossdev compiles everything happily. So I finally got my toolchain set up. I was able to build:
Code:

armv6j-hardfloat-linux-uclibceabi

Hope this helps anyone who has similar problems.
Back to top
View user's profile Send private message
hcaulfield57
Tux's lil' helper
Tux's lil' helper


Joined: 13 Mar 2012
Posts: 148

PostPosted: Wed Sep 19, 2012 7:19 am    Post subject: Reply with quote

NeddySeagoon wrote:

Parts of the python build system are built and need to run on the host during the build ... thats two packages best build on the Pi with the help of distcc and your cross compiler.

I understand this, but a problem I'm having, is that yes python and perl will not cross compile, but I want to have a uclibc system and not glibc, so should I install the glibc stage on the Pi, and then crosscompile packages for uclibc and convert the system over to that, or what? Because there are a number of things that will not compile so far with the toolchain I built, and I don't see how I can build in qemu because there is no uclibc stage.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures 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