Forums

Skip to content

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

Installing Gentoo on an RPi4b

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
18 posts • Page 1 of 1
Author
Message
waluigi22
n00b
n00b
Posts: 4
Joined: Sun Dec 13, 2020 9:05 pm

Installing Gentoo on an RPi4b

  • Quote

Post by waluigi22 » Sun Dec 13, 2020 10:01 pm

Hi! I wanted to install Gentoo on an RPi4b with 4GB Ram after about 2 weeks of installing it on my PC with an amd64 cpu. I am ssh'ing into the RPi, which kind of worries me about the installation part too. It might be worth mentioning that i have ltoizer overlay with layman too. I am following the instructions in here and here:

https://wiki.gentoo.org/wiki/Raspberry_ ... l#Overview

https://wiki.gentoo.org/wiki/Raspberry_ ... n_overview

Going with the guide for an rpi3 so far, and switching to the guide for an rpi4 when necessary (compiling the kernel). Now, I never used an rpi so this is a bit of a trouble for me. These are the steps I followed so far if it helps:
1.Get crossdev on my PC with

Code: Select all

emerge --ask sys-devel/crossdev
2.

Code: Select all

crossdev -t aarch64-unknown-linux-gnu
3. Fetch the firmware for RPi using

Code: Select all

git clone -b stable --depth=1 https://github.com/raspberrypi/firmware
in a directory called raspberrypi so everything needed for the installation will be there with nothing unrelated.
4. Stay in the raspberry directory and

Code: Select all

git clone https://github.com/raspberrypi/linux
get the kernel for raspberry pi.
5. cd linux
6. This might be worth mentioning, as I am not that experienced with git either. I did

Code: Select all

git checkout rpi-4.14.y 
accidentally, not checking the github to see it is.. 5.4.y? I aborted someway through with ctrl+c and ran

Code: Select all

git checkout rpi-5.4.y
instead.
7. I got over to the guide for rpi4 on this one to "cross-compile" the kernel. I used

Code: Select all

ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- make bcm2711_defconfig
to try and compile it. it gave me this error:

Code: Select all

make[1]: *** No rule to make target 'scripts/kconfig/lexer.lex.c', needed by 'scripts/kconfig/lexer.lex.o'.  Stop.
make: *** [Makefile:520: bcm2711_defconfig] Error 2
I then tried to use this from the rpi3 guide:

Code: Select all

ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- make bcmrpi3_defconfig
Which just gave me pretty much the same thing I guess:

Code: Select all

make[1]: *** No rule to make target 'scripts/kconfig/lexer.lex.c', needed by 'scripts/kconfig/lexer.lex.o'.  Stop.
make: *** [Makefile:520: bcmrpi3_defconfig] Error 2
I have tried to get into kernel configuration with

Code: Select all

ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- make menuconfig
but that gave me this error:

Code: Select all

make[1]: *** No rule to make target 'scripts/kconfig/mconf-cfg', needed by 'scripts/kconfig/mconf.o'.  Stop.
make: *** [Makefile:520: menuconfig] Error 2
So I can't customize the kernel, I can't compile the kernel whatsoever. I am stuck here. What should I do? My install for my PC went smoothly after following the handbook, so I really don't know how to troubleshoot this.. I will admit, I am inexperienced. Sorry if this post looks weird, I never went onto any forums before, tried my best to make it look readable...

Note: All of this was done on my PC, which has an amd64 CPU.
Last edited by waluigi22 on Sun Dec 13, 2020 11:39 pm, edited 2 times in total.
WAAHLUIGI
Top
flysideways
Guru
Guru
Posts: 527
Joined: Sat Jan 29, 2005 1:06 pm

  • Quote

Post by flysideways » Sun Dec 13, 2020 11:03 pm

I have spent some time recently attempting to sort through and make sense of the available instructions on how to get Gentoo from source onto a Pi 4. I don't have enough bread crumbs to keep track of where I've been, plus I've been back over the same way a few times. 8)

I have both an arm64 and an ~arm64 keyworded Pi 4 up and running with xfce and lightdm. They are each presently natively building Firefox and its dependencies. It is way cool to have two 2560x1440 monitors for too much stuff to open.

I only set up the crossdev tool chain fully once. You don't mention this step, which I had to accomplish for it to work.

Also, your step 2 will get you an ~arm64 toolchain. There is an -S option for the stable tool chain. I intended a stable build but got the testing by blindly following the instructions you did. I did later build a stable tool chain too.

Cheers
Top
waluigi22
n00b
n00b
Posts: 4
Joined: Sun Dec 13, 2020 9:05 pm

  • Quote

Post by waluigi22 » Mon Dec 14, 2020 5:26 am

flysideways wrote: I only set up the crossdev tool chain fully once. You don't mention this step, which I had to accomplish for it to work.

