Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Architectures & Platforms Gentoo on ARM
  • Search

Gentoo on Raspberry Pi 2

Gentoo on all things ARM. Both 32 bit and 64 bit.
Tell about your hardware and CHOST.
Problems with crossdev targeting ARM hardware go here too.
Post Reply
  • Print view
Advanced search
62 posts
  • Previous
  • 1
  • 2
  • 3
Author
Message
Yamakuzure
Advocate
Advocate
User avatar
Posts: 2323
Joined: Wed Jun 21, 2006 11:06 am
Location: Adendorf, Germany
Contact:
Contact Yamakuzure
Website

  • Quote

Post by Yamakuzure » Fri Mar 27, 2015 12:00 pm

aahjnnot wrote:Has anyone managed to compile Firefox or Chromium for the Pi 2? I'm running KDE on mine with a surprising level of success, but Konqueror is a fairly restrictive web browser. Unfortunately, both Chromium and Firefox fail to build for me.

I've posted a question in the Portage forum but no-one has yet responded. I've since discovered this thread and it's possible that there's greater architecture expertise here than there.
From my Raspberry Pi 2, connected via SSH (I have no HDMI to DVI cable, yet):

Code: Select all

sed-rpi2 ~ # uname -a
Linux sed-rpi2 3.18.9-v7+ #5 SMP PREEMPT Mon Mar 16 10:43:45 CET 2015 armv7l BCM2709 GNU/Linux
sed-rpi2 ~ # eix -c -I "(firefox|libreoffice)"
[I] app-office/libreoffice (4.4.1.2@22.03.2015): LibreOffice, a full office productivity suite
[I] app-office/libreoffice-l10n (4.4.1.2@18.03.2015): Translations for the Libreoffice suite
[I] www-client/firefox (36.0.1@23.03.2015): Firefox Web Browser
3 Treffer.
However, firefox did *not* build out of the box!

The first problem with 36.0.1 was, that 'skia' wasn't enabled by default, so I added "enable-skia" to the general rules. This should have been fixed in 36.0.4.

The second problem was, that in mozilla-release/ff/media/libvpx the mfloat-abi was set to "softfp". hardcoded. That fails because the responding gnu stubs are missing.

I couldn't help, but I simply had a screen session with a second console open, and when emerge broke, I got the corresponding lines using:

Code: Select all

grep "mfloat-abi=softfp" /var/tmp/portage/www-client/firefox-36.0.1/temp/build.log
, copied the lines for files I didn't have compiled, yet, removed the "mfloat-abi=softfp" and then compiled by hand. A "chown portage:portage *" did the rest.

Afterwards I would just continue the build using:

Code: Select all

 $ rm /var/tmp/portage/www-client/firefox-36.0.1/temp/build.log
 $ ebuild /usr/portage/www-client/firefox/firefox-36.0.1.ebuild install
That was veeeery annoying. I had kwrite open to copy the lines into. It helped with keeping track what was done and what wasn't.
Edited 220,176 times by Yamakuzure
Top
Yamakuzure
Advocate
Advocate
User avatar
Posts: 2323
Joined: Wed Jun 21, 2006 11:06 am
Location: Adendorf, Germany
Contact:
Contact Yamakuzure
Website

  • Quote

Post by Yamakuzure » Fri Mar 27, 2015 12:31 pm

UncleVan wrote:
garlicbread wrote:For anyone else building a kernel on the rpi2
the trick is to not use imagetool-uncompressed.py, it was originally a requirement for older bootloaders for the rpi, but for newer bootloaders it's no longer needed. With Noobs it actually stops the kernel from running
...
Yes, I can confirm this. Also, I don't configure with bcmXXX_defconfig. Instead, take the original Raspbian config "/proc/config.gz" and "make oldconfig" over it in the git sources - garanteed to succeed ;-)
Or use the bcm2709_defconfig and then configure the kernel with menuconfig. You can drop a lot of stuff and it is a good idea to enable SMP, so more than just one core gets utilized. Add ZRAM and install zram-init from mv overlay. Then add four swap devices (one for each core). I did not have any problems compiling and installing both qtwebkits, which means something on a 1GB machine. ;-)

my config with zram:

Code: Select all

 ~ # grep -P "^[^#]" /etc/conf.d/zram-init 
load_on_start="yes"
unload_on_stop="yes"
num_devices="4"
type0="swap"
size0="384"
maxs0="1"
algo0="lz4"
flag0=""
type1="swap"
size1="374"
maxs1="1"
algo1="lz4"
flag1=""
type2="swap"
size2="384"
maxs2="1"
algo2="lz4"
flag2=""
type3="swap"
size3="384"
maxs3="1"
algo3="lz4"
flag3=""
 ~ # grep swap /etc/fstab
