Abra
Newbie
Karma: 1
Posts: 29
|
 |
« on: February 09, 2010, 06:52:39 PM » |
|
Hello, I read Gentoo's documentation about crosscompiling with crossdev, and if what I read is true, I'm impressed! According to this doc, it is really easy to build a toolchain. Although I do not own a Plug yet, I'm going to install Gentoo on my (x86_64) box tomorrow, just to try it (and to use my i7: make -j8 sounds good  ). From what I understood, it seems feasible to build an entire system for the sheevaplug (or any arch) in a separate tree on the main box, in order to get a snapshot (keeping only the binaries) of a complete, working distro. It seems awsome! Could anyone confirm that could work? In any (well, not if you all tell me I'm dreaming), I'm going to try it and test with qemu to see how it goes.
|
|
|
|
|
Logged
|
|
|
|
|
|
|
 |
« Reply #1 on: February 09, 2010, 08:05:17 PM » |
|
I use Gentoo build a system its very simple. if you familiar with Linux From Scratch then you are good to go. Gentoo just a scripted version. However if you have not use any source based distro before then it could be little confusion. Gentoo is one a few that have better documented distro so follow the document they are very good. For help use the Gentoo Forums you can get a lots help. People in the forum usually very friendly.
Good Luck.
|
|
|
|
|
Logged
|
Good Luck 
|
|
|
|
Abra
Newbie
Karma: 1
Posts: 29
|
 |
