Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[NOOB] installing Gentoo on a Raspberry Pi 2 SD+Stick
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
cybersmurf
n00b
n00b


Joined: 23 Sep 2015
Posts: 5

PostPosted: Wed Sep 23, 2015 1:39 pm    Post subject: [NOOB] installing Gentoo on a Raspberry Pi 2 SD+Stick Reply with quote

This probably has been asked a few times, but I have some additional questions.

I want to install Gentoo on my RasPi2. But I want to use both the microSD card AND an USB-thumbdrive.
I'm not sure whether to only put the /home folder to the USB drive, or whether I should add other folders/partitions. Should I encrypt the whole flash drive, or just the individual home folders at user level (probably better if there's more than just /home)? I want to be able to access the data in my home directory from other distributions, if necessary, but I don't want to leave it unencrypted (as it still is a USB drive. Any recommendations or ideas?


I've never used or installed Gentoo before, so I'm not familiar with the procedures. I am aware of Gentoo compiling packages at installation, which makes it more desirable for systems like the Raspberries. Given the specs, I'd rather go for low memory consumption than speed (if it's any difference for optimisation). Any experiences or recommendations from your side?

To me, this is a baptism by fire to a certain extent, so please be patient with me.

I know there's a NOOBS image, but if I go for Gentoo, I want it to be completely under my control.

I am thankful for pointing me in the right directions, and instructions can be a bit techy (I'm not completely inexperienced with Linux though).

Thank you in advance!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Wed Sep 23, 2015 7:07 pm    Post subject: Reply with quote

cybersmurf,

Welcome to Gentoo.

A RasPi, even a 2, is not a good place to start with Gentoo. Its still slow to build and rebuild things when you change configurations.
Hardly anyone builds Gentoo natively on ARM, unless they really really have to.

Get to grips with Gentoo on some more mainstream platform. Use virtualbox if you need to. Do a testing install, as that's what you will do on the Pi. This mainstream install will do two things
a) get you familiar with the Gentoo install and maintainance process
b) give you a cross distcc helper, that will do the hard work for your Pi install later.

Before you go much further, let me show you the Gentoo installer. If you have not used a source based distro before it may be a bit of a shock.
Go to the bathroom and look in the mirror. You will see the installer there.

I'm not trying to put you off Gentoo. Rather, I'm suggesting a longer less steep learning curve.
I have Gentoo on several Pi 1s. Mostly early 256Mb versions.
_________________
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
Irre
Guru
Guru


Joined: 09 Nov 2013
Posts: 340
Location: Stockholm

PostPosted: Wed Sep 23, 2015 9:32 pm    Post subject: Reply with quote

"Hardly anyone builds Gentoo natively on ARM, unless they really really have to."
I do!
Some packages take a very long time to build, but the "machine" is silent and consumes just 3W" :D

Edit: I forgot to say that I do heavy builds in background, so I need not be connected. To rebuild gcc:
Code:
nohup emerge gcc&
Back to top
View user's profile Send private message
dasPaul
Apprentice
Apprentice


Joined: 14 Feb 2012
Posts: 192
Location: Dresden

PostPosted: Thu Sep 24, 2015 6:56 am    Post subject: Reply with quote

Irre wrote:
"Hardly anyone builds Gentoo natively on ARM, unless they really really have to."
I do!

me too

But the first thing I did was to to the base install on an running raspbian, nfs-mount an "/mnt/gentoo" share on an external harddisk, once done that I booted via nfsroot to that and did everything else. On my other gentoo-client I installed crossdev/distcc and with that I was able to compile my raspi. After that I just copied everything exept "/usr/portage" to the sdcard. Portage dir is later mounted via nfs from my nas.
All this may be an overkill to an gentoo newbie. I would also recommend to do an ordinary gentoo install first to get warm with it.
Back to top
View user's profile Send private message
snkmoorthy
Guru
Guru


Joined: 19 Nov 2002
Posts: 376

PostPosted: Thu Sep 24, 2015 9:01 am    Post subject: Reply with quote

I use another x86 pc with crossdev and distcc for Raspberry compilations.
https://wiki.gentoo.org/wiki/Raspberry_Pi/Cross_building
Back to top
View user's profile Send private message
cybersmurf
n00b
n00b


Joined: 23 Sep 2015
Posts: 5

PostPosted: Thu Sep 24, 2015 2:15 pm    Post subject: Reply with quote

OK, thanks for the speed and work amount warning, although i was already expecting that.

I decided to go for the 'semi-mad' variant and set up a virtual copy of Gentoo. I guess I'll go for cross compiling for now, I might make a lot of mistakes or change a lot of stuff often.

Is it possible to use a network share as package cache? So I might be able to use that for several devices without copying?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Thu Sep 24, 2015 4:38 pm    Post subject: Reply with quote

cybersmurf,

You can put what you want on a network share. If your setwork share provides *NIX NFS, even root can be on the network.
This means that the Pi only needs /boot os the SD card. PCs support PXE booting, so nothing else is required en the PC.