/dev/mmcblk0p2  none   swap  sw             0 0
/dev/zram0      none   swap  sw,pri=16383,nofail 0 0
/dev/zram1      none   swap  sw,pri=16383,nofail 0 0
/dev/zram2      none   swap  sw,pri=16383,nofail 0 0
/dev/zram3      none   swap  sw,pri=16383,nofail 0 0
 ~ # cat /proc/swaps
Filename                                Type            Size    Used    Priority
/dev/mmcblk0p2                          partition       1582100 0       -1
/dev/zram0                              partition       393212  2080    16383
/dev/zram1                              partition       382972  2088    16383
/dev/zram2                              partition       393212  2068    16383
/dev/zram3                              partition       393212  2076    16383
using squash_mount from mv overlay for /usr/portage, /var/db and /var/lib/layman seemed to speed things up a bit. (I am using lzo compression.) And ccache helped a lot of course.
Edited 220,176 times by Yamakuzure
Top
atemv
n00b
n00b
Posts: 63
Joined: Sat Aug 09, 2014 4:14 pm

  • Quote

Post by atemv » Sat Mar 28, 2015 3:26 am

A bit more secure way to cross compile is to use the toolchain binaries provided by the Raspberry Pi developers. For me it works well, however I only have an rpi1 with a Raspbian target OS
You can get it with:

Code: Select all

git clone https://github.com/raspberrypi/tools
and add it to your $PATH variable

on 32 bit host system
export PATH=${PATH}:tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin

on 64 bit host system
export PATH=${PATH}:tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin
Top
Yamakuzure
Advocate
Advocate
User avatar
Posts: 2323
Joined: Wed Jun 21, 2006 11:06 am
Location: Adendorf, Germany
Contact:
Contact Yamakuzure
Website

  • Quote

Post by Yamakuzure » Mon Mar 30, 2015 10:18 am

atemv wrote:A bit more secure way to cross compile is to use the toolchain binaries provided by the Raspberry Pi developers.
That wouldn't work with gentoo on the RP2 with using distcc, would it?
Edited 220,176 times by Yamakuzure
Top
BillyD
Guru
Guru
User avatar
Posts: 323
Joined: Sun May 05, 2002 2:46 pm
Location: Australia

  • Quote

Post by BillyD » Sat Jun 13, 2015 9:52 pm

el_Salmon wrote:Does anyone could prepare a minimal Gentoo image for Raspberry Pi 2? I cannot use my keyboard with the Raspbian kernel (but it works fine with Raspbian or Ubuntu).
I was having this problem as well, but copying the modules directory in it's entirety to /lib solved this. For anyone that is a little confused (as I was) you need to copy firmware/modules from the git repository into /lib on your sd card. So you'll end up with a /lib/modules directory on the SD card.
We used to have hominid cousins that were vegetarian. The palæontological record suggests that our ancestors killed them and ate them.
Top
Yamakuzure
Advocate
Advocate
User avatar
Posts: 2323
Joined: Wed Jun 21, 2006 11:06 am
Location: Adendorf, Germany
Contact:
Contact Yamakuzure
Website

  • Quote

Post by Yamakuzure » Mon Jun 15, 2015 8:00 am

BillyD wrote:
el_Salmon wrote:Does anyone could prepare a minimal Gentoo image for Raspberry Pi 2? I cannot use my keyboard with the Raspbian kernel (but it works fine with Raspbian or Ubuntu).
I was having this problem as well, but copying the modules directory in it's entirety to /lib solved this. For anyone that is a little confused (as I was) you need to copy firmware/modules from the git repository into /lib on your sd card. So you'll end up with a /lib/modules directory on the SD card.
I never tried the raspian kernel, as it is still for the RPi 1, right?

However, compiling from the official sources works well.

See here:

Code: Select all

sed-rpi2 linux # git remote -v
origin  https://github.com/raspberrypi/linux (fetch)
origin  https://github.com/raspberrypi/linux (push)

sed-rpi2 linux # git branch
* rpi-3.18.y

sed-rpi2 linux # uname -a
Linux sed-rpi2 3.18.10-v7+ #1 SMP PREEMPT Fri Mar 27 12:19:53 CET 2015 armv7l BCM2709 GNU/Linux
Note to self, I should upgrade.

However, ccache + distccd + zram work quite nice:

Code: Select all