« Reply #2 on: February 10, 2010, 09:55:27 AM » |
|
I'm familiar with Gentoo (used it for a year on my laptop, but now it has fan/heat problems, so I avoid computations  ), so I hope I will be able to get a complete system for the sheevaplug in less than a week (full-time), I hope I'm not too optimistic! One thing I do not fully understand though (it's not in the gentoo embedded doc AFAIK), is what do you get exactly at the end of cross-compiling? You still have to download (or write?) init scripts and so on, right? Or decompressing a stage3 gives you need? But then it's not necessarily compatible with what you have compiled?
|
|
|
|
|
Logged
|
|
|
|
|
|
|
 |
« Reply #3 on: February 10, 2010, 10:28:28 AM » |
|
crossdev give you the compile-tool-chain you need to further build your target system. it does not give you anything else. you still need to create target installation area in order to get a complete system. I suggest you get the stage3 for arm from daily build. install it on plug. then build distcc on both plug and where you install crossdev this way you can emerge on plug but use CPU on your distcc server machine. see hereIf everything going OK yup one week may do it  it took me more then few month to get it the way I want it to be.  Good luck
|
|
|
|
|
Logged
|
Good Luck 
|
|
|
|
Abra
Newbie
Karma: 1
Posts: 29
|
 |
« Reply #4 on: February 15, 2010, 04:15:30 PM » |
|
I installed crossdev and built the toolchain for the sheevaplug (I should have one in a week or so). I would prefer to compile everything on the desktop, rather than use distcc. I would also be interested in installing the minimum (for no particular reason, ie for fun and to prove to myself it is possible). Should I take a stage3 and remove unnecessary files (roughly, keeping dev, var and etc) and compile all the binaries on the desktop? This way I could get a (tiny) tar-able system  Thanks for your insight!
|
|
|
|
|
Logged
|
|
|
|
|
|
|
 |
« Reply #5 on: February 15, 2010, 04:27:52 PM » |
|
I installed crossdev and built the toolchain for the sheevaplug (I should have one in a week or so). I would prefer to compile everything on the desktop, rather than use distcc. I would also be interested in installing the minimum (for no particular reason, ie for fun and to prove to myself it is possible). Should I take a stage3 and remove unnecessary files (roughly, keeping dev, var and etc) and compile all the binaries on the desktop? This way I could get a (tiny) tar-able system  Thanks for your insight! Your idea was my orignal design goal too  but later I realize the effort is not worth it. Instead try to remove stuff, I use ROOT=/target emerge ..., I install only baselayout, busybox and setup a different profile, this is a lot of try and error at end you can make out of something but it take times, plus portage change all the times you need to chase the changes. however I must admit it is a lots of fun and you learn a lot. The reason I suggest using plug to compile is because some for ebuild will want to use intermediate step generated tool to continue, if you do it from your desktop this will always fail since the binary is not native to your desktop. you will need to modify your ebuild to make it work. again a lots of fun. Good luck 
|
|
|
|
|
Logged
|
Good Luck 
|
|
|
|
Abra
Newbie
Karma: 1
Posts: 29
|
 |
« Reply #6 on: February 16, 2010, 08:17:30 AM » |
|
I'm gonna try until I get bored then  I got one problem though: there is no more crossdev-wrappers in portage (it is one of the steps in the embedded handbook), so I'm not sure what to do to cross-compile to /usr/armv5tel-softfloat-linux-gnueabi Several env variables change the behaviour of emerge -p (ROOT, SYSROOT...), I'm a bit confused. You wrote you used ROOT="..." emerge pkg, but for me it uses the amd64 gcc. Thanks again
|
|
|
|
|
Logged
|
|
|
|
|
|
|
 |
« Reply #7 on: February 16, 2010, 09:21:15 AM » |
|
It looks like they merged crossdev and crossdev-wrapper, you need emerge >=crossdev-20091209. Once you got crossdev-wrapper functional then you can use emerge-armv5tel-softfloat-linux-gnueabi --root=/target pkg to build. using ROOT=/target ... is an old trick before the emerge support --root=... option. You definitely don't want to mess around SYSROOT gcc toolchain is very sensitive to it. change it is like change CHOST in /etc/make.conf you will have to google around to find all the implication of change SYSROOT. You may want to consider change PORTAGE_CONFIGROOT or emerge --config-root=. this help you setup your own profile for your plug environment. And also turn on FEATURES=... buildpkg and set PKGDIR=/path/to/arm_binary this will save you a lot of time should you try to rebuild your target environment. Good luck 
|
|
|
|
|
Logged
|
Good Luck 
|
|
|
|
Abra
Newbie
Karma: 1
Posts: 29
|
 |
« Reply #8 on: February 16, 2010, 11:04:51 AM » |
|
Thank you, it works! I missed that one... I emerged lighttpd to test, had no problem. config-root does not seem to change anything, seems to be already done by the wrapper. Funnily, the use flags are not shown when I emerge -p, but it's no big deal since emerge -pv does the trick. Btw, why did you use busybox and not the gnu tools? Is it hard to make everything fit in 512M for example?
|
|
|
|
|
Logged
|
|
|
|
|
|
|
 |
« Reply #9 on: February 16, 2010, 12:16:41 PM » |
|
If you are using emerge-armv5tel-softfloat-linux-gnueabi then the PORTAGE_CONFIGROOT is in /usr/armv5tel-softfloat-linux-gnueabi/etc but the config-root can still overwrite it. Having different config-root is a way to create different profiles much like /usr/portage/profiles.
As for buxybox my original goal was to make a appliance system. I only want to install stuff I need to use. And yes I want to create a smallest system possible so it can be fast to transfer and can run with in RAM. Also this is very handy when you build initramfs. I have build my initramfs to be smart on finding root file system for example.
|
|
|
|
|
Logged
|
Good Luck 
|
|
|
|
Abra
Newbie
Karma: 1
Posts: 29
|
 |
« Reply #10 on: February 19, 2010, 10:59:38 AM » |
|
I tried some cross-compiling with portage, and in general it works great, it's amazing! However, some packages are (according to what I found on google) impossible to cross-compile (libperl and perl, for example), due to custom config scripts (I realized the autotools are nice after all). Too bad! I finally ordered an esata plug! I think I'll try with distcc first, as you suggested. I'll see later for more custom installs. The kernel is built, I'm gonna install a stage3 on a usb stick tonight, but it's hard to wait for the actual plug 
|
|
|
|
|
Logged
|
|
|
|
|
|
|
|
|
|