Also, your step 2 will get you an ~arm64 toolchain. There is an -S option for the stable tool chain. I intended a stable build but got the testing by blindly following the instructions you did. I did later build a stable tool chain too.

Cheers
Hi flysideways! The instructions on https://wiki.gentoo.org/wiki/Custom_ebu ... y#Crossdev confused me alot. Could you help me out a little please?
1. Do I need to specify something for --ov-output (-oO), and if so, what do I give it?(sort of solved)
2.
If the main Portage tree is synchronized by using Git, or any other method with Manifest files that do not include checksums for ebuilds, prevent "masked by: corruption" errors with:
How would I know if it is synchronized using Git? I am kinda new to Gentoo...(unsolved)
And is this step necessary or just special for being synchronized with Git?
Then instruct Portage and crossdev to use this overlay:
FILE /etc/portage/repos.conf/crossdev.conf

[crossdev]
location = /var/db/repos/localrepo-crossdev
priority = 10
masters = gentoo
auto-sync = no
It might be also worth mentioning that I have layman, with mv and ltoizer overlays. I saw crossdev go about something on ltoizer when making the cross toolchain. It was this I believe(copy pasted after applying the first four commands from https://wiki.gentoo.org/wiki/Custom_ebu ... y#Crossdev, as they've been shown, without any changes):

Code: Select all

 * CROSSDEV_OVERLAY:      /var/lib/layman/lto-overlay
.
.
.
.
 * leaving sys-devel/binutils in /var/lib/layman/lto-overlay
 * leaving sys-devel/gcc in /var/lib/layman/lto-overlay
 * leaving sys-kernel/linux-headers in /var/lib/layman/lto-overlay
 * leaving sys-libs/glibc in /var/lib/layman/lto-overlay
 * leaving sys-devel/gdb in /var/lib/layman/lto-overlay
 * leaving metadata/layout.conf alone in /var/lib/layman/lto-overlay
What do I do about this one? Is it not bothering with lto-overlay or is it trying to apply it..?

Edit: This is what I got after disabling and deleting the layman overlays:

Code: Select all

LPKG=glibc
LVER=[latest]
"/etc/portage/make.conf", line 7: make.conf.lto: No such file or directory
"/etc/portage/make.conf", line 7: make.conf.lto: No such file or directory
"/etc/portage/make.conf", line 7: make.conf.lto: No such file or directory
"/etc/portage/make.conf", line 7: make.conf.lto: No such file or directory
"/etc/portage/make.conf", line 7: make.conf.lto: No such file or directory
"/etc/portage/make.conf", line 7: make.conf.lto: No such file or directory
"/etc/portage/make.conf", line 7: make.conf.lto: No such file or directory
"/etc/portage/make.conf", line 7: make.conf.lto: No such file or directory
"/etc/portage/make.conf", line 7: make.conf.lto: No such file or directory
"/etc/portage/make.conf", line 7: make.conf.lto: No such file or directory
"/etc/portage/make.conf", line 7: make.conf.lto: No such file or directory
"/etc/portage/make.conf", line 7: make.conf.lto: No such file or directory
"/etc/portage/make.conf", line 7: make.conf.lto: No such file or directory
"/etc/portage/make.conf", line 7: make.conf.lto: No such file or directory
 * You need to specify an output overlay.  Please use --ov-output, or consult
 * https://wiki.gentoo.org/wiki/Custom_repository for more details.
Edit 2: This is what happened after I pointed crossdev via /etc/portage/repos.conf/crossdev.conf (the file didn't exist, so I made it) to use the overlay I made over at /var/db/repos/localrepo-crossdev

Code: Select all

LPKG=glibc
LVER=[latest]
"/etc/portage/make.conf", line 7: make.conf.lto: No such file or directory
"/etc/portage/make.conf", line 7: make.conf.lto: No such file or directory
"/etc/portage/make.conf", line 7: make.conf.lto: No such file or directory
"/etc/portage/make.conf", line 7: make.conf.lto: No such file or directory
"/etc/portage/make.conf", line 7: make.conf.lto: No such file or directory
"/etc/portage/make.conf", line 7: make.conf.lto: No such file or directory
"/etc/portage/make.conf", line 7: make.conf.lto: No such file or directory
"/etc/portage/make.conf", line 7: make.conf.lto: No such file or directory
"/etc/portage/make.conf", line 7: make.conf.lto: No such file or directory
"/etc/portage/make.conf", line 7: make.conf.lto: No such file or directory
"/etc/portage/make.conf", line 7: make.conf.lto: No such file or directory
"/etc/portage/make.conf", line 7: make.conf.lto: No such file or directory
"/etc/portage/make.conf", line 7: make.conf.lto: No such file or directory
"/etc/portage/make.conf", line 7: make.conf.lto: No such file or directory
-
 * crossdev version:      20200801
 * Host Portage ARCH:     amd64
 * Host Portage System:   x86_64-pc-linux-gnu (i686-pc-linux-gnu x86_64-pc-linux-gnu)
 * Target Portage ARCH:   arm64
 * Target System:         aarch64-unknown-linux-gnu
 * Stage:                 4 (C/C++ compiler)
 * USE=multilib:          no
 * Target ABIs:           arm64

 * binutils:              binutils-[latest]
 * gcc:                   gcc-[latest]
 * headers:               linux-headers-[latest]
 * libc:                  glibc-[latest]

 * CROSSDEV_OVERLAY:      /var/db/repos/localrepo-crossdev
 * PORT_LOGDIR:           /var/log/portage
 * PORTAGE_CONFIGROOT:    /
 * Portage flags:

Not really sure what happened here, it just threw me back to the shell without saying more.
Edit 3: I figured it out guys! Had something to do with my make.conf. I should pay attention to the error messages more.. I still do not know about the errors on compiling the kernel. Someone please help.
Thank you for reading!
WAAHLUIGI
Top
Phoenix591
Guru
Guru
Posts: 506
Joined: Mon Sep 17, 2007 3:52 am

  • Quote

Post by Phoenix591 » Mon Dec 14, 2020 7:30 am

Forget the firmware (from git), that's nicely packaged in portage now. More words once I get off work
Top
Jarodiv
n00b
n00b
User avatar
Posts: 38
Joined: Fri Jan 17, 2020 8:57 pm

  • Quote

Post by Jarodiv » Mon Dec 14, 2020 9:44 am

The Kernel sources (sys-kernel/raspberrypi-sources) and even a compiled image (sys-kernel/raspberrypi-image) are available in Portage too:

Code: Select all

# emerge --ask --verbose sys-kernel/raspberrypi-sources

# cd /usr/src/linux
# make bcm2711_defconfig && make -j4 && make modules_install

# mkdir --parent /boot/overlays
# cp --recursive arch/arm64/boot/dts/overlays/* /boot/overlays/
# cp arch/arm64/boot/dts/broadcom/bcm2711-rpi-4-b.dtb /boot/
# cp arch/arm64/boot/Image /boot/kernel8.img
If you want a more recent kernel, I have the latest 5.9.12 in my overlay with "bcm2711_defconfig" already being run during installation (but don't expect it to be updated with every new commit):
-> https://github.com/Jarodiv/rpi4-overlay

Code: Select all

# emerge --ask --verbose sys-kernel/raspberrypi4-sources

# cd /usr/src/linux
# make -j4 && make modules_install

# cp --recursive arch/arm64/boot/dts/overlays /boot/
# cp arch/arm64/boot/dts/broadcom/bcm2711-rpi-4-b.dtb /boot/
# cp arch/arm64/boot/Image /boot/kernel8.img
I also would recommend to install a newer firmware for the WiFi+BT chip than it is provided by the package "sys-kernel/linux-firmware". You need to compile "sys-kernel/linux-firmware" with the "savedconfig" use flag enabled first and then remove or comment out the line "brcm/brcmfmac43455-sdio.bin" from the file "/etc/portage/savedconfig/sys-kernel/linux-firmware-<version>" (else you will have trouble with this file on each re-emerge of "sys-kernel/linux-firmware"). The Ffirmware again can be installed manually...

Code: Select all

# wget --output-document /lib/firmware/brcm/brcmfmac43455-sdio.bin https://github.com/RPi-Distro/firmware-nonfree/raw/master/brcm/brcmfmac43455-sdio.bin
# wget --output-document /lib/firmware/brcm/brcmfmac43455-sdio.clm_blob https://github.com/RPi-Distro/firmware-nonfree/raw/master/brcm/brcmfmac43455-sdio.clm_blob 
# wget --output-document /lib/firmware/brcm/brcmfmac43455-sdio.txt https://github.com/RPi-Distro/firmware-nonfree/raw/master/brcm/brcmfmac43455-sdio.txt
... or from my overlay

Code: Select all

# emerge --ask --verbose sys-firmware/brcm43455-firmware
Edit 2021-01-06:
Fixed command to copy the overlays
Last edited by Jarodiv on Wed Jan 06, 2021 6:24 pm, edited 2 times in total.
Top
ShorTie
Tux's lil' helper
Tux's lil' helper
Posts: 103
Joined: Sun Feb 12, 2006 1:09 pm

  • Quote

Post by ShorTie » Mon Dec 14, 2020 11:16 am

Sorry guys, sortta off topic
But you may want to look/do this for a image.
https://ShorTie8@github.com/ShorTie8/Gentoo-imager
It's a start me running thing and come back tomorrow for a image.
Like Gentoo it's self, lots of options can be set.
Will run on raspios or Gentoo.
Hard to have the chicken before the egg hatches, lol.
Still a WIP, but should work.
Be nice to have some feed back before official release/topic on it.
Oh, it uses the foundation kernel and has it's own kernel_upupdate.sh script.
Top
waluigi22
n00b
n00b
Posts: 4
Joined: Sun Dec 13, 2020 9:05 pm

  • Quote

Post by waluigi22 » Mon Dec 14, 2020 1:21 pm

Phoenix591 wrote:Forget the firmware (from git), that's nicely packaged in portage now. More words once I get off work
yes please! what shall i do with the firmware stuff now?
WAAHLUIGI
Top
waluigi22
n00b
n00b
Posts: 4
Joined: Sun Dec 13, 2020 9:05 pm

  • Quote

Post by waluigi22 » Mon Dec 14, 2020 1:37 pm

Jarodiv wrote:The Kernel sources (sys-kernel/raspberrypi-sources) and even a compiled image (sys-kernel/raspberrypi-image) are available in Portage too:

Code: Select all

# emerge --ask --verbose sys-kernel/raspberrypi-sources

# cd /usr/src/linux
# make bcm2711_defconfig && make -j4 && make modules_install

# cp --recursive arch/arm64/boot/dts/overlays /boot/
# cp arch/arm64/boot/dts/broadcom/bcm2711-rpi-4-b.dtb /boot/
# cp arch/arm64/boot/Image /boot/kernel8.img
If you want a more recent kernel, I have the latest 5.9.12 in my overlay with "bcm2711_defconfig" already being run during installation (but don't expect it to be updated with every new commit):
-> https://github.com/Jarodiv/rpi4-overlay

Code: Select all

# emerge --ask --verbose sys-kernel/raspberrypi4-sources

# cd /usr/src/linux
# make -j4 && make modules_install

# cp --recursive arch/arm64/boot/dts/overlays /boot/
# cp arch/arm64/boot/dts/broadcom/bcm2711-rpi-4-b.dtb /boot/
# cp arch/arm64/boot/Image /boot/kernel8.img
I also would recommend to install a newer firmware for the WiFi+BT chip than it is provided by the package "sys-kernel/linux-firmware". You need to compile "sys-kernel/linux-firmware" with the "savedconfig" use flag enabled first and then remove or comment out the line "brcm/brcmfmac43455-sdio.bin" from the file "/etc/portage/savedconfig/sys-kernel/linux-firmware-<version>" (else you will have trouble with this file on each re-emerge of "sys-kernel/linux-firmware"). The Ffirmware again can be installed manually...

Code: Select all

# wget --output-document /lib/firmware/brcm/brcmfmac43455-sdio.bin https://github.com/RPi-Distro/firmware-nonfree/raw/master/brcm/brcmfmac43455-sdio.bin
# wget --output-document /lib/firmware/brcm/brcmfmac43455-sdio.clm_blob https://github.com/RPi-Distro/firmware-nonfree/raw/master/brcm/brcmfmac43455-sdio.clm_blob 
# wget --output-document /lib/firmware/brcm/brcmfmac43455-sdio.txt https://github.com/RPi-Distro/firmware-nonfree/raw/master/brcm/brcmfmac43455-sdio.txt
... or from my overlay

Code: Select all

# emerge --ask --verbose sys-firmware/brcm43455-firmware
Hi! When I run:

Code: Select all

# emerge --ask --verbose sys-kernel/raspberrypi-sources
I get this:

Code: Select all

!!! All ebuilds that could satisfy "sys-kernel/raspberrypi-sources" have been masked.
!!! One of the following masked packages is required to complete your request:
- sys-kernel/raspberrypi-sources-5.4.9999::gentoo (masked by: missing keyword)
- sys-kernel/raspberrypi-sources-5.4.79_p20201201::gentoo (masked by: missing keyword)
- sys-kernel/raspberrypi-sources-4.19.9999::gentoo (masked by: missing keyword)
Also your steps kind of confused me(excuse my normieness). What about the firmware? Since I will be doing all of this on my PC, it will override both my kernel and currently installed firmware, no? Please note that I do not have the RPi in my hands, someone else has it and I am ssh'ing into it. It is currently running Ubuntu, meanwhile my PC is running Gentoo. As for

Code: Select all

emerge --ask --verbose sys-kernel/raspberrypi4-sources
....:

Code: Select all

Calculating dependencies... done!

emerge: there are no ebuilds to satisfy "sys-kernel/raspberrypi4-sources".

emerge: searching for similar names...
emerge: Maybe you meant any of these: sys-kernel/raspberrypi-sources, sys-kernel/raspberrypi-image, sys-kernel/aufs-sources?
I don't know how these "overlays" work at all either, please guide me.
Excuse me and thank you!
Edit 1: I think I figured out how to install the "overlay", haven't done it yet, but what do I do with the overlay after I install it?
WAAHLUIGI
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56100
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Mon Dec 14, 2020 3:45 pm

Moved from Installing Gentoo to Gentoo on ARM.

A Pi is one of these.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
flysideways
Guru
Guru
Posts: 527
Joined: Sat Jan 29, 2005 1:06 pm

  • Quote

Post by flysideways » Mon Dec 14, 2020 7:49 pm

waluigi22 wrote: Hi! When I run:

Code: Select all

# emerge --ask --verbose sys-kernel/raspberrypi-sources
I get this:

Code: Select all

!!! All ebuilds that could satisfy "sys-kernel/raspberrypi-sources" have been masked.
!!! One of the following masked packages is required to complete your request:
- sys-kernel/raspberrypi-sources-5.4.9999::gentoo (masked by: missing keyword)
- sys-kernel/raspberrypi-sources-5.4.79_p20201201::gentoo (masked by: missing keyword)
- sys-kernel/raspberrypi-sources-4.19.9999::gentoo (masked by: missing keyword)
Reviewing what you find in the handbook and wiki about Portage and its emerge command is helpful.

Code: Select all

# emerge --ask --verbose --autounmask=True --autounmask-write sys-kernel/raspberrypi-sources
will unmask that package by writing the correct information to a file that you will review and accept, reject, or modify by executing

Code: Select all

# dispatch-conf
waluigi22 wrote:Also your steps kind of confused me(excuse my normieness). What about the firmware? Since I will be doing all of this on my PC, it will override both my kernel and currently installed firmware, no? Please note that I do not have the RPi in my hands, someone else has it and I am ssh'ing into it. It is currently running Ubuntu, meanwhile my PC is running Gentoo. As for

Code: Select all

emerge --ask --verbose sys-kernel/raspberrypi4-sources
....:

Code: Select all

Calculating dependencies... done!

emerge: there are no ebuilds to satisfy "sys-kernel/raspberrypi4-sources".

emerge: searching for similar names...
emerge: Maybe you meant any of these: sys-kernel/raspberrypi-sources, sys-kernel/raspberrypi-image, sys-kernel/aufs-sources?
I don't know how these "overlays" work at all either, please guide me.
Excuse me and thank you!
Edit 1: I think I figured out how to install the "overlay", haven't done it yet, but what do I do with the overlay after I install it?
That is not an overlay. You just typed a name for the package that was not correct. I do it all of the time, usually poor typing. It offered you packages that were similar to what you typed, including the one that you wanted.

Keep at it, you will get there.

I'm posting this from a Pi 4 running the 64 bit Gentoo I built with QEMU on my desktop. I had no idea a couple of weeks ago, but I have used Gentoo a bit over the years, AND read all I could find. Reading all of Sakaki's stuff on github is also helpful.

Cheers
Top
Jarodiv
n00b
n00b
User avatar
Posts: 38
Joined: Fri Jan 17, 2020 8:57 pm

  • Quote

Post by Jarodiv » Mon Dec 14, 2020 9:59 pm

waluigi22 wrote:I don't know how these "overlays" work at all either, please guide me.
Excuse me and thank you!
Edit 1: I think I figured out how to install the "overlay", haven't done it yet, but what do I do with the overlay after I install it?
Instructions on how to install the overlay are actually available in the projects README.md :)
-> https://github.com/Jarodiv/rpi4-overlay#layman
Top
ShorTie
Tux's lil' helper
Tux's lil' helper
Posts: 103
Joined: Sun Feb 12, 2006 1:09 pm

  • Quote

Post by ShorTie » Tue Dec 15, 2020 12:18 pm

Taken from my Gentoo-imager,
You need to do sumfin like this

Code: Select all

  echo -e "${STEP}\n  Doing a  Raspiberry ${DONE}$BOARD${STEP} install ${NO}"
	# We do this here so emerge can pull packages
  echo -e "${STEP}    Adding stuff to package.license ${NO}"
  echo "media-libs/raspberrypi-userland-bin raspberrypi-videocore-bin" >> sdcard/etc/portage/package.license
  echo "sys-boot/raspberrypi-firmware raspberrypi-videocore-bin" >> sdcard/etc/portage/package.license
  echo "sys-firmware/raspberrypi-wifi-ucode Broadcom" >> sdcard/etc/portage/package.license

  echo -e "${STEP}    Adding stuff to package.accept_keywords for ~${ARCH} ${NO}"
  mkdir -vp sdcard/etc/portage/package.accept_keywords
  echo "media-libs/raspberrypi-userland ~${ARCH}" >> sdcard/etc/portage/package.accept_keywords/media-libs
  echo "media-libs/raspberrypi-userland-bin ~${ARCH}" >> sdcard/etc/portage/package.accept_keywords/media-libs
  echo "media-video/raspberrypi-omxplayer ~${ARCH}" >> sdcard/etc/portage/package.accept_keywords/media-video
  echo "sys-boot/raspberrypi-firmware ~${ARCH}" >> sdcard/etc/portage/package.accept_keywords/sys-boot
  echo "sys-firmware/raspberrypi-wifi-ucode ~${ARCH}" >> sdcard/etc/portage/package.accept_keywords/sys-firmware
  echo "sys-kernel/raspberrypi-image ~${ARCH}" >> sdcard/etc/portage/package.accept_keywords/sys-kernel
  echo "sys-kernel/raspberrypi-sources ~${ARCH}" >> sdcard/etc/portage/package.accept_keywords/sys-kernel
Note: the sdcard.... part is most likely invalid for you, so just delete them and adjust ${ARCH} to suit your needs
Top
blossa
Apprentice
Apprentice
Posts: 169
Joined: Thu Jan 13, 2005 11:05 pm

  • Quote

Post by blossa » Wed Jan 06, 2021 1:04 pm

I started with putting sakakis minimal version on card and all worked but I wanted to update my system. So i tried to follow these instruction.
Jarodiv wrote:The Kernel sources (sys-kernel/raspberrypi-sources) and even a compiled image (sys-kernel/raspberrypi-image) are available in Portage too:

Code: Select all

# emerge --ask --verbose sys-kernel/raspberrypi-sources

# cd /usr/src/linux
# make bcm2711_defconfig && make -j4 && make modules_install

# cp --recursive arch/arm64/boot/dts/overlays /boot/
# cp arch/arm64/boot/dts/broadcom/bcm2711-rpi-4-b.dtb /boot/
# cp arch/arm64/boot/Image /boot/kernel8.img
If you want a more recent kernel, I have the latest 5.9.12 in my overlay with "bcm2711_defconfig" already being run during installation (but don't expect it to be updated with every new commit):
-> https://github.com/Jarodiv/rpi4-overlay

Code: Select all

# emerge --ask --verbose sys-kernel/raspberrypi4-sources

# cd /usr/src/linux
# make -j4 && make modules_install

# cp --recursive arch/arm64/boot/dts/overlays /boot/
# cp arch/arm64/boot/dts/broadcom/bcm2711-rpi-4-b.dtb /boot/
# cp arch/arm64/boot/Image /boot/kernel8.img
I also would recommend to install a newer firmware for the WiFi+BT chip than it is provided by the package "sys-kernel/linux-firmware". You need to compile "sys-kernel/linux-firmware" with the "savedconfig" use flag enabled first and then remove or comment out the line "brcm/brcmfmac43455-sdio.bin" from the file "/etc/portage/savedconfig/sys-kernel/linux-firmware-<version>" (else you will have trouble with this file on each re-emerge of "sys-kernel/linux-firmware"). The Ffirmware again can be installed manually...

Code: Select all

# wget --output-document /lib/firmware/brcm/brcmfmac43455-sdio.bin https://github.com/RPi-Distro/firmware-nonfree/raw/master/brcm/brcmfmac43455-sdio.bin
# wget --output-document /lib/firmware/brcm/brcmfmac43455-sdio.clm_blob https://github.com/RPi-Distro/firmware-nonfree/raw/master/brcm/brcmfmac43455-sdio.clm_blob 
# wget --output-document /lib/firmware/brcm/brcmfmac43455-sdio.txt https://github.com/RPi-Distro/firmware-nonfree/raw/master/brcm/brcmfmac43455-sdio.txt
... or from my overlay

Code: Select all

# emerge --ask --verbose sys-firmware/brcm43455-firmware
EDIT//
When I was to compile i got message there was no .configure. I did menuconfig instead and I think kconfig got loaded... I did no changes, just saved it so I could have a .config.
//EDIT

All goes fine till I am about to do:

Code: Select all

cp --recursive arch/arm64/boot/dts/overlays /boot/
Then I get a message like

Code: Select all

cp: cannot overwrite directory '/boot/overlays' with non-directory'
I tried to reboot my raspberry pi 4 4gb but now I dont have any ethernet,.. and therefor no SSH so I cant easily copy messages from there. 'lspci -nnk' shows three lines and one of them say like

Code: Select all

lspci: Unable to load libkmod resources: error -12
First I would like to fix this copy-error mentioned above, and secondly I would like to get ethernet back.

Any suggestions/tips where I should start?

Regards, Anders
QX9650, P5E64WS Pro, 4x1GB
Top
Jarodiv
n00b
n00b
User avatar
Posts: 38
Joined: Fri Jan 17, 2020 8:57 pm

  • Quote

Post by Jarodiv » Wed Jan 06, 2021 6:21 pm

blossa wrote:EDIT//
When I was to compile i got message there was no .configure. I did menuconfig instead and I think kconfig got loaded... I did no changes, just saved it so I could have a .config.
//EDIT
Strange, the .config file should have been created by

Code: Select all

make bcm2711_defconfig
With the overlays you're right, I'll update the command. It should've been

Code: Select all

mkdir --parent /boot/overlays
cp --recursive arch/arm64/boot/dts/overlays/* /boot/overlays/
For ethernet I am simply using "net-misc/networkmanager" with "net-misc/dhcpd" and that's it, no additional drivers required.
Top
blossa
Apprentice
Apprentice
Posts: 169
Joined: Thu Jan 13, 2005 11:05 pm

  • Quote

Post by blossa » Wed Jan 06, 2021 7:57 pm

About .config it may be that I did something wrong. I had some problem with the sym-link to /usr/src/linux. I am an old fart that havnt been doing this for a long time. I felt it was pretty easy to install sakakis minimal image to get the system up and running. After that I wanted to update the system as much as possible and your post here was ba far the best I have seen. However, I have forgot so much so I would love to have a more complete guide how to get system up to date. I can send you PM about some thing as I feel really lost...

Networkmanager did not exist last time I used Gentoo. At least I never had need to use it before...

I start nmtui and set up my wired connection. However, I dont have any wired connection to activate. This issue started after I tried to update.

Code: Select all

# ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DORMANT group default qlen 1000
    link/ether dc:a6:32:7d:be:86 brd ff:ff:ff:ff:ff:ff
I might have done something wrong when I had problems with copying. Can it be a file missing for my ethernet chip? If so, wich file?

The main reason for me to update was that I wanted to update firmware for Bluetooth and I tried to follow what you wrote. I did not manage that so I am missing something (or a lot)

Code: Select all

# sudo hciconfig -a
hci0:   Type: Primary  Bus: UART
        BD Address: B8:27:EB:11:94:FE  ACL MTU: 1021:8  SCO MTU: 64:1
        UP RUNNING PSCAN
        RX bytes:731 acl:0 sco:0 events:43 errors:0
        TX bytes:1258 acl:0 sco:0 commands:43 errors:0
        Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
        Link policy: RSWITCH SNIFF
        Link mode: SLAVE ACCEPT
        Name: 'GentooRasp'
        Class: 0x000000
        Service Classes: Unspecified
        Device Class: Miscellaneous,
        HCI Version: 4.1 (0x7)  Revision: 0x0
        LMP Version: 4.1 (0x7)  Subversion: 0x6119
        Manufacturer: Broadcom Corporation (15)
Top
blossa
Apprentice
Apprentice
Posts: 169
Joined: Thu Jan 13, 2005 11:05 pm

  • Quote

Post by blossa » Sun Jan 10, 2021 3:43 am

Ok, so I have redone the installation from Sakikis minimal image and followed Jarodivs steps mentioned here. .config was there and I got no errors.

However
*I can't run 'systemctl' and I have issues with installing it (or systemd)

Code: Select all

GentooRaspberry ~ # emerge --ask systemd

Local copy of remote index is up-to-date and will be used.
 * Last emerge --sync was 95d 18h 34m 4s ago.

Local copy of remote index is up-to-date and will be used.

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

Calculating dependencies... done!

The following USE changes are necessary to proceed:
 (see "package.use" in the portage(5) man page for more details)
# required by sys-apps/systemd-246-r1::gentoo
# required by systemd (argument)
>=sys-apps/dbus-1.12.20 systemd

Would you like to add these changes to your config files? [Yes/No] Yes

Autounmask changes successfully written.

 * IMPORTANT: config file '/etc/portage/package.use/zzz_via_autounmask' needs updating.
 * See the CONFIGURATION FILES and CONFIGURATION FILES UPDATE TOOLS
 * sections of the emerge man page to learn how to update config files.

!!! The ebuild selected to satisfy ">=sys-apps/dbus-1.9.8[systemd]" has unmet requirements.
- sys-apps/dbus-1.12.20::gentoo USE="X elogind -debug -doc (-selinux) -static-libs -systemd -test -user-session"

  The following REQUIRED_USE flag constraints are unsatisfied:
    at-most-one-of ( elogind systemd )

(dependency required by "sys-apps/systemd-246-r1::gentoo" [ebuild])
(dependency required by "systemd" [argument])
GentooRaspberry ~ # etc-update
Scanning Configuration files...
The following is the list of files which need updating, each
configuration file is followed by a list of possible replacement files.
1) /etc/portage/package.use/zzz_via_autounmask (1)
Please select a file to edit by entering the corresponding number.
              (don't use -3, -5, -7 or -9 if you're unsure what to do)
              (-1 to exit) (-3 to auto merge all files)
                           (-5 to auto-merge AND not use 'mv -i')
                           (-7 to discard all updates)
                           (-9 to discard all updates AND not use 'rm -i'): -3
Replacing /etc/portage/package.use/zzz_via_autounmask with /etc/portage/package.use/._cfg0000_zzz_via_autounmask
mv: overwrite '/etc/portage/package.use/zzz_via_autounmask'? y
Exiting: Nothing left to do; exiting. :)
GentooRaspberry ~ # emerge --ask systemd

Local copy of remote index is up-to-date and will be used.
 * Last emerge --sync was 95d 18h 35m 46s ago.

Local copy of remote index is up-to-date and will be used.

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

Calculating dependencies... done!

!!! The ebuild selected to satisfy ">=sys-apps/dbus-1.9.8[systemd]" has unmet requirements.
- sys-apps/dbus-1.12.20::gentoo USE="X elogind systemd -debug -doc (-selinux) -static-libs -test -user-session"

  The following REQUIRED_USE flag constraints are unsatisfied:
    at-most-one-of ( elogind systemd )

(dependency required by "sys-apps/systemd-246-r1::gentoo" [ebuild])
(dependency required by "systemd" [argument])
GentooRaspberry ~ #
*I can't update firmware for my bluetooth.
*I can't get btattach to work.

Code: Select all

$ lspci -show
lspci: -s: Invalid slot number
demouser@GentooRaspberry ~ $ lspci
00:00.0 PCI bridge: Broadcom Inc. and subsidiaries Device 2711 (rev 10)
01:00.0 USB controller: VIA Technologies, Inc. VL805 USB 3.0 Host Controller (rev 01)
demouser@GentooRaspberry ~ $ btattach
No controller attached
demouser@GentooRaspberry ~ $ bluetoothctl
Agent registered
[CHG] Controller AA:AA:AA:AA:AA:AA Pairable: yes
[bluetooth]# show
Controller AA:AA:AA:AA:AA:AA (public)
        Name: BlueZ 5.55
        Alias: BlueZ 5.55
        Class: 0x00000000
        Powered: no
        Discoverable: no
        DiscoverableTimeout: 0x000000b4
        Pairable: yes
        UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
        UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
        UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
        UUID: Device Information        (0000180a-0000-1000-8000-00805f9b34fb)
        Modalias: usb:v1D6Bp0246d0537
        Discovering: no
        Roles: central
        Roles: peripheral
Advertising Features:
        ActiveInstances: 0x00 (0)
        SupportedInstances: 0x05 (5)
        SupportedIncludes: tx-power
        SupportedIncludes: appearance
        SupportedIncludes: local-name
[bluetooth]# exit
demouser@GentooRaspberry ~ $ hciconfig -a
hci0:   Type: Primary  Bus: UART
        BD Address: AA:AA:AA:AA:AA:AA  ACL MTU: 1021:8  SCO MTU: 64:1
        DOWN
        RX bytes:1316 acl:0 sco:0 events:51 errors:0
        TX bytes:1310 acl:0 sco:0 commands:55 errors:0
        Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
        Link policy: RSWITCH SNIFF
        Link mode: SLAVE ACCEPT

demouser@GentooRaspberry ~ $
Any tips?

Thanks in advance
QX9650, P5E64WS Pro, 4x1GB
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56100
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Sun Jan 10, 2021 11:04 am

blossa,

Sakakis image uses OpenRC and sysvinit, not systemd. You can switch but its not trivial.
There is a guide on the Wiki.

Code: Select all

emerge sys-firmware/raspberrypi-wifi-ucode
will get you the microcode.
However, an older non working version is included in linux-firmware, so as explained elsewhere, you need to install linux-firmware, edit its config file and remerge it, so portage knows the files are gone.
Now you can install sys-firmware/raspberrypi-wifi-ucode

The bluetooth is attached to the serial port and needs its firmware loaded over the serial link.
I'm sure Sakakis distro did that.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
blossa
Apprentice
Apprentice
Posts: 169
Joined: Thu Jan 13, 2005 11:05 pm

  • Quote

Post by blossa » Sun Jan 10, 2021 2:41 pm

Thank you for good answer. Right now I dont have time, but I am considering to build all from scratch later.
NeddySeagoon wrote: The bluetooth is attached to the serial port and needs its firmware loaded over the serial link.
I'm sure Sakakis distro did that.
It did. However, I read some guide about btattach to be able to use Spotify Connect (play music from phone on Raspberry via bluetooth) and to upgrade firmware. It was about there I got stuck on systemctl.

Without using btattach i tried to update firmware from 4.1, but it never got upgraded even after reboot.
QX9650, P5E64WS Pro, 4x1GB
Top
Post Reply
  • Print view

18 posts • Page 1 of 1

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

 

 

magic