sed-rpi2 ~ # eix -c -I "(libreoffice|firefox)"
[I] app-office/libreoffice (4.4.3.2@12.06.2015): LibreOffice, a full office productivity suite
[I] app-office/libreoffice-l10n (4.4.3.2@10.06.2015): Translations for the Libreoffice suite
[U] www-client/firefox (36.0.1@23.03.2015 -> (~)38.0.1^d): Firefox Web Browser
3 Treffer.
Oh? I need to update firefox.

I'll time the update and will edit this post so you can see how long emerging firefox on a Raspberry PI 2 with distcc enabled takes.

Edit: Here is the result of emerging firefox on my Raspberry PI 2:

Code: Select all

sed-rpi2 ~ # time emerge firefox                  

These are the packages that would be merged, in order:

Calculating dependencies  ....... .. . ... done!
[ebuild  N    ~] media-libs/libvpx-1.4.0:0/2::gentoo  USE="(-altivec) -doc postproc -static-libs {-test} threads" 0 KiB
[ebuild   R    ] dev-db/sqlite-3.8.10.1:3::gentoo  USE="-debug -doc -icu readline secure-delete* -static-libs -tcl {-test} -tools" 0 KiB
[ebuild     U ~] dev-libs/nss-3.19.1::gentoo [3.17.4::gentoo] USE="cacert nss-pem -utils" 0 KiB
[ebuild     U ~] www-client/firefox-38.0.1::gentoo [36.0.1::gentoo] USE="-bindist* -custom-cflags -custom-optimization dbus -debug gmp-autoupdate -gstreamer (-hardened) jemalloc3%* jit minimal (-pgo) -pulseaudio (-selinux) startup-notification system-cairo* system-icu* system-jpeg* system-libvpx* system-sqlite* {-test} -wifi" LINGUAS="-af -ar -as -ast -be -bg -bn_BD -bn_IN -br -bs -ca -cs -cy -da de -el en_GB -en_ZA -eo -es_AR -es_CL -es_ES -es_MX -et -eu -fa -fi -fr -fy_NL -ga_IE -gd -gl -gu_IN -he -hi_IN -hr -hu -hy_AM -id -is -it -ja -kk -km -kn -ko -lt -lv -mai -mk -ml -mr -nb_NO -nl -nn_NO -or -pa_IN -pl -pt_BR -pt_PT -rm -ro -ru -si -sk -sl -son -sq -sr -sv_SE -ta -te -th -tr -uk -vi -xh -zh_CN -zh_TW" 0 KiB

Total: 4 packages (2 upgrades, 1 new, 1 reinstall), Size of downloads: 0 KiB

>>> Verifying ebuild manifests
>>> Running pre-merge checks for www-client/firefox-38.0.1
 * Checking for at least 4 GiB disk space at "/var/tmp/portage/www-client/firefox-38.0.1/temp" ...                                   [ ok ]
>>> Emerging (1 of 4) media-libs/libvpx-1.4.0::gentoo
>>> Emerging (2 of 4) dev-db/sqlite-3.8.10.1::gentoo
>>> Installing (1 of 4) media-libs/libvpx-1.4.0::gentoo
>>> Installing (2 of 4) dev-db/sqlite-3.8.10.1::gentoo
>>> Emerging (3 of 4) dev-libs/nss-3.19.1::gentoo
>>> Installing (3 of 4) dev-libs/nss-3.19.1::gentoo
>>> Emerging (4 of 4) www-client/firefox-38.0.1::gentoo
>>> Installing (4 of 4) www-client/firefox-38.0.1::gentoo
>>> Recording www-client/firefox in "world" favorites file...
>>> Jobs: 4 of 4 complete                           Load avg: 1.91, 1.98, 2.73

 * Messages for package www-client/firefox-38.0.1:

 * You are enabling official branding. You may not redistribute this build
 * to any users on your network or the internet. Doing so puts yourself into
 * a legal problem with Mozilla Foundation
 * You can disable it by emerging firefox _with_ the bindist USE-flag
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date.

real    146m59.465s
user    206m40.530s
sys     33m3.170s
Edited 220,176 times by Yamakuzure
Top
el_Salmon
Guru
Guru
User avatar
Posts: 339
Joined: Mon Dec 15, 2003 10:49 pm
Location: Around 2.4GHz
Contact:
Contact el_Salmon
Website

  • Quote

Post by el_Salmon » Mon Jun 22, 2015 7:06 pm

garlicbread wrote:I've managed to get some distance installing gentoo onto the rpi2 using a usb harddisk and a raspian sd card without qemu or cross compiling
https://github.com/grbd/GBD.Rpi2.Gentoo
Finally I've installed Gentoo following that guide. I will keep the Raspbian kernel. Thank's to the author.
Linux Proud User: HP Pavilion 15-an002ns laptop (KDE Neon), Xiaomi Mi Air 12 (KDE Neon), Raspberry Pi 3 (Nextcloudpi), Docooler MS9 Pro (LibreElec)
Top
cyrius
n00b
n00b
Posts: 70
Joined: Sat Jan 27, 2007 11:58 am
Location: France

  • Quote

