View previous topic :: View next topic |
Author |
Message |
Matte88 n00b
Joined: 15 Aug 2009 Posts: 55 Location: VE-NICE
|
Posted: Sun Jul 06, 2014 9:48 pm Post subject: CuBox-i: compile+install on laptop then move system on SD |
|
|
Hi all!
I just received from SoliRun a CuBox-i4Pro and I found this wiki entry: http://wiki.gentoo.org/wiki/Cubox-i
Is there a way to install Gentoo on laptop's hdd, compiling locally in my laptop (Intel 2nd gen i3) using the power of its CPU and then simply move the whole installed system on the SD card and then boot the Cubox?
Asking this because:
a) I want to speed up the whole process using the much powered CPU of my laptop instead of the CuBOX CPU;
b) read/write operations on SD card reduced at minimum
Thanks! _________________ -Complichiamo le cose per semplificarci la vita- |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21602
|
Posted: Sun Jul 06, 2014 10:18 pm Post subject: |
|
|
If the CuBox had a compatible CPU, this would be as easy as installing a chroot. Since it does not, you will need to cross-compile all the relevant packages and install them into a separate area on the host. Some packages do not cross-compile easily or at all. |
|
Back to top |
|
|
Matte88 n00b
Joined: 15 Aug 2009 Posts: 55 Location: VE-NICE
|
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21602
|
Posted: Mon Jul 07, 2014 10:51 pm Post subject: |
|
|
Some packages have badly designed build systems that assume they can use the same compiler both to build the code to be installed and to build helpers that are run during the build. Such systems fail when cross-compiling because the code to be installed and the code to run during the build require different CPU architectures. Generally, if the cross-compile build completes successfully, then the resulting code should run correctly. |
|
Back to top |
|
|
Matte88 n00b
Joined: 15 Aug 2009 Posts: 55 Location: VE-NICE
|
Posted: Sat Aug 20, 2016 3:43 pm Post subject: |
|
|
Just a little update of my working in progress now (on my host, I set "~amd64" globally).
W A R N I N G: the post DOESN'T give you instructions to get the work done; I'm working on it.
So, one could start from the wiki: https://wiki.gentoo.org/wiki/Cubox-i.
Knowing the fact I'm a total n00b, I'll write here some steps that I discovered they are needed (but not written in the wiki).
https://wiki.gentoo.org/wiki/Cubox-i#Installing_Crossdev:
Code: | 100. # emerge crossdev =gcc-4.8.5
101. folllow https://wiki.gentoo.org/wiki/Overlay/Local_overlay#Crossdev.
### I found theese steps are needed because I (presume) don't have layman installed and no overlay set. Also theese steps are needed because is not an automatism bring by the installation of sys-devel/crossdev.
102. # crossdev -v -t armv7a-hardfloat-linux-gnueabi --g 4.8.5
### you need to use and set GCC at its 4th version, because "make u-boot-imx6" works with GCC up to 4.
|
Now read https://wiki.gentoo.org/wiki/Cubox-i#Warning:_SolidRun.27s_u-boot_currently_broken_for_some_models; you need to perform steps this way:
Code: | 200. $ export ARCH=arm
201. $ export CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi-
202. $ git clone https://github.com/SolidRun/u-boot-imx6.git
203. $ cd u-boot-imx6
204. $ git checkout
205. $ make mx6_cubox-i_config
206. $ make
|
Code: | 300. # dd if=SPL of=/dev/mmcblk0 bs=1K seek=1
301. # dd if=u-boot.img of=/dev/mmcblk0 bs=1K seek=42
|
... More steps as soon as I can.
For now, bye! _________________ -Complichiamo le cose per semplificarci la vita- |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54216 Location: 56N 3W
|
Posted: Sat Aug 20, 2016 4:44 pm Post subject: |
|
|
Matte88,
Pure cross compiling is fairly broken. Hu has told you why.
When you ran crossdev to generate your cross toolchain you got a free /usr/<target> which is an empty gentoo root directory for four target.
In theory you can run emerge-wrapper, set make.conf in /usr/<target> then cross compile whatever you want into /usr/<target>.
Eventually you write /usr/<target> to / on your SD card and everything justworks.
Messing about with assorted Raspberry Pis, I've found that the path of least resistance is cross distcc.
This is where your arm board does some of the building but much of the hard work is done by a more powerful system.
There is another usually slower alternative. QEMU can emulate your arm CPU.
On your laptop, you put the arm stage3 into /usr/<target> (don't mess that up). Now you can chroot into /usr/<target> (where the arm code is) and QEMU will emulate your arm CPU in software and execute the arm code ... on your AMD/Intel laptop.
The drawback is that software emulation of a CPU is slow.
I've glossed over that a little but its documented on the wiki. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
|