# uclibc stage3 2010 [for embedded]

## judepereira

Hi, I've rebuild the stage3 for uclibc-gentoo-x86, as all the other stages everywhere are outdated, so if anyone would like to have it, head over to my blog post, http://judepereira.com/blog/gentoo-linux-uclibc-stage3-2010-for-embedded/

Now you can successfully build tiny gentoo.

----------

## judepereira

[going embedded with mGentoo], my basic guide to have a mini gentoo install, all under 20MB, and at boot, only 3MB of RAM being used...

http://judepereira.com/blog/going-embedded-with-mgentoo/

----------

## fantomas

thanks   :Very Happy: 

----------

## TheLazy1

This is exactly what I'm looking for, following the instructions now  :Smile: 

One issue I noticed is here:

 *Quote:*   

> 
> 
> # begin the installation
> 
> # install necessary packages
> ...

 

The little syntax highlighting box cuts off the complete list of things to be emerge'd.

It might not be a big issue but I though I'd mention it.

----------

## judepereira

 *TheLazy1 wrote:*   

> This is exactly what I'm looking for, following the instructions now 
> 
> One issue I noticed is here:
> 
>  *Quote:*   
> ...

 

Ah, thanks, will work on that, you need to click the view source button, right at the top-right corner, the third button towards the left, and the source can be viewed directly...

Will definitely work on the syntax-highlighter stylesheet...

----------

## cynyr

Care to share how you made the stage tarball? I'm wanting one for x86_64, for a via nano board. There is almost 0 doc on using catalyst for "exotic" systems.

----------

## Shining Arcanine

 *cynyr wrote:*   

> Care to share how you made the stage tarball? I'm wanting one for x86_64, for a via nano board. There is almost 0 doc on using catalyst for "exotic" systems.

 

I concur. Documentation regarding how the stage3 tarball was made would be excellent. It could be adapted to other platforms that are in a similar state, such as the ARM chips used in the Linksys NSLU2.

----------

## judepereira

It's pretty simple...

Take an existing gentoo install, of whatever arch you want to, and then all you have to do is ROOT=/newstage3 emerge baselayout, and all the other apps you need, that are there in a basic stage3. You'll definitely need uclibc, for embedded, baselayout uclibc bash dropbear pam udev iptables coreutils nano util-linux shadow kbd net-tools grep procps gzip sed findutils mawk htop.

That's what I basically need, takes care of all authentication and all.

Don't forget to emerge portage, and the necessary tools.

Would publish a record of doing this, as soon as I have a fast bandwidth, to download all the sources.

If you have any questions, you can go ahead and ask!

Cheers   :Very Happy: 

----------

## Shining Arcanine

That would probably help with:

https://forums.gentoo.org/viewtopic-t-816789.html

It will need some minor adjustments, but if cross-compilation is possible with just a few switches, then I imagine it will make going forward with getting Gentoo on the NSLU2 much easier.

Edit: I just found the following:

http://www.gentoo.org/proj/en/base/embedded/cross-development.xml

This is making things much easier.  :Very Happy: 

----------

## cynyr

 *judepereira wrote:*   

> It's pretty simple...
> 
> Take an existing gentoo install, of whatever arch you want to, and then all you have to do is ROOT=/newstage3 emerge baselayout, and all the other apps you need, that are there in a basic stage3. You'll definitely need uclibc, for embedded, baselayout uclibc bash dropbear pam udev iptables coreutils nano util-linux shadow kbd net-tools grep procps gzip sed findutils mawk htop.

 

So setup crossdev, set CBUILD, CHOST, CTARGET, ROOT, PORTAGE_CONFIGROOT and then emerge {LIST_OF_STUFF_NEEDED}, then simply tar and gzip ${ROOT} and host the resulting tarball, and unpack like normal?

----------

## judepereira

 *cynyr wrote:*   

>  *judepereira wrote:*   It's pretty simple...
> 
> Take an existing gentoo install, of whatever arch you want to, and then all you have to do is ROOT=/newstage3 emerge baselayout, and all the other apps you need, that are there in a basic stage3. You'll definitely need uclibc, for embedded, baselayout uclibc bash dropbear pam udev iptables coreutils nano util-linux shadow kbd net-tools grep procps gzip sed findutils mawk htop. 
> 
> So setup crossdev, set CBUILD, CHOST, CTARGET, ROOT, PORTAGE_CONFIGROOT and then emerge {LIST_OF_STUFF_NEEDED}, then simply tar and gzip ${ROOT} and host the resulting tarball, and unpack like normal?

 

Absolutely, I don't see why such an easy thing should ever be made more complicated than it already is...

----------

## cynyr

 *judepereira wrote:*   