Post by cyrius » Wed Jul 22, 2015 10:09 am

I've managed to install gentoo on raspberry pi 2. This thread was very useful. Cross building via distcc is very useful until no python or perl test was used in ebuild. The core part is done.
The /var directory is linked to an aoe device.

Thanks to this thread : http://community.arm.com/groups/tools/b ... mand-lines , i've added -ffast-math in CFLAGS to use full functionnality of neon-vpf4 gcc's flag.

I'm looking now for a sweet windows manager. After looking for on the web, i've decided to use LXDE which seems to be an adequate compromise.
For the video optimisation part, i've found thoses links :

http://dri.freedesktop.org/wiki/VC4/

It's seems that a special driver is maintained for the raspberry kernel. This is experimental but functionnal.
The modified raspberry's kernel git link is also provided in this url.

Does someone already tried it ?

My next step will be to do an initramfs to full migrate the system on an aoe device to avoid the sd card usage.
My goal is to use rdesktop-vrdp (which i'll compile from source on arm) from Virtual box project to run virtual rich environnement on raspberry.
Does someone also tried this approach ?
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56077
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Tue Mar 01, 2016 7:26 pm

For Pi 3 see [topic=1039888]Gentoo on Raspberry Pi 3[/topic]

I suspect we will need a 32/64 bit split for Raspberry Pi 3 but at the time of writing, there is no 64 bit port for it.[/topic]
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
EvadingGrid
n00b
n00b
Posts: 13
Joined: Thu Apr 04, 2013 2:59 pm
Contact:
Contact EvadingGrid
Website

  • Quote

Post by EvadingGrid » Wed Apr 06, 2016 12:51 pm

cyrius wrote:I've managed to install gentoo on raspberry pi 2. This thread was very useful. Cross building via distcc is very useful until no python or perl test was used in ebuild. The core part is done.
The /var directory is linked to an aoe device.

Thanks to this thread : http://community.arm.com/groups/tools/b ... mand-lines , i've added -ffast-math in CFLAGS to use full functionnality of neon-vpf4 gcc's flag.

I'm looking now for a sweet windows manager. After looking for on the web, i've decided to use LXDE which seems to be an adequate compromise.
For the video optimisation part, i've found thoses links :

http://dri.freedesktop.org/wiki/VC4/

It's seems that a special driver is maintained for the raspberry kernel. This is experimental but functionnal.
The modified raspberry's kernel git link is also provided in this url.

Does someone already tried it ?

My next step will be to do an initramfs to full migrate the system on an aoe device to avoid the sd card usage.
My goal is to use rdesktop-vrdp (which i'll compile from source on arm) from Virtual box project to run virtual rich environnement on raspberry.
Does someone also tried this approach ?
Yes, to get NEON functional -ffast-math is needed.

I should warn that although I have it enabled by default, it will break some things like dev-db/sqlite
Its easy enough to do a quick edit, and run it through again.
Top
kolcon
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 96
Joined: Fri Sep 21, 2007 6:48 pm
Location: Europe, CZ

  • Quote

Post by kolcon » Sun Apr 17, 2016 10:00 am

anybody care to post working minimal sd card image for pi 2/3 ?
Top
EvadingGrid
n00b
n00b
Posts: 13
Joined: Thu Apr 04, 2013 2:59 pm
Contact:
Contact EvadingGrid
Website

  • Quote

Post by EvadingGrid » Mon Apr 18, 2016 10:12 am

kolcon wrote:anybody care to post working minimal sd card image for pi 2/3 ?
IMHO - use a USB Hardrive and leave Raspbian + NOOBS on the SD Card.

You get Raspbian as the ultimate rescue disk.
You can re-use the Raspbian Kernel + Modules.

See Here : Stage-3 for Raspberry 2/3 ( stage3-armv7a_neonvfpv4_hardfp-2016mmdd.tar.bz2 )
http://www.ukginger.net/Gentoo2/index.html


IF you have not got a USB Drive, then you are going to burn holes in your SD Card real quick...
Compiling will kick in the SWAP file, as 1 GB of RAM is not enough, even if you only allocate the min 16 Gb RAM for Video.
Top
Post Reply
  • Print view

62 posts
  • Previous
  • 1
  • 2
  • 3

Return to “Gentoo on ARM”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy