Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[crossdev] How to create/update a system in a chroot ?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
xaviermiller
Bodhisattva
Bodhisattva


Joined: 23 Jul 2004
Posts: 8708
Location: ~Brussels - Belgique

PostPosted: Wed Jan 28, 2015 8:18 am    Post subject: [crossdev] How to create/update a system in a chroot ? Reply with quote

Hello,

I would like to update my raspberry pi installation from my PC, but I have problems with e.g. GCC, which don't find GMP or MPFR.

what I do is calling cross-emerge like this:

Code:
ROOT=/data/raspi_root/ SYSROOT=/usr/armv6j-hardfloat-linux-gnueabi/ armv6j-hardfloat-linux-gnueabi-emerge


Previously, I also tried to integrate needed libs in SYSROOT, but I ended with the need of emerging glibc on SYSROOT, that messed up the cross-system.

What is wrong?

There are also some ebuilds that don't like cross-building, I know it and will emerge them with the raspberry pi. But if I can avoid GCC, this could be nice!
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
Jimmy Jazz
Guru
Guru


Joined: 04 Oct 2004
Posts: 325
Location: Strasbourg

PostPosted: Wed Jan 28, 2015 6:07 pm    Post subject: Re: [crossdev] How to create/update a system in a chroot ? Reply with quote

xaviermiller wrote:


I would like to update my raspberry pi installation from my PC, but I have problems with e.g. GCC, which don't find GMP or MPFR.



I suggest you to try https://github.com/crosstool-ng/crosstool-ng. It seems promising.

My knowlegde in arm cross-compiling is limited and I didn't have an arm computer to test it :(
If you are interested to test crosstool-ng, it would be great to tell us if it was susccessful for you.

I did as follow,

Code:

: git clone git://crosstool-ng.org/crosstool-ng
: cd crosstool-ng
: ./bootstrap
: ./configure --enable-local
: make
: ./ct-ng help
: ./ct-ng menuconfig
: ./ct-ng build
:
: export PATH="${PATH}:${HOME}/x-tools/arm-unknown-linux-musleabi/bin"
:
: cd linux
: make ARCH=arm CROSS_COMPILE=arm-unknown-linux-musleabi-  \
:    INSTALL_MOD_PATH=/tmp/arm INSTALL_PATH=/tmp/arm/boot \
:    modules_install install

_________________
« La seule condition au triomphe du mal, c'est l'inaction des gens de bien » E.Burke
Code:

+----+----+----+
|    |::::|    |
|    |::::|    |
+----+----+----+

motto: WeLCRO
WritE Less Code, Repeat Often
Back to top
View user's profile Send private message
xaviermiller
Bodhisattva
Bodhisattva


Joined: 23 Jul 2004
Posts: 8708
Location: ~Brussels - Belgique

PostPosted: Wed Jan 28, 2015 9:53 pm    Post subject: Reply with quote

Merci ;)

But I will first take a try to Gentoo crossdev, because the ease of the Portage integration.
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
WombleGoneBad
n00b
n00b


Joined: 19 Jan 2015
Posts: 2

PostPosted: Thu Jan 29, 2015 11:00 pm    Post subject: Reply with quote

I'm wondering about this stuff too...
If i you use crosstools-ng to create the toolchain, can you seemlessly use crossdev on top for the portage stuff (emerge-wrapper etc)?
I have used crosstools-ng before (for non-standard ARM hardware, and not for gentoo) and was impressed with the results, but don't want to snub crossdev toolchain if it can do the job.

I am planning to build 2 PI's and samsung chromebook in the near future.
(I'm also wondering If i should use create binary packages instead of installing directly from the host)
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Fri Jan 30, 2015 4:37 am    Post subject: Reply with quote

xaviermiller wrote:
But I will first take a try to Gentoo crossdev, because the ease of the Portage integration.

xaviermiller ... be forewarned that it will 'integrate' with whatever overlay happens to be the first (non-"gentoo") repo in 'portageq repositories_configuration /', and that --ov-output and CROSSDEV_OVERLAY don't behave as expected (ie, it states "overlay to write crossdev package links" but then creates a sub dir in the target ... and sets features on the 'overlay' if there happens to be other layout.conf's found in other repos within that target!).

Its based the assumptions that should have been standardised long ago ... basically, the lack of a proper namespace for 'repos'.

best ... khay
Back to top
View user's profile Send private message
xaviermiller
Bodhisattva
Bodhisattva


Joined: 23 Jul 2004
Posts: 8708
Location: ~Brussels - Belgique

PostPosted: Fri Jan 30, 2015 8:14 am    Post subject: Reply with quote

So, it's not possible to have a catalyst-like system making cross-stages ?
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Fri Jan 30, 2015 1:01 pm    Post subject: Reply with quote

xaviermiller wrote:
So, it's not possible to have a catalyst-like system making cross-stages?

xavier ... well, crossdev is simply for building the toolchain, you would then need to use that toolchain to build your stage in EPREFIX=/path/to. The above was just a warning about where it will place the ebuilds used for doing this. As I remember I ended up removing all repo's from PORTDIR_OVERLAY (or rather 'portageq repositories_configuration /'), running crossdev, then re-adding them (placing the overlay for crossdev as the first in the array). So, I worked around the issue, but it really brought to light how broken the current namespace is ... we have:

/usr/portage # strangely named "gentoo"
/usr/portage/local # yup ... for that purpose, but within the 'gentoo' repo
/usr/local/portage # or whatever ... the "local overlay"
/var/lib/layman/{repo}