>  *cynyr wrote:*    *judepereira wrote:*   It's pretty simple...
> 
> Take an existing gentoo install, of whatever arch you want to, and then all you have to do is ROOT=/newstage3 emerge baselayout, and all the other apps you need, that are there in a basic stage3. You'll definitely need uclibc, for embedded, baselayout uclibc bash dropbear pam udev iptables coreutils nano util-linux shadow kbd net-tools grep procps gzip sed findutils mawk htop. 
> 
> So setup crossdev, set CBUILD, CHOST, CTARGET, ROOT, PORTAGE_CONFIGROOT and then emerge {LIST_OF_STUFF_NEEDED}, then simply tar and gzip ${ROOT} and host the resulting tarball, and unpack like normal? 
> ...

 

Well in my case, getting x86_64-gentoo-linux-uclibc via crossdev is proving to be quite a hassle. AHHA! got it, i needed to switch my profile uclibc/amd64 briefly. now that i have the cross toolchain installed, it works just fine set back to normal.Last edited by cynyr on Thu Jun 03, 2010 4:55 pm; edited 1 time in total

----------

## Shining Arcanine

 *cynyr wrote:*   

>  *judepereira wrote:*    *cynyr wrote:*    *judepereira wrote:*   It's pretty simple...
> 
> Take an existing gentoo install, of whatever arch you want to, and then all you have to do is ROOT=/newstage3 emerge baselayout, and all the other apps you need, that are there in a basic stage3. You'll definitely need uclibc, for embedded, baselayout uclibc bash dropbear pam udev iptables coreutils nano util-linux shadow kbd net-tools grep procps gzip sed findutils mawk htop. 
> 
> So setup crossdev, set CBUILD, CHOST, CTARGET, ROOT, PORTAGE_CONFIGROOT and then emerge {LIST_OF_STUFF_NEEDED}, then simply tar and gzip ${ROOT} and host the resulting tarball, and unpack like normal? 
> ...

 

I am having the same trouble with armv5teb-softfloat-linux-uclibc.

----------

## cynyr

 *Shining Arcanine wrote:*   

>  *cynyr wrote:*    *judepereira wrote:*    *cynyr wrote:*    *judepereira wrote:*   It's pretty simple...
> 
> Take an existing gentoo install, of whatever arch you want to, and then all you have to do is ROOT=/newstage3 emerge baselayout, and all the other apps you need, that are there in a basic stage3. You'll definitely need uclibc, for embedded, baselayout uclibc bash dropbear pam udev iptables coreutils nano util-linux shadow kbd net-tools grep procps gzip sed findutils mawk htop. 
> 
> So setup crossdev, set CBUILD, CHOST, CTARGET, ROOT, PORTAGE_CONFIGROOT and then emerge {LIST_OF_STUFF_NEEDED}, then simply tar and gzip ${ROOT} and host the resulting tarball, and unpack like normal? 
> ...

 

Are you getting errors about ld not being able to find -lc? if so, try changing your profile to one of the uclibc ones, "crossdev -t ${FOO}" and set it back afterwards.

----------

## Shining Arcanine

My issues are related to VFP instructions:

https://forums.gentoo.org/viewtopic-p-6301247.html#6301247

----------

## jowr

The uclibc stage3's are appreciated, saved me a giant pain in the ass that is the cross compile process. Thanks!

----------

## cynyr

So I finally managed to get uclibc + GCC working on my multilib amd64 install.

see https://bugs.gentoo.org/show_bug.cgi?id=244892#c11

short answer, you need to unforce multilib for cross-x86_64-gentoo-linux-uclibc/gcc and then make sure that USE="-multilib" is set for cross/gcc.

----------

## TheLazy1

[Removed, doesn't fit topic]Last edited by TheLazy1 on Mon Oct 18, 2010 2:21 pm; edited 1 time in total

----------

## cynyr

Try "linux32 xmerge --root foo" although i thought catalyst was providing "${TARGET}-emerge" scripts that set the root and profiles and such up for you these days. You would still need linux32 to make your x86_64 cpu look like a x86 one.

----------

## TheLazy1

 *judepereira wrote:*   

> Hi, I've rebuild the stage3 for uclibc-gentoo-x86, as all the other stages everywhere are outdated, so if anyone would like to have it, head over to my blog post, http://judepereira.com/blog/gentoo-linux-uclibc-stage3-2010-for-embedded/
> 
> Now you can successfully build tiny gentoo.

 

Good work on the stage3, instead though of making tinygentoo I just used it to build a uClibc based system for a P1 133 laptop.

There are only a few issues though which I can figure out, one being udev and the other being a bunch of warnings on login.

It does have a low memory footprint though and Xorg seems to work fine.  :Smile: 

----------

## aidanjt

I was looking for something like this last year.  Ah well.

----------

## TheLazy1

Unless something was totally wrong on my end, why did you not patch uClibc to work with udev?

I needed this patch before it would work.

Which, of course I have to do again since I had not learned my lesson about backing things up.  :Very Happy: 

----------

