Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
CuBox-i: compile+install on laptop then move system on SD
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Matte88
n00b
n00b


Joined: 15 Aug 2009
Posts: 55
Location: VE-NICE

PostPosted: Sun Jul 06, 2014 9:48 pm    Post subject: CuBox-i: compile+install on laptop then move system on SD Reply with quote

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
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 9847

PostPosted: Sun Jul 06, 2014 10:18 pm    Post subject: Reply with quote

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
View user's profile Send private message
Matte88
n00b
n00b


Joined: 15 Aug 2009
Posts: 55
Location: VE-NICE

PostPosted: Mon Jul 07, 2014 9:28 pm    Post subject: Reply with quote

So... The ARM on which I'd like having Gentoo running is this the CuBox-i4Pro http://www.solid-run.com/products/cubox-i-mini-computer/cubox-i-specifications/.

Can you please tell me something about this cross-compiling and what are the "risks" of packages that couldn't be installed at all?

I read something about on internet and I also found this link: http://landley.net/aboriginal/presentation.html but I think I didn't understand cross-compiling at all... :roll:
_________________
-Complichiamo le cose per semplificarci la vita-
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 9847

PostPosted: Mon Jul 07, 2014 10:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
Matte88
n00b
n00b


Joined: 15 Aug 2009
Posts: 55
Location: VE-NICE

PostPosted: Sat Aug 20, 2016 3:43 pm    Post subject: Reply with quote

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. :wink:

For now, bye!
_________________
-Complichiamo le cose per semplificarci la vita-
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 36140
Location: 56N 3W

PostPosted: Sat Aug 20, 2016 4:44 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing 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