Re: [gentoo-user] Compiling Gentoo for Raspberry Pi (Was: List of base system packages)

2013-02-03 Thread Nilesh Govindrajan
On Sun, Feb 3, 2013 at 7:28 AM, Dustin C. Hatch  wrote:
> On 2/2/2013 19:43, Nilesh Govindrajan wrote:
>>
>> On Sat, Feb 2, 2013 at 11:07 PM, Dustin C. Hatch 
>> wrote:
>>>
>>> I encountered these types of errors when building as well. It is because
>>> the
>>> "embedded" profile, which is the profile crossdev selects by default, is
>>> missing a huge amount of information. I tried defining it all in
>>> ${PORTAGE_CONFIG_ROOT}/profile but it got to be a chore. I ended up
>>> switching to the default Linux profile for ARM, which worked much better.
>>>
>>> --
>>> ♫Dustin
>>>
>>
>> Which means /usr/armv6j-hardfloat-linux-gnueabi/etc/portage/make.profile?
>>
>> --
>> Nilesh Govindrajan
>> http://nileshgr.com
>>
> Yeah, change that to point to /usr/portage/profiles/default/linux/arm/10.0
>
> --
> ♫Dustin
>

Okay that solved the ebuild problem, but I'm stuck with another problem now -_-

make[3]: Entering directory
`/home/armv6j-hardfloat-linux-gnueabi/tmp/portage/sys-libs/pam-1.1.6-r2/work/Linux-PAM-1.1.6/modules/pam_userdb'
/bin/sh ../../libtool --tag=CC   --mode=compile
armv6j-hardfloat-linux-gnueabi-gcc -DHAVE_CONFIG_H -I. -I../..
-I../../libpam/include -I../../libpamc/include -O2 -pipe
-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -W -Wall
-Wbad-function-cast -Wcast-align -Wcast-qual -Wmissing-declarations
-Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wstrict-prototypes
-Wwrite-strings -Winline -Wshadow -c -o pam_userdb.lo pam_userdb.c
libtool: compile:  armv6j-hardfloat-linux-gnueabi-gcc -DHAVE_CONFIG_H
-I. -I../.. -I../../libpam/include -I../../libpamc/include -O2 -pipe
-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -W -Wall
-Wbad-function-cast -Wcast-align -Wcast-qual -Wmissing-declarations
-Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wstrict-prototypes
-Wwrite-strings -Winline -Wshadow -c pam_userdb.c  -fPIC -DPIC -o
.libs/pam_userdb.o
/bin/sh ../../libtool --tag=CC   --mode=link
armv6j-hardfloat-linux-gnueabi-gcc -I../../libpam/include
-I../../libpamc/include -O2 -pipe -march=armv6zk -mtune=arm1176jzf-s
-mfpu=vfp -mfloat-abi=hard -W -Wall -Wbad-function-cast -Wcast-align
-Wcast-qual -Wmissing-declarations -Wmissing-prototypes
-Wpointer-arith -Wreturn-type -Wstrict-prototypes -Wwrite-strings
-Winline -Wshadow -no-undefined -avoid-version -module -ldb-4.8
-lcrypt -Wl,--version-script=./../modules.map -Wl,-O1 -Wl,--as-needed
-Wl,--as-needed -Wl,--no-undefined -Wl,-O1 -o pam_userdb.la -rpath
/lib/security pam_userdb.lo ../../libpam/libpam.la
libtool: link: armv6j-hardfloat-linux-gnueabi-gcc -shared  -fPIC -DPIC
 .libs/pam_userdb.o   -Wl,-rpath
-Wl,/home/armv6j-hardfloat-linux-gnueabi/tmp/portage/sys-libs/pam-1.1.6-r2/work/Linux-PAM-1.1.6/libpam/.libs
/usr/lib/libdb-4.8.so -lpthread -lcrypt -Wl,--as-needed
../../libpam/.libs/libpam.so -ldl  -O2 -march=armv6zk
-mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard
-Wl,--version-script=./../modules.map -Wl,-O1 -Wl,--no-undefined
-Wl,-O1   -Wl,-soname -Wl,pam_userdb.so -o .libs/pam_userdb.so
/usr/lib/libdb-4.8.so: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
make[3]: *** [pam_userdb.la] Error 1
make[3]: Leaving directory
`/home/armv6j-hardfloat-linux-gnueabi/tmp/portage/sys-libs/pam-1.1.6-r2/work/Linux-PAM-1.1.6/modules/pam_userdb'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory
`/home/armv6j-hardfloat-linux-gnueabi/tmp/portage/sys-libs/pam-1.1.6-r2/work/Linux-PAM-1.1.6/modules'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory
`/home/armv6j-hardfloat-linux-gnueabi/tmp/portage/sys-libs/pam-1.1.6-r2/work/Linux-PAM-1.1.6'
make: *** [all] Error 2
 * ERROR: sys-libs/pam-1.1.6-r2 failed (compile phase):
 *   emake failed
 *
 * If you need support, post the output of `emerge --info
'=sys-libs/pam-1.1.6-r2'`,
 * the complete build log and the output of `emerge -pqv
'=sys-libs/pam-1.1.6-r2'`.
 * The complete build log is located at