Then we have PORTDIR, DISTDIR, PKGDIR for the "gentoo" repo, along with the definitions in repos.conf, definitions in layman.conf (often 'sourced' by make.conf ... though these can be placed in repos.conf). Then we have all the magic used by crossdev, gentoolkit, etc, to find these repos (and in the case of crossdev guess which one should be used for CROSSDEV_OVERLAY).

If we had a top level namespace it might look like the following:

PKGDIR=/path/to
$PKGDIR/crossdev-mips-unknown-linux-uclibc
$PKGDIR/crossdev-sh4-unknown-linux-gnu
$PKGDIR/gentoo # mistakenly named "portage"
$PKGDIR/{layman_installed_repo1}
$PKGDIR/{layman_installed_repo2}
$PKGDIR/local
/var/lib/layman # layman timestamps, installed.xml, etc
*/distfiles # which really shouldn't be inside the 'gentoo' repo or anywhere near PKGDIR
*/packages # which really shouldn't be inside the 'gentoo' repo or anywhere near PKGDIR

With the above {make,repos}.conf, parse_repo_config(), get_portdir(), etc, and would be much simplified, and crossdev could stop guessing and so the right thing ... create an overlay based on --target.

best ... khay
Back to top
View user's profile Send private message
xaviermiller
Bodhisattva
Bodhisattva


Joined: 23 Jul 2004
Posts: 8708
Location: ~Brussels - Belgique

PostPosted: Fri Jan 30, 2015 1:09 pm    Post subject: Reply with quote

So, I will need to wait 27 hours until GCC is compiled, while it was cross-compiled in 15 minutes :cry:

EDIT, but if I listen to you, cross-emerge should not exist. Why does it exist for?
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Fri Jan 30, 2015 2:14 pm    Post subject: Reply with quote

xaviermiller wrote:
So, I will need to wait 27 hours until GCC is compiled, while it was cross-compiled in 15 minutes :cry:

xavier ... sorry, I don't understand. You can still use crossdev ... I was just warning you about issues with where it *might* store the ebuilds used for --target.

xaviermiller wrote:
EDIT, but if I listen to you, cross-emerge should not exist. Why does it exist for?

Huh? I was speaking about 'crossdev' the command. You have to have CHOST for cross-emerge to function.

best ... khay
Back to top
View user's profile Send private message
xaviermiller
Bodhisattva
Bodhisattva


Joined: 23 Jul 2004
Posts: 8708
Location: ~Brussels - Belgique

PostPosted: Fri Jan 30, 2015 2:20 pm    Post subject: Reply with quote

My initial question is around cross-emerge, but it could be not well understood.

So, I restate it : I have Gentoo installed on a Raspberry pi, and I would like to update it through cross-emerge on a x86_64 host.
My idea is that cross-emerge should do the work, at least for what can be cross-compiled (so not python, perl, or packages that are not aware about cross-compilation).

I could cross-emerge some packages but I don't see how to update GCC. It depends on gmp, mpfr, that are bot installed on the cross ROOT, but they are not detected during the configure phase. Maybe because GCC does not search on the cross ROOTbut on the cross SYSROOT?
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Sun Feb 01, 2015 2:39 pm    Post subject: Reply with quote

xaviermiller wrote:
I have Gentoo installed on a Raspberry pi, and I would like to update it through cross-emerge on a x86_64 host. My idea is that cross-emerge should do the work, at least for what can be cross-compiled (so not python, perl, or packages that are not aware about cross-compilation).

xavier ... sorry, seemed to have missed the topic reply notification. I've not used cross-emerge, the crossdev env I'd built in the past was for building an embedded target, but I abandoned its use and used Aboriginal Linux instead.

BTW, subsequent to my 'warning' above I noticed the following:

I'd run 'crossdev --help' and besides all the 'cross---help/binutils' (etc) added to package.keywords, package.accept_keywords, package.use, etc, the following was dumped into a (layman sync'ed) overlay.

Code:
# print -rl /var/pkg/mv/cross---help/
/var/pkg/mv/cross---help/binutils
/var/pkg/mv/cross---help/gcc
/var/pkg/mv/cross---help/gdb
/var/pkg/mv/cross---help/linux-headers
# cat /var/pkg/mv/profiles/categories
cross---help

That's the result of 'parse_repo_config()' ...

best ... khay
Back to top
View user's profile Send private message
alucowie
n00b
n00b


Joined: 23 Apr 2010
Posts: 4
Location: France

PostPosted: Sun Feb 01, 2015 5:23 pm    Post subject: Reply with quote

Hi,

Same problem here.
I'm reading the embedded guide: https://www.gentoo.org/proj/en/base/embedded/handbook/index.xml?part=1&chap=3#doc_chap2
and I'm trying to update my embedded filesystem in two steps.

First one: cross-emerge my packages directly in the SYSROOT or /usr/armv6j-hardfloat-linux-gnueabi with: armv6j-hardfloat-linux-gnueabi-emerge --buildpkg vim

Second step: install the binary package on the embedded filesystem with: armv6j-hardfloat-linux-gnueabi-emerge --root /data/raspi_root/ vim

I'm not sure if it works but I'm trying this way for now.
Back to top
View user's profile Send private message
alucowie
n00b
n00b


Joined: 23 Apr 2010
Posts: 4
Location: France

PostPosted: Mon Feb 02, 2015 11:11 pm    Post subject: Reply with quote

alucowie wrote:
I'm not sure if it works but I'm trying this way for now.


Sadly it doesn't. As the last post of this thread puts it: https://forums.gentoo.org/viewtopic-p-7413088.html
I'm afraid the qemu cross-compile method in the Gentoo Embedded Handbook is not an option for some packages.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things 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