Pure cross compiling is of limited use in practice. In theory, you can use the cross build chain to run an emerge @system to a completly empty target root.
In practice there are a lot of broken build systems. A few, like python and perl, by design.
_________________
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
cybersmurf
n00b
n00b


Joined: 23 Sep 2015
Posts: 5

PostPosted: Thu Sep 24, 2015 7:31 pm    Post subject: Reply with quote

NeddySeagoon wrote:
You can put what you want on a network share. If your setwork share provides *NIX NFS, even root can be on the network.
This means that the Pi only needs /boot os the SD card. PCs support PXE booting, so nothing else is required en the PC.


Well, I'd at least want the base system on the SD card, but that's good to know. Guess i didn't expect /boot to actually include network and NFS drivers. But hey, PXE is just a standardized bootloader for network.

NeddySeagoon wrote:
Pure cross compiling is of limited use in practice. In theory, you can use the cross build chain to run an emerge @system to a completly empty target root.
In practice there are a lot of broken build systems. A few, like python and perl, by design.


Well, I'm kinda confused right now. What would you cross-compile? The kernel cross compiled, and the rest native?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Thu Sep 24, 2015 8:14 pm    Post subject: Reply with quote

cybersmurf,

The kernel, glibc and the entire toolchain cross compile.
Its difficult to do a port to a new arch without at least that much building on something that's not arch.
Lots of other stuff works too.

I don't pure cross compile anything these days. I use cross distcc.
You run distcc as a helper on one or more helpers that have a cross toolchain for ARM.
distcc running on the Pi sends build jobs to the helpers, that send back .o files for the Pi to link.
This way, anything that won't cross compile fails and is rerun locally.
You can distribute the ./configure phase too.

You do need identical versions of gcc on the Pi and helpers.

/boot doesn't exactly contain network and NFS drivers. The kernel does, if you choose to include them.
The Pi loads the kernel from the SD card and then mounts root over NFS.
Unlike PXE booting, you don't get the kernel from a tftp server.
_________________
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
cybersmurf
n00b
n00b


Joined: 23 Sep 2015
Posts: 5

PostPosted: Thu Sep 24, 2015 11:14 pm    Post subject: Reply with quote

Oh, I misunderstood something. So, distcc just does only a part of the job, but the final compiling is done on the target device itself? That is a neat feature. [/i]
Back to top
View user's profile Send private message
Irre
Guru
Guru


Joined: 09 Nov 2013
Posts: 340
Location: Stockholm

PostPosted: Fri Sep 25, 2015 7:29 am    Post subject: Reply with quote

I have very bad experience with different SD-cards and Raspberry Pi. File system crashed several times. :evil: I think it is due to bad hardware quality or "gold" contacts. I see no problems when I attach the cards on Linux or Windows from a PC.

Conclusion: Place the root file system on an external USB-disk and only those files needed to boot on the SD-card. The SD-card need only the preformatted dos-partition. :idea: Swap should also be allocated only on the external USB-disk. The SD-card should only be mounted when you generate a new system:
Code:
mount /dev/mmcblk0p1 /boot
Back to top
View user's profile Send private message
cybersmurf
n00b
n00b


Joined: 23 Sep 2015
Posts: 5

PostPosted: Fri Sep 25, 2015 9:47 am    Post subject: Reply with quote

OK, so I'll just use the microSD card for /boot. i wanted to use a usb thumbdrive anyway, so i guess that's settled then. And small SD cards are cheap anyways.

Any comments on encrypting partitions? or just /home/<user> on user level? Or not at all?
Back to top
View user's profile Send private message
cwr
Veteran
Veteran


Joined: 17 Dec 2005
Posts: 1969

PostPosted: Fri Sep 25, 2015 2:41 pm    Post subject: Reply with quote

I use Gentoo on a BeagleBone Black, similar in some ways to an RPi; I started by booting
in the standard way from a microSD card, then built Gentoo using a USB thumbdrive as
the root file system. The build wrote off the thumbdrive, so I moved to loading the kernel
via TFTF and exporting the root filesystem via NFS.

A lot of packages can be built using a cross-compiler in a chroot on the (x86) system
exporting the NFS, but some (Python among them) can really only be built locally.
That takes a long time, but I just let the build run overnight. Constant updates to the
embedded software probably aren't necessary, so that's a good enough solution.

The question is which booting modes the RPi loader supports, and whether you want
the result to be stand-alone. I'd certainly develop using an NFS filesystem if you can,
and then copy the root filesystem across to eg: a thumbdrive if necessary.

Will
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Fri Sep 25, 2015 6:46 pm    Post subject: Reply with quote

cybersmurf,

distcc sends compile jobs to helpers.

The unpacking, sending jobs to helpers (for compililng), dealing with responses, linking and installing is all performed on the Pi.
In general, compiling is performed by the helpers.

@Irre, the Pi 1 is fairly challenged in the PSU department. Most SD cards above 4x embarrass the PSU if you use the phone charger PSU.
If you work around the on board 3.3v PSU limitations by powering the Pi via the P1 header, its much more SD card tolerant.
_________________
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