'/home/armv6j-hardfloat-linux-gnueabi/tmp/portage/sys-libs/pam-1.1.6-r2/temp/build.log'.
 * The ebuild environment file is located at
'/home/armv6j-hardfloat-linux-gnueabi/tmp/portage/sys-libs/pam-1.1.6-r2/temp/environment'.
 * Working directory:
'/home/armv6j-hardfloat-linux-gnueabi/tmp/portage/sys-libs/pam-1.1.6-r2/work/Linux-PAM-1.1.6'
 * S: 
'/home/armv6j-hardfloat-linux-gnueabi/tmp/portage/sys-libs/pam-1.1.6-r2/work/Linux-PAM-1.1.6'

[PS: It's a symlink in /usr, so you see /home in the output]

--
Nilesh Govindrajan
http://nileshgr.com



Re: [gentoo-user] Compiling Gentoo for Raspberry Pi (Was: List of base system packages)

2013-02-03 Thread Dustin C. Hatch

On 2/3/2013 04:10, Nilesh Govindrajan wrote:

Okay that solved the ebuild problem, but I'm stuck with another problem now -_-


...

/usr/lib/libdb-4.8.so: file not recognized: File format not recognized


Looks like it is trying to use the libdb shared object from the host 
system instead of the sysroot.


How are you calling emerge? Can you post the command you ran that was 
used to install PAM? I don't have PAM on my Raspberry Pi, but I just 
tested cross-compiling it and it worked fine.


--
♫Dustin



Re: [gentoo-user] Compiling Gentoo for Raspberry Pi (Was: List of base system packages)

2013-02-03 Thread Nilesh Govindrajan
On Sunday 03 February 2013 09:19:58 PM IST, Dustin C. Hatch wrote:
> On 2/3/2013 04:10, Nilesh Govindrajan wrote:
>> Okay that solved the ebuild problem, but I'm stuck with another
>> problem now -_-
>>
> ...
>> /usr/lib/libdb-4.8.so: file not recognized: File format not recognized
>
> Looks like it is trying to use the libdb shared object from the host
> system instead of the sysroot.
>
> How are you calling emerge? Can you post the command you ran that was
> used to install PAM? I don't have PAM on my Raspberry Pi, but I just
> tested cross-compiling it and it worked fine.
>

Following your blog post you posted a link earlier; calling emerge as -

armv6j-hardfloat-linux-gnueabi-emerge --onlydeps -1 -v $base

It was pulled in as a dependency (for berkdb use flag, set by 
default/linux/arm/10.0/armv6j profile)

--
Nilesh Govindarajan
http://nileshgr.com



Re: [gentoo-user] Compiling Gentoo for Raspberry Pi (Was: List of base system packages)

2013-02-03 Thread Dustin C. Hatch

On 2/3/2013 12:24, Nilesh Govindrajan wrote:

On Sunday 03 February 2013 09:19:58 PM IST, Dustin C. Hatch wrote:

On 2/3/2013 04:10, Nilesh Govindrajan wrote:

Okay that solved the ebuild problem, but I'm stuck with another
problem now -_-


...

/usr/lib/libdb-4.8.so: file not recognized: File format not recognized


Looks like it is trying to use the libdb shared object from the host
system instead of the sysroot.

How are you calling emerge? Can you post the command you ran that was
used to install PAM? I don't have PAM on my Raspberry Pi, but I just
tested cross-compiling it and it worked fine.



Following your blog post you posted a link earlier; calling emerge as -

armv6j-hardfloat-linux-gnueabi-emerge --onlydeps -1 -v $base

It was pulled in as a dependency (for berkdb use flag, set by
default/linux/arm/10.0/armv6j profile)

--
Nilesh Govindarajan
http://nileshgr.com

Okay, the problem is probably the way PAM tries to link against db. 
Unless you need that functionality, I'd go ahead and remove the berkdb 
USE flag and try again. You may also want to file a bug.


--
♫Dustin



Re: [gentoo-user] Compiling Gentoo for Raspberry Pi (Was: List of base system packages)

2013-02-03 Thread Nilesh Govindrajan
On Mon, Feb 4, 2013 at 3:14 AM, Dustin C. Hatch  wrote:
> On 2/3/2013 12:24, Nilesh Govindrajan wrote:
> Okay, the problem is probably the way PAM tries to link against db. Unless
> you need that functionality, I'd go ahead and remove the berkdb USE flag and
> try again. You may also want to file a bug.
>

Nah, I don't need berkdb, I'll do without it.
Did you install emerge/portage on the Pi yet?
Python cannot be cross compiled (it's a hot topic since ages, but very
few people have been successful with that).
So I guess Python would have to be compiled on the Pi itself... the
question is, emerge needs python and python needs emerge?!!?

--
Nilesh Govindrajan
http://nileshgr.com



Re: [gentoo-user] Compiling Gentoo for Raspberry Pi (Was: List of base system packages)

2013-02-03 Thread Yohan Pereira
On 04/02/13 at 11:13am, Nilesh Govindrajan wrote:
> Nah, I don't need berkdb, I'll do without it.
> Did you install emerge/portage on the Pi yet?
> Python cannot be cross compiled (it's a hot topic since ages, but very
> few people have been successful with that).
> So I guess Python would have to be compiled on the Pi itself... the
> question is, emerge needs python and python needs emerge?!!?

I recently got a minimal gentoo running on the pi (without running
emerge/compiling on the pi), here's what I've learned.

Cross compilation is FUN <\sarcasm>. Lots of packages (like python)
don't like being cross compiled. A good number of  failures occurred 
because of missing build time dependencies on the host, Some times I had
to copy certain files need at build-time from the host to the arm
sysroot (mainly for the x11-proto/* packages).

For the really adamant packages (like python) I used the method
described here [1] to build binary packages using a native arm chroot +
qemu-user (a rather interesting way to go about it). 

However I've not compared the performance (wrt compilation time) to 
running a full blown arm qemu vm so you may want to try that and see 
what works better for you. But I reckon any of these methods should be 
faster than compiling on the pi on a modern CPU. 

Also note cross-compiling is way faster than this method so I preferred
cross-compiling and only resorted to this for packages like python.  

In the end I got it to boot. Then I decided I wanted to try xbmc, after
seeing the long list of dependencies, I went ahead and installed
openELEC :D. Which works great BTW (Still trying to find some indian
news streams).

[1] http://www.gentoo.org/proj/en/base/embedded/handbook/?part=1&chap=5
(Note that page is a bit dated, app-emulation/qemu-user is masked in the
tree. Use app-emulation/qemu instead)

-- 

- Yohan Pereira

The difference between a Miracle and a Fact is exactly the difference
between a mermaid and a seal.
-- Mark Twain



Re: [gentoo-user] Compiling Gentoo for Raspberry Pi (Was: List of base system packages)

2013-02-03 Thread Nilesh Govindrajan
On Mon, Feb 4, 2013 at 12:02 PM, Yohan Pereira  wrote:
>
> I recently got a minimal gentoo running on the pi (without running
> emerge/compiling on the pi), here's what I've learned.
>
> Cross compilation is FUN <\sarcasm>. Lots of packages (like python)
> don't like being cross compiled. A good number of  failures occurred
> because of missing build time dependencies on the host, Some times I had
> to copy certain files need at build-time from the host to the arm
> sysroot (mainly for the x11-proto/* packages).
>
> For the really adamant packages (like python) I used the method
> described here [1] to build binary packages using a native arm chroot +
> qemu-user (a rather interesting way to go about it).
>
> However I've not compared the performance (wrt compilation time) to
> running a full blown arm qemu vm so you may want to try that and see
> what works better for you. But I reckon any of these methods should be
> faster than compiling on the pi on a modern CPU.
>
> Also note cross-compiling is way faster than this method so I preferred
> cross-compiling and only resorted to this for packages like python.
>
> In the end I got it to boot. Then I decided I wanted to try xbmc, after
> seeing the long list of dependencies, I went ahead and installed
> openELEC :D. Which works great BTW (Still trying to find some indian
> news streams).
>
> [1] http://www.gentoo.org/proj/en/base/embedded/handbook/?part=1&chap=5
> (Note that page is a bit dated, app-emulation/qemu-user is masked in the
> tree. Use app-emulation/qemu instead)
>

Emulating the Pi on my machine would be slower since I have a dated
E2180. It would be rather easier to get distcc on the Pi and make use
of the 3 processors.

But need to first figure out how to install emerge there...
alternatively, could go with paludis which is written in C++, so the
nagging python thing won't be there.

--
Nilesh Govindrajan
http://nileshgr.com



Re: [gentoo-user] Compiling Gentoo for Raspberry Pi (Was: List of base system packages)

2013-02-03 Thread Yohan Pereira
On 04/02/13 at 12:14pm, Nilesh Govindrajan wrote:
> Emulating the Pi on my machine would be slower since I have a dated
> E2180. It would be rather easier to get distcc on the Pi and make use
> of the 3 processors.
> 
> But need to first figure out how to install emerge there...
> alternatively, could go with paludis which is written in C++, so the
> nagging python thing won't be there.

In that case why don't you just go ahead and use the stage 3 provided 
for the pi? I know you said you didn't want to use it earlier, but
assuming your using the default profile to cross compile it will pull in
everything that's in the stage3 tarball anyway. 

Once the stage 3 is setup you can use distcc and get rid of the stuff
you dont want. 

Another thing you can do to speed things up is mount the root file
system over NFS or on a usb hdd. It was quite a bit faster in 
my experience

-- 

- Yohan Pereira

The difference between a Miracle and a Fact is exactly the difference
between a mermaid and a seal.
-- Mark Twain



Re: [gentoo-user] Compiling Gentoo for Raspberry Pi (Was: List of base system packages)

2013-02-04 Thread Nilesh Govindrajan
On Mon, Feb 4, 2013 at 12:35 PM, Yohan Pereira  wrote:
>
> In that case why don't you just go ahead and use the stage 3 provided
> for the pi? I know you said you didn't want to use it earlier, but
> assuming your using the default profile to cross compile it will pull in
> everything that's in the stage3 tarball anyway.
>
> Once the stage 3 is setup you can use distcc and get rid of the stuff
> you dont want.
>
> Another thing you can do to speed things up is mount the root file
> system over NFS or on a usb hdd. It was quite a bit faster in
> my experience
>

Three reasons:
Fun
Experience
Knowledge

:-)

--
Nilesh Govindrajan
http://nileshgr.com



Re: [gentoo-user] Compiling Gentoo for Raspberry Pi (Was: List of base system packages)

2013-02-04 Thread Dustin C. Hatch

On 2/3/2013 23:43, Nilesh Govindrajan wrote:

On Mon, Feb 4, 2013 at 3:14 AM, Dustin C. Hatch  wrote:

On 2/3/2013 12:24, Nilesh Govindrajan wrote:
Okay, the problem is probably the way PAM tries to link against db. Unless
you need that functionality, I'd go ahead and remove the berkdb USE flag and
try again. You may also want to file a bug.



Nah, I don't need berkdb, I'll do without it.
Did you install emerge/portage on the Pi yet?
Python cannot be cross compiled (it's a hot topic since ages, but very
few people have been successful with that).
So I guess Python would have to be compiled on the Pi itself... the
question is, emerge needs python and python needs emerge?!!?

--
Nilesh Govindrajan
http://nileshgr.com

No, minimalist Pi only has exactly what I need to run it. When I need to 
install additional software, I put the SD card in my desktop and run


armv6j-hardfloat-linux-gnueabi-emerge --root=/mnt/raspberrypi -av $pkg

I do have Python installed on it though. I actually have more than one 
Raspberry Pi, one of which runs a full install of Gentoo from a stage3 
tarball. I've got it set up with DistCC to offload most of the compiling 
to my desktops and servers, so it didn't take too long to build Python 
natively. Once it was built, I just installed the binary on the 
minimalist Pi using the same method as other packages.


--
♫Dustin



Re: [gentoo-user] Compiling Gentoo for Raspberry Pi (Was: List of base system packages)

2013-02-04 Thread Nilesh Govindrajan
On Tue, Feb 5, 2013 at 12:53 AM, Dustin C. Hatch  wrote:
> No, minimalist Pi only has exactly what I need to run it. When I need to
> install additional software, I put the SD card in my desktop and run
>
> armv6j-hardfloat-linux-gnueabi-emerge --root=/mnt/raspberrypi -av $pkg
>
> I do have Python installed on it though. I actually have more than one
> Raspberry Pi, one of which runs a full install of Gentoo from a stage3
> tarball. I've got it set up with DistCC to offload most of the compiling to
> my desktops and servers, so it didn't take too long to build Python
> natively. Once it was built, I just installed the binary on the minimalist
> Pi using the same method as other packages.
>

The question is, how did you compile python? You ran a job on one of the Pis?

--
Nilesh Govindrajan
http://nileshgr.com



Re: [gentoo-user] Compiling Gentoo for Raspberry Pi (Was: List of base system packages)

2013-02-04 Thread Dustin C. Hatch

On 2/4/2013 22:41, Nilesh Govindrajan wrote:

On Tue, Feb 5, 2013 at 12:53 AM, Dustin C. Hatch  wrote:

No, minimalist Pi only has exactly what I need to run it. When I need to
install additional software, I put the SD card in my desktop and run

armv6j-hardfloat-linux-gnueabi-emerge --root=/mnt/raspberrypi -av $pkg

I do have Python installed on it though. I actually have more than one
Raspberry Pi, one of which runs a full install of Gentoo from a stage3
tarball. I've got it set up with DistCC to offload most of the compiling to
my desktops and servers, so it didn't take too long to build Python
natively. Once it was built, I just installed the binary on the minimalist
Pi using the same method as other packages.



The question is, how did you compile python? You ran a job on one of the Pis?

--
Nilesh Govindrajan
http://nileshgr.com

Yes. Just use the --buildpkg switch, copy the resulting .tbz2 from 
$PKGDIR on the Raspberry Pi to your crossdev host and then use emerge 
--usepkg to install it on your SD card.


--
♫Dustin