Bootable 64-bit Gentoo image for the Raspberry Pi4B, 3B & 3B+, with Linux 5.4, OpenRC, Xfce4, VC4/V3D, camera and h/w codec support, weekly-autobuild binhost
This is an incremental release to v1.2.1.
If you would like to upgrade an existing, older version of this image to v1.2.2 (rather than just downloading and using the latest v1.2.2 image directly), please see below.
Changes in this release (see main project page for further details):
bcmrpi3-kernel-bin
to bcmrpi3-kernel-bis-bin
; the latter uses a slightly tweaked version of the upstream bcmrpi3_defconfig
via this weekly autobuild (to which, incidentally, config-change PRs will be accepted for review). The original bcmrpi3-kernel-bin
package (and autobuild) will continue to be supported, and indeed you can easily switch to this version if you desire (just run, as root, emerge -av1 sys-kernel/bcmrpi3-kernel-bin && reboot
). However, having the ability to tweak the configuration (and possibly kernel source in future) provides additional flexibility. For example, in this release KVM is supported (see this thread) and the image ships with app-emulation/qemu
if you want to try it out. Other facilities will be rolled out in future.sys-apps/rng-tools
package to start using it for /dev/random
.media-sound/mpd
and media-sound/mpc
(a music player daemon and client).media-libs/raspberrypi-userland
, so you can now use vcgencmd
etc. Please note that (as with all 64-bit distros for the RPi3 at the moment), MMAL and OpenMax IL features are not supported (see also raspberrypi/userland#460).net-fs/samba
is now bundled (you need to configure and activate it yourself, however, see e.g. these notes).sysctl.d
rule to optimize cache usage settings for low memory (per this article).rpi3-safecompositor
) which turns off display compositing if a high pixel clock is detected (> 1.2175MHz, currently). This is because certain applications, for example LibreOffice v6 Draw and Impress, can cause the whole system to lock-up when used with compositing on under such conditions.rpi3-ethfix
) to workaround some RPi3B+ Ethernet issues via ethtool
.Users downloading this v1.2.2 image directly can of course omit the instructions below; as all settings have been correctly set up for you already.
Users on releases earlier than v1.2.0 should follow the manual upgrade instructions to 1.2.0 below; the final step
genup
therein will actually bring you to a baseline v1.2.2 now, then read on.
You can easily check your current version at any time, by issuing:
demouser@pi64 ~ $ eix rpi3-64bit-meta
If you are already on v1.2.1 or v1.2.0, you can upgrade simply by running genup
(or wait for the automated weekly update to do this for you). However, if upgrading in this manner, you may also want to emerge
the new top-level applications available (medial-sound/mpd
and media-sound/mpc
), as these will not be automatically installed for you unless you have set the apps
USE flag on the rpi3-64bit-meta
package (this flag is not on by default), and you should also set an appropriate configuration for the hardware RNG service: to do so, simply add the following uncommented lines to /etc/conf.d/rngd
:
DEVICE=/dev/hwrng
NO_TPM=1
STEP=64
WATERMARK=2048
Then enable and start the service via:
pi64 ~ # rc-update add rngd boot
pi64 ~ # rc-service rngd start
Lastly, if upgrading via genup
you may wish to switch your binary kernel package to the new '-bis' version (discussed more above); if so, simply issue:
pi64 ~ # emerge --verbose --oneshot sys-kernel/rpi3-kernel-bis-bin
pi64 ~ # reboot
and from that point forward you'll be using the enhanced kernel (it is also fine to stay with the vanilla bcmrpi3-kernel-bin
, this is still supported going forward, you'll just be missing some additional features such as KVM etc.).
This is an incremental release to v1.2.2.
If you would like to upgrade an existing, older version of this image to v1.3.0 (rather than just downloading and using the latest v1.3.0 image directly), please see below.
Changes in this release (see main project page for further details):
porthash
repository verification to Gentoo's own, official gemato
-based approach (with failure quarantine). Accordingly, the porthash
USE flag on dev-embedded/rpi3-64bit-meta
has switched from default-on to default-off as of v1.3.0, and the weekly-gated rsync
URI has changed (to one without polluting porthash
signatures), from rsync://isshoni.org/gentoo-portage-pi64
to rsync://isshoni.org/gentoo-portage-pi64-gem
. (The older version will continue to be supported for a time, for backwards compatibility during the changeover period.)rpi3-zswap
) to start using it. Given the highly compressible nature of most RAM pages on a running system, and the RPi3's relatively meagre I/O capabilities, this should materially improve system responsiveness under load. Parameterized via /etc/conf.d/rpi3-zswap
.rpi3-expand-swap
), to increase the ('real', backing-store-based) swapfile size to 1GiB, space permitting, as a one-off operation post root partition and filesystem resize. Parametrized via /etc/conf.d/rpi3-expand-swap
.sys-kernel/bcmrpi3-kernel-bis-bin-4.14.71.20180922
, accompanying boot firmware to sys-boot/rpi3-64bit-firmware-1.20180919
(these will of course auto-update as new versions are unmasked).Users downloading this v1.3.0 image directly can of course omit the instructions below; as all settings have been correctly set up for you already.
First check your current release version, by issuing:
demouser@pi64 ~ $ eix rpi3-64bit-meta
(look at the Installed versions:
stanza)
Then follow the appropriate directions as shown (based on your release version):
genup
may not have conformed for you) are also correct.For those users on a 1.2.x release, the majority of the upgrade can be taken care of simply by running (as root, or using sudo
):
pi64 ~ # emaint sync --repo sakaki-tools
pi64 ~ # emerge --update --oneshot app-portage/genup
pi64 ~ # nice genup
This may take a number of hours to complete.
Next, assuming the genup
step completed successfully, you should then perform the following steps to finalize your upgrade.
First, ensure that all fixups
have been run (these are small scripts, normally executed by /etc/cron.weekly/fixup
, and managed by app-portage/weekly-genup
; they may be viewed here). Issue:
pi64 ~ # /etc/cron.weekly/fixup
The output from this may be reviewed in /var/log/latest-fixup-run.log
.
Next, ensure that your regular user is a member of the cron
group, so that they can maintain their own crontabs. Issue:
pi64 ~ # gpasswd --add demouser cron
Obviously, if you have setup your own regular user, substitute their username for
demouser
in the above. Repeat the step for each such user you have created.
Then, ensure that your audio settings are persisted across reboots. To do so, issue:
pi64 ~ # rc-update add alsasound boot
Lastly check that you are using the correct binhost. As of 1.3.0, the official Gentoo gemato
repository verification (with failure quarantine) is being used, so your binhost needs to be set to the version without additional porthash
signed master hashes (since these cause the augmented tree to fail the gemato
check). This switch should have been made automatically be the dev-embedded/rpi3-64bit-meta-1.3.0
ebuild, but you should double-check this. To do so, issue:
pi64 ~ # grep sync-uri /etc/portage/repos.conf/gentoo.conf
sync-uri = rsync://isshoni.org/gentoo-portage-pi64-gem
If you do not see the output above, edit /etc/portage/repos.conf/gentoo.conf
to correct it, and then run genup
again.
Also, ensure you do not have any custom
porthash
USE flag set in/etc/portage/package.use/rpi3-64bit-meta
(this flag has gone from being default enabled inrpi3-64bit-meta-1.2.2
to default disabled inrpi3-64bit-meta-1.3.0
). For avoidance of doubt, if you are unsure what is meant by the preceding comment, you have not set a custom flag, and may disregard this point.
Next, clean up any configuration files that may have been changed by the release, using dispatch-conf
. When this tool prompts you what to do about a proposed file modification, you should use z to 'zap' any changes you are unsure of (keeping your original configuration file), u to 'use' (accept) any changes that look benign (e.g., where only comments have been modified) and m to 'merge' more complicated proposed changes, some parts of which (only) you wish to keep. If in doubt, use z!
In particular, be sure to zap any proposed changes to
/etc/conf.d/rngd
and/etc/conf.d/xdm
!
Note that your kernel and boot firmware will be upgraded as part of this release, so be sure to reboot your RPi3 once you have completed the above process, to start using them.
Once you have done that, congratulations! You are now running on version 1.3.0!
Users on v1.1.3 or earlier of the image should first temporarily inhibit upgrade to version 1.3.0, by issuing:
pi64 ~ # echo ">=dev-embedded/rpi3-64bit-meta-1.3.0" > /etc/portage/package.mask/rpi3-64bit-meta
and then follow the instructions for upgrade to 1.2.2 given previously.
Once this has been completed successfully, release the temporary mask:
pi64 ~ # rm -v /etc/portage/package.mask/rpi3-64bit-meta
and then follow the instructions given above to complete the upgrade to 1.3.0.
This is an incremental feature release to v1.2.0: both the RPi3 Model B and B+ are now supported.
If you are already on v1.2.0, you can upgrade simply by running genup
(or wait for the automated weekly update to do this for you). However, you may also want to emerge
the new top-level application available (fotoxx
), as this will not be automatically installed for you unless you have set the apps
USE flag on the rpi3-64bit-meta
package (this flag is not on by default), and also set an appropriate WiFi regulatory domain in /etc/conf.d/rpi3-wifi-regdom
post update (shipped default is "GB").
Users on releases earlier than v1.2.0 should follow the manual upgrade instructions to 1.2.0 below; the final step
genup
therein will actually bring you to v1.2.1 now.
You can easily check your current version at any time, by issuing:
demouser@pi64 ~ $ eix rpi3-64bit-meta
Changes in this release (see main project page for further details):
sys-kernel/bcmrpi3-kernel-bin-4.14.31.20180401
); this is now the default branch of the RPi3 kernel tree, and is required for RPi3 B+ support. It boots fine on the RPi3 B too. VC4 and audio support is included.media-gfx/fotoxx-18.01.3
(a digital photo processing program).www-client-firefox-58.0.1
, plus the mandated dev-lang/rust-1.23.0-r1
and cargo-0.24.0
); this should offer significantly faster browsing than the previous version.net-wireless/rpi3-wifi-regdom
); the shipped default is "GB", but you can edit the file /etc/conf.d/rpi3-wifi-regdom
to change this.This is a significantly different release to the previous v1.1.3, not so much because of the applications it contains (although these have been updated), but because it is built on a newer Gentoo profile (17.0) than before (13.0). Profiles are changed rarely in Gentoo, for they determine how your entire system is built, often in backwards-incompatible ways: for example, in 17.0, the gcc
compiler defaults to creating position independent executables (aka, 'pie'), which it did not do before. Accordingly (and as officially recommended), all packages have been rebuilt under the new profile for this image (and the corresponding binhost has also been changed (to avoid confusion), from https://isshoni.org/pi64 to https://isshoni.org/pi64pie).
As such, if you are on any earlier release (v1.0.0 through v1.1.3) and wish to upgrade, running
genup
is not sufficient - please instead follow the instructions below (users coming straight to this v1.2.0 release of course need take no special action, your system is already set up correctly).
Changes in this release (see main project page for further details):
/etc/portage/make.conf
.
sys-boot/rpi3-64bit-firmware
package default has not changed). You can easily turn this off again, by editing /boot/config.txt
, if you need the affected GPIO lines.me_cleaner
'out of the box' (provided you have the correct hardware connector and wires, of course). Users uninterested in this particular application are unaffected, and need take no action.To upgrade from a v1.1.0, v1.1.1, v1.1.2 or v1.1.3 release (regular or Pi-Top variants), perform the following steps (as root) on your RPi3.
Users on earlier v1.0.{0,1,2} releases should follow the manual upgrade instructions to 1.1.0 here, and once that has been done, come back here to upgrade to v1.2.0.
For avoidance of doubt, users coming straight to this v1.2.0 release should not follow the below instructions: your system is already up-to-date.
First, make sure you have at least 2GiB of free space on your RPi3's filesystem (use df -h
to check), and that you are using at least version 6.4.0 of gcc
(use gcc-config --list-profiles
to check; look for the version marked with the asterisk).
Then, if that all looks good, proceed to update your ebuild repositories:
pi64 ~ # emaint sync --auto
You should now find you have a new custom profile available. Switch to it:
pi64 ~ # eselect profile set "rpi3:default/linux/arm64/17.0/desktop/rpi3"
You also need to switch your binary package host ('binhost'), as a new one has been started for the 17.0 profile, to avoid confusion / cross-contamination. To do so, issue:
pi64 ~ # nano -w /etc/portage/make.conf
and modify the line that currently reads:
PORTAGE_BINHOST="https://isshoni.org/pi64"
so it now reads instead:
PORTAGE_BINHOST="https://isshoni.org/pi64pie"
Leave the rest of the file as-is. Save, and exit nano
.
Now you can update the core build system. Do not follow the advice in the official news article to rebuild gcc
, binutils
and glibc
individually (if you do, you'll end up building them locally, rather than pulling the new binaries from the binhost, which will take a long time). Instead, issue:
pi64 ~ # emerge --ask --verbose sys-devel/gcc sys-devel/binutils sys-libs/glibc
Check (when the above command prompts you for confirmation) that you will indeed be installing binary packages - this is a good indication you have set things up correctly.
Once this completes, rebuild your entire system for profile 17.0. Almost all of the required 900 or so packages should be available on the new binhost you just switched to, so this should only take a few hours (unless you have added many additional packages to the image yourself). Issue:
pi64 ~ # nice emerge --ask --verbose --emptytree --with-bdeps=y @world
Once it has completed, issue:
pi64 ~ # nice emerge @preserved-rebuild
then:
pi64 ~ # dispatch-conf
to resolve any proposed configuration file changes (for the most part, if you had a reasonably up-to-date 13.0 profile system to start with, typing z to 'zap' (discard) most of these proposed changes should be safe; a lot of packages have been re-installed here, but you want to keep your prior configuration, not roll it back to 'shipped defaults').
NB in particular, if you are using PINN, and
dispatch-conf
offers to update your/boot/cmdline.txt
file, you must press z to discard this change, or your system may fail to boot (PINN modifies this file as part of its install process).
Once done, reboot your system. Then log in again as root, and issue:
pi64 ~ # genup
Once this has completed, congratulations, you have migrated to the (profile 17.0) v1.2.0 release! From this point, the automated weekly genup
run should keep your system correctly up-to-date.
Incidentally, you can easily verify your current version at any time, by issuing:
demouser@pi64 ~ $ eix rpi3-64bit-meta
This is a minor, bugfix release to v1.1.2. If you are already on v1.1.0, v1.1.1 or v1.1.2, you can upgrade simply by running genup
(or wait for the automated weekly update to do this for you). However, you may also want to emerge
the new top-level applications available (particuarly kodi
and clementine
), as these will not be automatically installed for you unless you have set the apps
USE flag on the rpi3-64bit-meta
package (this flag is not on by default).
Users on earlier v1.0.{0,1,2} releases should follow the manual upgrade instructions to 1.1.0 below; the final step
genup
therein will actually bring you to v1.1.3 now.
You can easily check your current version at any time, by issuing:
demouser@pi64 ~ $ eix rpi3-64bit-meta
Changes in this release (see main project page for further details):
media-tv/kodi-17.4_rc1
(a FOSS media-player / entertainment hub) and media-sound/clementine-1.3.1-r6
(a FOSS music player and library organizer).dev-java/icedtea-3.5.1
, a FOSS build of OpenJDK (Java) v8. This is included in the image by default, as libreoffice
is now built with the java
USE flag enabled (as recommended for its Base application).x11-misc/twofing-0.1.2-r2
, which provides two-finger gesture support (emulated right-click, scrolling, pinch zoom and rotate) when using the official 7" touchscreen. It is active by default (but has no effect on systems without a touchscreen attached).app-accessibility/onboard-1.4.1
, an onscreen keyboard, again primarily for touchscreen users..Xauthority
file for the automatically logged-in session to become invalid.xfce-extra/xfce4-mixer-4.99.0-r1
, to allow seamless replacement of xfce-extra/xfce4-mixer
, which has been masked, due to vulnerabilities (Gentoo bug 628424). The new version installs media-sound/volumeicon
instead.This is a minor, bugfix release to v1.1.1. If you are already on v1.1.0 or v1.1.1, you can upgrade simply by running genup
(or wait for the automated weekly update to do this for you).
Users on earlier v1.0.{0,1,2} releases should follow the manual upgrade instructions to 1.1.0 below; the final step
genup
therein will actually bring you to v1.1.2 now.
You can easily check your current version at any time, by issuing:
demouser@pi64 ~ $ eix rpi3-64bit-meta
Changes in this release (see main project page for further details):
All image packages can now be controlled by the rpi3-64bit-meta
metapackage (it has additional USE flags - core
, xfce
, pitop
and apps
that determine what is brought in). As shipped however, the (standard) image does not specify pitop
or apps
by default (so you can still easily pare down your end-user apps, if desired).
If you are upgrading from an earlier release, you can clean up your /var/lib/portage/world
file after updating, if you like, since the majority of the lines in there are now implied by core
or xfce
; for reference, the /var/lib/portage/world
on the v1.1.2 image now reads (end-user apps only):
app-arch/p7zip
app-crypt/seahorse
app-editors/emacs
app-editors/lfhex
app-editors/mousepad
app-office/libreoffice
app-office/libreoffice-l10n
app-portage/porthole
app-text/evince
dev-embedded/rpi3-64bit-meta
dev-util/meld
mail-client/claws-mail
mail-client/thunderbird
media-gfx/gimp
media-gfx/ristretto
media-video/mplayer
media-video/smplayer
media-video/vlc
net-irc/hexchat
sys-apps/gnome-disk-utility
sys-apps/qdiskusage
sys-devel/portage-distccmon-gui
www-client/firefox
www-client/links
Variant Pi-Top image (and support ebuilds) added. The Pi-Top is an RPi3-based DIY laptop; the Pi-Top image contains configured drivers for screen backlight brightness control, clean power-down, pitopSPEAKER initialization and battery level monitoring.
If you have been running an older version of this image on your Pi-Top and would like to retain your work, while migrating to use the newly-available drivers, then please see the instructions below.
Added an initial version of Gordon Henderson's wiringpi
library and gpio
utiltiy.
Added new-user 'fixups' for Xfce4 (compositing redraw on vertical blank etc.), via the xfce-extra/xfce4-fixups-rpi3
package.
Various minor ebuild tidy-ups.
All packages brought up-to-date against the Gentoo tree, as of 27 July 2017.
NB - this should only be done by users on a Pi-Top system who want to upgrade an older gentoo-on-rpi3-64bit
image:
genpi64pt.img.xz
image directly (per instructions on the project's main page), andOK, begin by bringing your existing image to v1.1.2, following the instructions above.
Once you have done this, issue:
pi64 ~ # dispatch-conf
and merge any pending configuration changes. Then, issue:
pi64 ~ # echo 'USE="${USE} pitop"' >> /etc/portage/make.conf
to set the pitop
USE flag globally (this will affect the rpi3-64bit-meta
package, inter alia). Now bring your system up to date with the new settings:
pi64 ~ # genup
When this completes (allow around an hour), you should issue:
pi64 ~ # dispatch-conf
again, and merge any changes. Make sure you accept the modifications to /boot/config.txt
, if offered.
Then, activate the necessary services at the appropriate runlevel:
pi64 ~ # rc-update add pitop-poweroff shutdown
pi64 ~ # rc-update add rpi3-i2cdev boot
pi64 ~ # rc-update add pitop-speaker default
Reboot. You can now add the battery monitor plugin into the top panel if you like - it should work correctly. Keyboard shortcuts should also work (for brightness etc.). On shutdown (but not reboot), the Pi-Top's hub should shut off power cleanly once Gentoo has finalized.
Note that keyboard shortcuts for audio will also work, but they require the audio mixer plugin to be installed in the panel (as it is for demouser
, for example). Your user needs to be a member of the wheel
group (as demouser
is) to modify screen brightness, or monitor the battery (access to the I2C and SPI busses being restricted to that group, as shipped).
GPIO access should be possible using the gpio
app; a 64-bit build of the wiringpi
library is also included (the header files are in /usr/include/wiringpi
, libraries in /usr/lib64
).
That's it! Have fun with your new 64-bit Pi-Top ^-^ Once you have upgraded, you can run genup
etc. just like a regular image user - the binhost supports both.
PS at the moment I do not have any of the other Pi-Top add-on boards so haven't been able to add drivers for them. Shouldn't be too hard to do though. Feel free to send me a PR!
Acknowledgement: a big thank-you to rricharz, whose work made possible the Pi-Top drivers in this variant image.
The image files may be fetched via the links in the Downloads section immediately below. Please see these notes on the main project page for an explanation of what each is, and how to write and use your chosen image.
NB: in particular, please note that most users will want the first (genpi64.img.xz) image - the Pi-Top variant (genpi64pt.img.xz) should only be used for those who want to run their RPi3 in a Pi-Top chassis (as it contains platform-specific drivers to communicate with the Pi-Top's onboard battery, hub, speakers etc.)
This is a minor, bugfix release to v1.1.0. If you are already on v1.1.0, you can upgrade simply by running genup
(or wait for the automated weekly update to do this for you).
Users on earlier v1.0.{0,1,2} releases should follow the manual upgrade instructions to 1.1.0 below; the final step
genup
therein will actually bring you to v1.1.1 now.
You can easily check your current version at any time, by issuing:
demouser@pi64 ~ $ eix rpi3-64bit-meta
Changes in this release (see main project page for further details):
Fix #17 (offset mouse cursor on HDMI TVs when overscan in use): disable_overscan=1
is now uncommented by default again in config.txt
(in the top-level directory of the filesystem in the image's first partition, available as /boot/config.txt
when logged in). Also, a service (rpi3-safecursor
) is added to the default runlevel; this forces (always accurate, but slower) software cursor blitting to be used, if the disable_overscan
stanza is detected as having been commented out in, or removed outright from, config.txt
(and VC4 is enabled).
Users with computer monitors should be unaffected by these changes (everything worked before and should still work, hardware cursor blitting will still be in use); users with HDMI TVs should find their mouse cursor is usable again (and for avoidance of doubt can safely enable overscan, if needed on their display to avoid clipping, by commenting out disable_autoscan=1
in config.txt
).
The
rpi3-safecursor
service will also turn off display compositing if it detects that overscan is not disabled. If this occurs, and you want to revert it later, you'll need to turn compositing back on manually (via Applications→Settings→Window Manager Tweaks,Compositor
tab).
Shift to PARTUUID-based naming (rather than explicitly using /dev/mmcblk0p{1,2}
, to make it easier for those users not running the image from a microSD card (changes to /etc/fstab
, the autoexpand-root
service, and cmdline.txt
(in same directory as config.txt
).
Migrate the 50-disable-Xv.conf
rule into ebuild control (rpi3-init-scripts
).
Clean up the binary kernel package uninstall logic, and make the with-matching-boot-fw
version-binding less loose.
Various minor ebuild tidy-ups.
All packages brought up-to-date against the Gentoo tree, as of 20 July 2017.
Changes in this release (see main project page for further details):
Note: those wishing to manually upgrade from an earlier image should see below.
All the required firmware and startup files have now been placed under ebuild control, for ease of maintenance going forward:
A metapackage, sys-firmware/rpi3-64bit-meta
from the (subscribed) rpi3
ebuild repository (overlay) governs the inclusion of all the components discussed below (controlled by a set of USE flags). This is intended to simplify future maintenance (and upgrading for existing users). The version of the metapackage matches the version of the live-USB release to which it pertains.
For avoidance of doubt, the
rpi3-64bit-meta
metapackage does not specify the various end-user applications installed on the image (such aslibreoffice
,firefox
etc.), so these may be freely uninstalled or modified as required.
The /boot
firmware (excluding the kernel and DTBs; those are provided by sys-kernel/bcmrpi3-kernel-bin
, discussed later) is now provided by sys-boot/rpi3-64bit-firmware
: the upstream raspberrypi/firmware/boot
repo is checked once per week for new release tags, and a new corresponding ebuild created automatically if one is found. This package also provides 'starter' configuration files /boot/cmdline.txt
and /boot/config.txt
(with settings matching those on the image), but these are CONFIG_PROTECT
ed, so any changes you make subsequently will be preserved.
The configuration file brcmfmac43430-sdio.txt
, required for the RPi3's integrated WiFi, is now provided by sys-firmware/brcm43430-firmware
(its main firmware being provided by the standard linux-firmware
package).
Firmware (/etc/firmware/BCM43430A1.hcd
) for the RPi3's integrated Bluetooth transceiver is now provided by sys-firmware/bcm4340a1-firmware
(adapted from the Arch Linux pi-bluetooth
package). A startup service and udev
rule are provided by the companion net-wireless/rpi3-bluetooth
package (adapted from the same Arch Linux upstream).
The /etc/local.d/ondemand_freq_scaling.start
boot script, which switches the RPi3 from its (bcmrpi3_defconfig
) default powersave
CPU frequency governor, to ondemand
, for better performance, has been switched to a sysinit
OpenRC service, provided by sys-apps/rpi3-ondemand-cpufreq
.
The autoexpand_root_partition.start
script has been migrated into an OpenRC boot service, provided by sys-apps/rpi3-init-scripts
.
It is now also possible to replace the default
autoexpand_root_partition
sentinel file (in the top level directory of the image's first partition) by anautoexpand_root_none
sentinel file, before first boot; doing so will cause theautoexpand-root
service still to force-set thedemouser
androot
passwords (toraspberrypi64
), but not to change the partition structure (thanks to @procount for suggesting (#14)).
Keeping your system up-to-date has been made significantly simpler:
An autobuild of the official raspberrypi/linux
kernel (default branch) using bcmrpi3_defconfig
has been set up here; a new release tarball is automatically pushed once per week, and a matching kernel binary package (sys-kernel/bcmrpi3-kernel-bin
) is also created simultaneously.
NB: at the time of writing, the rpi-4.9.y
branch was the default (receiving most attention for backports etc.); however, as this does not (yet) have backported audio drivers, 4.10.17 build (and matching binary package, bcmrpi3-kernel-bin-4.10.17
) has also been created (and is used on the image). Using -bin
packages for the kernel makes it easy to switch between them (and to update your kernel, and module set, to the latest version available - along with all other packages on your system - whenever you issue genup
); you can see the kernels available by issuing eix bcmrpi3-kernel-bin
. Also, note that by default (via the with-matching-boot-fw
USE flag) installing a particular sys-kernel/bcmrpi3-kernel-bin
version will also cause the version of sys-boot/rpi3-64bit-firmware
(see above) current at the time the kernel was released, to be installed (to /boot
). This helps to reduce issues with firmware / kernel mismatches with cutting edge features such as VC4 support.
Use of the provided binary kernel package is optional, you can always uninstall it and build your own kernel if desired.
The project's Gentoo binhost at https://isshoni.org/pi64 has been updated to perform a weekly update and autobuild of all installed packages on the image, allowing your RPi3 to perform fast updates via the resulting binary packages where possible, only falling back to local source-based compilation when necessary (using this facility is optional, of course, just like the binary kernel package). The binhost also provides a (weekly-gated) rsync
mirror (rsync://isshoni.org/gentoo-portage-pi64
) for the main gentoo
repo (with porthash authentication), used to keep your RPi3's "visible" ebuild tree in lockstep with the binary package versions available on the isshoni.org binhost. Use the provided binary packages at your own risk.
A custom Gentoo profile, rpi3:default/linux/arm64/13.0/desktop/rpi3
, is provided (and selected as the active profile on the image), which supplies many of the default build settings, USE flags etc., required for 64-bit Gentoo on the RPi3, again, keeping them in lockstep with the binhost (and ensuring you will have a binary package available when upgrading any of the pre-installed software packages on the image). You can view this profile (provided via the rpi3 ebuild repository) here.
These features (the rpi3:default/linux/arm64/13.0/desktop/rpi3
profile, weekly autobuild isshoni.org binhost, 'weekly-gated', signature-authenticated portage rsync mirror (rsync://isshoni.org/gentoo-portage-pi64
), and the sys-kernel/bcmrpi3-kernel-bin
binary kernel package), make updating a typical system (with few user-added packages) possible with a near 100% hit rate on the binhost's binaries. As such, updating (via genup
, for example, or an old-school eix-sync && emerge -uDUav --with-bdeps=y @world
) is much less onerous than before, and so has been automated on the image (via the app-portage/weekly-genup
package, which installs a script in /etc/cron.weekly
). This automated weekly updating can easily be disabled if you do not wish to use it (simply edit the file /etc/portage/package.use/rpi3-64bit-meta
and set the -weekly-genup
USE flag, then emerge -v rpi3-64bit-meta
).
A number of significant additions have been made to the pre-installed software set, in particular:
The fully featured app-office/libreoffice-5.3.4.2
has been installed (and app-office/abiword
dropped, due to display issues).
www-client/firefox-53.0.3
has been installed; thanks to this Gentoo forum thread for hints on getting it to build (these changes have been added to the rpi3:default/linux/arm64/13.0/desktop/rpi3
profile so you can also build locally if desired, see here). Also, the system...
USE flags have been dropped; they were causing a lot of unnecessary rebuilds.
www-client/links-2.14
has been retained on the image for those wanting a lighter-weight browser.
mail-client/thunderbird-52.2.0
has been added (same comments about building as for firefox
apply); it seems to run reliably now. mail-client/claws-mail-3.15.0
has been retained on the image, for those wanting a lighter-weight alternative.
media-gfx/gimp-2.9.4-r3
has been added to provide a fully featured image editor.
The initial swapfile has been reduced from 2GiB to 1.5GiB (this is easy to modify).
The initial boot configuration in /boot/config.txt
has been somewhat changed. disable_overscan=1
has been commented out, as it was causing trouble for some users; similarly, hdmi_drive=2
has been commented out. The (unused) closed-source GPU memory allocation has been reduced too, to gpg_mem=16
(from 64), as it is not used by the open-source drivers on the image. As mentioned above, these are part of the files in /boot
now managed by the sys-boot/rpi3-64bit-firmware
package, and the default versions may be viewed there.
All packages have been brought up to date against the Gentoo tree, as of 9 July 2017.
If you are currently using a <1.1.0 release of the image and would like to take advantage of the userspace binhost and binary kernel autobuilds now provided, without switching directly to the 1.1.0 image, please follow the steps below (NB - those using this 1.1.0 release image directly should ignore what follows, as all of the below has already been done for you).
The following short-form instructions have been tested and verified to work, when starting from a 'vanilla' 1.0.2 release image. Obviously, you'll need to modify them to account for any changes you have made yourself (different installed packages etc.)
Open a terminal, and log in as root. Next, to maximize available memory during the upgrade, and to avoid issues when upgrading the GUI components, issue:
pi64 ~ # /etc/init.d/xdm stop
Then log in again as root, either at the text prompt, or over ssh
.
Next, update your rpi3
and sakaki-tools
repos, and install the porthash
repo verification tool:
pi64 ~ # emaint sync --repo rpi3
pi64 ~ # emaint sync --repo sakaki-tools
pi64 ~ # emerge -v --oneshot rpi3-check-porthash
Now set up your system to use the binhost's gentoo
ebuild repository (this will ensure the versions used when updating match the binary packages created by the binhost's weekly autobuild). Edit /etc/portage/repos.conf/gentoo.conf
and set it to:
[DEFAULT]
main-repo = gentoo
[gentoo]
location = /usr/portage
sync-type = rsync
auto-sync = yes
sync-uri = rsync://isshoni.org/gentoo-portage-pi64
Next, update your ebuild repositories, and switch to the bundled rpi3:default/linux/arm64/13.0/desktop/rpi3
profile:
pi64 ~ # eix-sync
pi64 ~ # eselect profile set rpi3:default/linux/arm64/13.0/desktop/rpi3
Then, clean up the redundant files in /etc/portage
(those that are now managed by the profile, for ease of maintenance going forward). Issue:
pi64 ~ # find /etc/portage/package.{accept_keywords,env,mask,unmask,use} -name 'zzz*' -prune -o -type f -exec rm {} \;
Take care to preserve any custom USE flags etc. you have set up yourself, before running the above command (unless they are set in the
zzz_via_autounmask
files, which will not be deleted).
As per-package licenses are not managed by the profile, you'll actually need to add to this set. Issue:
pi64 ~ # echo "sys-firmware/bcm4340a1-firmware Broadcom" > /etc/portage/package.license/bcm4340a1-firmware
pi64 ~ # echo "sys-kernel/bcmrpi3-kernel-bin freedist" > /etc/portage/package.license/bcmrpi3-kernel-bin
pi64 ~ # echo "sys-firmware/brcm43430-firmware Broadcom" > /etc/portage/package.license/brcm43430-firmware
pi64 ~ # echo "sys-kernel/linux-firmware freedist linux-firmware no-source-code" > /etc/portage/package.license/linux-firmware
pi64 ~ # echo "sys-boot/rpi3-64bit-firmware Broadcom raspberrypi-videocore-bin" > /etc/portage/package.license/rpi3-64bit-firmware
Next, edit your /etc/portage/make.conf
to use the isshoni.org binhost (and avoid re-specifying things now set by the profile); to do so, edit so it reads as follows (modify for your own requirements):
# Simple make.conf for 64-bit Raspberry Pi 3
# NB most settings now taken from the default/linux/arm64/13.0/desktop/rpi3
# profile
# See /usr/local/portage/rpi3/profiles/targets/rpi3/<...>
# You can override as desired in this file (/etc/portage/make.conf)
# (and via the other /etc/portage/<...> subdirectory entries)
# Some scripts looks for PORTDIR in make.conf explicitly
PORTDIR="/usr/portage"
# for use when compiling locally
MAKEOPTS="-j5 -l4"
EMERGE_DEFAULT_OPTS="--jobs=5 --load-average=4"
# for use with compiling with distcc only
#MAKEOPTS="-j8 -l4"
#EMERGE_DEFAULT_OPTS="--jobs=5 --load-average=4"
# per https://wiki.gentoo.org/wiki/Raspberry_Pi_VC4
VIDEO_CARDS="fbdev vc4"
INPUT_DEVICES="evdev synaptics"
# use (and verify) signed package snapshots
#FEATURES="${FEATURES} webrsync-gpg"
#PORTAGE_GPG_DIR="/etc/portage/gpg"
# uncomment to build binary packages as a byproduct of each emerge
# (these are useful backups) in /usr/portage/packages
FEATURES="${FEATURES} buildpkg"
# uncomment to disribute emerges, where possible, using distcc
#FEATURES="${FEATURES} distcc distcc-pump"
# uncomment to use binary packages from PORTAGE_BINHOST, where available,
# (and build normally, where not)
FEATURES="${FEATURES} getbinpkg"
PORTAGE_BINHOST="https://isshoni.org/pi64"
GENTOO_MIRRORS="http://gentoo.osuosl.org/ http://trumpetti.atm.tut.fi/gentoo/"
Preserve your current boot configuration and command line, if you have customized them:
pi64 ~ # cp /boot/cmdline.txt{,.orig}
pi64 ~ # cp /boot/config.txt{,.orig}
Then, create /etc/portage/package.use/rpi3-64bit-meta
, so it reads:
# disable any metapackage USE flags you want here, and then
# re-emerge dev-embedded/rpi3-64bit-meta to have the effect taken up
# e.g.:
#
# dev-embedded/rpi3-64bit-meta -weekly-genup -porthash
#
# (uncommented) to disable the automated weekly genup (package update)
# run, and to disable the requirement for a signature check on the
# isshoni.org rsync mirror
#
# by default, we accept all existing default metapackage flags: at the time
# of writing, those were:
#
# boot-fw : pull in the /boot firmware, configs and bootloader
# kernel-bin : pull in the binary kernel package
# porthash : pull in repo signature checker, for isshoni.org rsync
# weekly-genup: pull in cron.weekly script, to run genup automatically
If you don't want to use some of the metapackage features (weekly auto-update etc.) modify the above file to reflect this. In what follows though, I'm going to assume you're using the default USE flags for
rpi3-64bit-meta
, and so have left the above file as is, causing the metapackage to pull in the binary kernel, boot firmware etc. when emerged.
Next, decide whether you would rather use the default branch kernel (rpi-4.9.y
at the time of writing), or the 4.10.17 kernel (the latter is used on the 1.1.0 image). Both are bcmrpi3_defconfig
builds of the official raspberrypi/linux
tree.
To use the 4.10.17 kernel, create the file /etc/portage/package.unmask/bcmrpi3-kernel-bin
with the following text (as non-default-branch kernels are masked by default in the profile):
# Allow use of the 4.10 kernels, since these have working audio
# drivers for the RPi3
=sys-kernel/bcmrpi3-kernel-bin-4.10*
(Do nothing if you wish to use the default branch kernel, which is probably a safer choice if audio is not important to you (better backport support, weekly autoupdates of the binary kernel package available etc.).)
Then, remove the old start services:
pi64 ~ # rm /etc/local.d/autoexpand_root_partition.start
pi64 ~ # rm /etc/local.d/bluetooth.start
pi64 ~ # rm /etc/local.d/ondemand_freq_scaling.start
Now you are ready to emerge the rpi3-64bit-meta
metapackage, which will install the kernel, boot firmware etc.:
pi64 ~ # emerge -v1 portage
pi64 ~ # emerge -v rpi3-64bit-meta
This will take some time to complete (but you should see that all the packages being pulled in are binaries, if the preceding steps have been carried out correctly (other than the bcmrpi3-kernel-bin
package, which is not mirrored on the binhost, as it requires no local compilation)).
Warnings about possible file collisions may be ignored - it is just the installed packages overwriting your existing (as-yet-unowned-by-any-package) versions. (You can check for the "None of the installed packages claim the file(s)." message, to confirm this.)
If you receive a warning that the
sys-firmware/b43-firmware-6.30.163.46
package is masked, that may also be ignored; it will be downgraded to the recommended version shortly, when we rungenup
.
When it finishes, manually merge any changes from your /boot/config.txt.orig
and /boot/cmdline.txt.orig
into /boot/config.txt
and /boot/cmdline.txt
as necessary. (These latter two files are CONFIG_PROTECT
ed so any changes you make now will not be erased, even if sys-boot/rpi3-64bit-firmware
is subsequently upgraded or reinstalled.)
Configure the replacement startup services appropriately:
pi64 ~ # rc-update del autoexpand-root boot
pi64 ~ # rc-update add rpi3-bluetooth default
pi64 ~ # rc-update add rpi3-ondemand sysinit
Now bring the rest of your RPi3's software up to date - everything (other than packages you have added yourself) should be available as binary packages on the isshoni.org binhost. Issue:
pi64 ~ # genup
Note that even though using a binhost, this command will still take around an 2-4 hours to complete (depending on the speed of your network), due to the large number of packages being upgraded.
Your
gcc
compiler will have been upgraded as part of the above process, so please ensure you have a valid "starred" entry showing when you rungcc-config --list-profiles
; if not, refer to these notes on the Gentoo wiki, to fix it.
When done, merge any configuration file changes:
pi64 ~ # dispatch-conf
You will most likely be prompted about changes to six configuration files. You should discard (zap-new) suggested changes to
/etc/hosts
,/etc/issue
and/etc/sudoers
; you can safely accept (use-new) suggested changes to/etc/ssh/sshd_config
, and you should merge the other two (/etc/rc.conf
and/etc/syslog-ng/syslog-ng.conf
), keeping any non-comment edits from your old file (1) and accepting comment edits from the new file (2) (followed by u to accept the merged version of the file, of course). If you are prompted about changes to any other configuration files, just deal with them as you normally would during a Gentoo system update.
Next, augment your software set with some of the newly available packages from the binhost, if desired:
pi64 ~ # emerge -v libreoffice thunderbird gimp portage-distccmon-gui
This will take about 30 minutes to an hour to complete, depending on the speed of your network connection.
Finally, remove your old kernel module set, to save space:
pi64 ~ # rm -rf /lib/modules/4.10.0-rc5-v8
All done! Reboot your RPi3 - it should come back up successfully (with the Xfce GUI running again).
Now at the GUI, log in (if not using auto-login) as your regular user. There are two minor tweaks you should now make to finalize the update:
Compositor
tab, and ensure that Synchronize drawing to the vertical blank
is ticked. Alternatively, turn display compositing off. Your menus will flash annoyingly under the present VC4 configuration, if you do not do one of these two things.Application Autostart
tab, and Add a new item. Fill in an appropriate Name
and Description
(e.g., type Reload Desktop
in the first and Ensure desktop background displayed on login
in the second), and in the Command
field add /bin/bash -c "/usr/bin/sleep 7; /usr/bin/xfdesktop --reload"
. Click OK followed by Close. You should find the problem fixed on next login.And that's it, congratulations, you have completed the upgrade to 1.1.0!
You may of course emerge any other packages you want etc. at this point. Weekly auto-updating is (by default) active, but there is a week's grace after upgrading before the first auto-update is run.
Good luck, and please drop me a line ([email protected]) if you experience any problems.
Changes in this release:
autoexpand_root_partition.start
, to force-set root
and demouser
passwords on first boot.Changes in this release:
/etc/shadow
password timestamps predate the swclock
last shutdown time.wheel
group (includes demouser
) now have passwordless sudo access to all commands, for convenience during setup (added %wheel ALL=(ALL) NOPASSWD: ALL
in /etc/sudoers
).ondemand
mode (from default powersave
) by this script on startup (addresses #2).