User avatar
sakaki
Posts: 381
Joined: Sun Jul 16, 2017 1:11 pm

Bootable 64-bit Gentoo image for the RPi4 released (Xfce4 desktop)

Mon Aug 19, 2019 9:50 am

Note to mods: I normally avoid anything that sails close to cross-posting, but since there's been quite a bit of engagement - in various threads - on this General discussion forum recently regarding running the RPi4 in 64-bit mode (either kernel, or kernel+userland), and I'm not sure how many people here closely follow the goings on in the Operating system distributions -> Other -> Gentoo oubliette ^-^, I thought it'd be worth a quick, one-off announce post here for information's sake. Thanks!

Hello,

If you have an RPi4, and would like to try running under it under a 64-bit (kernel+userland) OS (whether for comparative benchmarking, access to aarch64-only packages, or just out of curiosity), you might like to check out my recently released gentoo-on-rpi-64bit bootable image (downloadable from GitHub, here).

Here's a screenshot of the 64-bit image running on a dual-display RPi4 B (click to show a higher resolution view):

Image

You can burn the image (~1,643MiB compressed) to a microSD card (>=16GB) (either from the command line, or using a GUI tool like Etcher), then boot your RPi4B (RPi3B/B+ also supported) from it directly (the root partition will be automatically resized to fill the card on first boot). Full instructions for download and use are provided on the project's GitHub page.

Although this is Gentoo, the image boots - without configuration - to an Xfce4 desktop, so it is easy to start it up and play around with it.

It also comes bundled with a reasonable set of pre-installed aarch64 packages (LibreOffice v6.3.0.4, Firefox Quantum v68.0.1, Chromium v76.0.3809.87, Thunderbird v60.8.0, VLC v3.0.7.1, Kodi v18.0, GIMP v2.10.12 etc.) so that you can get productive without having to compile anything first! Unless you want to, of course; this being Gentoo, GCC v9.1.0, Clang v8.0.1, IcedTea v3.13.0 (OpenJDK 8), Go v1.12.7, Rust v1.36.0 and various versions of Python are of course bundled also ^-^

Thanks to rapid upstream progress on aarch64 kernel work for the new board, there are surprisingly few compromises required when running the Pi4 under a 'pure' 64-bit OS such as this one. Specifically, for the Pi4 in this 1.5.0 release:
  • V3D graphics acceleration is supported in X under vc4-fkms-v3d / Mesa;
  • the full 4GiB complement of memory is usable (if you are lucky enough to own a top-of-the-line model, that is ^-^);
  • the V4L2 M2M video codecs and optional plug-in camera module are both usable;
  • use of dual HDMI displays is supported;
  • Bluetooth, fast Ethernet, and dual-band WiFi work.
Lastly, this is just an announce post: please report any bugs or issues to the project's main thread, which lives in the Operating system distributions -> Other -> Gentoo sub-board, here.

Have fun ^-^

sakaki

User avatar
bomblord
Posts: 174
Joined: Sun Jul 14, 2019 2:54 am

Re: Bootable 64-bit Gentoo image for the RPi4 released (Xfce4 desktop)

Mon Aug 19, 2019 11:19 am

The only downside I see is I have to wait until I get home to try it.

sparkyhall
Posts: 145
Joined: Mon Aug 27, 2012 9:14 am

Re: Bootable 64-bit Gentoo image for the RPi4 released (Xfce4 desktop)

Mon Aug 19, 2019 7:46 pm

Thanks Sakaki, it's working really well here.

My first time using Gentoo so I've got some reading to do, I really appreciate the image and first class instructions you have provided, probably never have tried Gentoo without this. I'm amazed at how much smoother the scrolling is in Firefox when compared to Firefox in Raspian.

Well done,

Chris

MikeDB
Posts: 108
Joined: Sun Oct 12, 2014 8:27 am

Re: Bootable 64-bit Gentoo image for the RPi4 released (Xfce4 desktop)

Mon Aug 19, 2019 8:43 pm

Looks very interesting but before I begin what is obviously a major download and install, could somebody tell me how long it takes to shutdown on a Pi4 ? Proper 64 bits is definitely what I need but I only have a limited backup supply keeping the processor going when the cord is pulled (which it will be in my application).
Please write out 100 times "Linux is not a real time operating system so I will not suggest it is"

User avatar
sakaki
Posts: 381
Joined: Sun Jul 16, 2017 1:11 pm

Re: Bootable 64-bit Gentoo image for the RPi4 released (Xfce4 desktop)

Mon Aug 19, 2019 9:36 pm

MikeDB wrote:
Mon Aug 19, 2019 8:43 pm
Looks very interesting but before I begin what is obviously a major download and install, could somebody tell me how long it takes to shutdown on a Pi4 ? Proper 64 bits is definitely what I need but I only have a limited backup supply keeping the processor going when the cord is pulled (which it will be in my application).
On a stock RPi4 here, 12 seconds (unscientifically measured via stopwatch ^-^) from "sudo shutdown" issued at an Xfce4 terminal window on the 1.5.0 image, to the board fully powered down.

About a second less (11 seconds or so) from a non-graphical login.

hth, sakaki

MikeDB
Posts: 108
Joined: Sun Oct 12, 2014 8:27 am

Re: Bootable 64-bit Gentoo image for the RPi4 released (Xfce4 desktop)

Tue Aug 20, 2019 1:38 pm

sakaki wrote:
Mon Aug 19, 2019 9:36 pm
MikeDB wrote:
Mon Aug 19, 2019 8:43 pm
Looks very interesting but before I begin what is obviously a major download and install, could somebody tell me how long it takes to shutdown on a Pi4 ? Proper 64 bits is definitely what I need but I only have a limited backup supply keeping the processor going when the cord is pulled (which it will be in my application).
On a stock RPi4 here, 12 seconds (unscientifically measured via stopwatch ^-^) from "sudo shutdown" issued at an Xfce4 terminal window on the 1.5.0 image, to the board fully powered down.

About a second less (11 seconds or so) from a non-graphical login.

hth, sakaki
Thanks - I'll look for a UPS with at least 15-20 seconds then
Please write out 100 times "Linux is not a real time operating system so I will not suggest it is"

MikeDB
Posts: 108
Joined: Sun Oct 12, 2014 8:27 am

Re: Bootable 64-bit Gentoo image for the RPi4 released (Xfce4 desktop)

Tue Aug 20, 2019 1:45 pm

Sorry to have to ask, but could you also say what command line options you use with GCC to get proper 64 bit only code images.

I've seen various comments and suggestions around which tend to vary, but it seems like you actually have it working properly so obviously must be doing it correctly.
Please write out 100 times "Linux is not a real time operating system so I will not suggest it is"

User avatar
sakaki
Posts: 381
Joined: Sun Jul 16, 2017 1:11 pm

Re: Bootable 64-bit Gentoo image for the RPi4 released (Xfce4 desktop)

Tue Aug 20, 2019 3:41 pm

MikeDB wrote:
Tue Aug 20, 2019 1:45 pm
Sorry to have to ask, but could you also say what command line options you use with GCC to get proper 64 bit only code images.

I've seen various comments and suggestions around which tend to vary, but it seems like you actually have it working properly so obviously must be doing it correctly.
Sure; per the project's README:

Code: Select all

[...] the CFLAGS used for the image build is "-march=armv8-a+crc -mtune=cortex-a72 -O2 -pipe" [...]
You can also verify the build settings in make.defaults in the image's custom profile, here.

The kernel used is also 64-bit (as it has to be on ARMv8-A to host an unemulated 64-bit userspace): created, for the RPi4, via this autobuild (you can find more details there).

But pinky-promise it's all pure 64-bit ^-^ (take a look at the output of "uname --all" and "file $(which ls)" in the screenshot above).

hth,

sakaki

pica200
Posts: 140
Joined: Tue Aug 06, 2019 10:27 am

Re: Bootable 64-bit Gentoo image for the RPi4 released (Xfce4 desktop)

Tue Aug 20, 2019 4:11 pm

I was about to recommend adding +simd to the -march part but then i realized it's on by default on ARMv8-A: https://gcc.gnu.org/onlinedocs/gcc-9.1. ... 64-Options

MikeDB
Posts: 108
Joined: Sun Oct 12, 2014 8:27 am

Re: Bootable 64-bit Gentoo image for the RPi4 released (Xfce4 desktop)

Wed Aug 21, 2019 12:08 am

sakaki wrote:
Tue Aug 20, 2019 3:41 pm
MikeDB wrote:
Tue Aug 20, 2019 1:45 pm
Sorry to have to ask, but could you also say what command line options you use with GCC to get proper 64 bit only code images.

I've seen various comments and suggestions around which tend to vary, but it seems like you actually have it working properly so obviously must be doing it correctly.
Sure; per the project's README:

Code: Select all

[...] the CFLAGS used for the image build is "-march=armv8-a+crc -mtune=cortex-a72 -O2 -pipe" [...]
You can also verify the build settings in make.defaults in the image's custom profile, here.

The kernel used is also 64-bit (as it has to be on ARMv8-A to host an unemulated 64-bit userspace): created, for the RPi4, via this autobuild (you can find more details there).

But pinky-promise it's all pure 64-bit ^-^ (take a look at the output of "uname --all" and "file $(which ls)" in the screenshot above).

hth,

sakaki
Great thanks. Will start a Gentoo download to a fresh memory card tomorrow and then compile my current Pi4 project and see if/how much faster it runs as it uses lots of Int64_t variables.
Please write out 100 times "Linux is not a real time operating system so I will not suggest it is"

User avatar
bomblord
Posts: 174
Joined: Sun Jul 14, 2019 2:54 am

Re: Bootable 64-bit Gentoo image for the RPi4 released (Xfce4 desktop)

Wed Aug 21, 2019 1:16 am

Awesome stuff! I have it installed and working but I've noticed a few... let's say oddities.

Probably the weirdest is my nearby speakers start popping and crackling (at one point I swore I heard a dialup modem noise) after setting the wi-fi to US.

Also I can't seem to connect to my otherwise accessible 5ghz network the connection times out (that works in raspbian)

This part is probably just me having no clue how gentoo works but I can't seem to sudo apt install (says not available on iced tea) and I'm stuck as a "demo user"
Last edited by bomblord on Wed Aug 21, 2019 1:26 am, edited 3 times in total.

User avatar
sakaki
Posts: 381
Joined: Sun Jul 16, 2017 1:11 pm

Re: Bootable 64-bit Gentoo image for the RPi4 released (Xfce4 desktop)

Wed Aug 21, 2019 1:23 am

bomblord wrote:
Wed Aug 21, 2019 1:16 am
Awesome stuff! I have it installed and working but I've noticed a few... let's say oddities.

Probably the weirdest is my nearby speakers start popping and crackling (at one point I swore I heard a dialup modem noise) after setting the wi-fi to US.

Also I can't seem to connect to my otherwise accessible 5ghz network (that works in Raspbian)

This part is probably just me having no clue how gentoo works but I can't seem to sudo apt install and I'm stuck as a "demo user"
Thanks for the report! I've no idea about the interference issue ><
As to 5GHz, it works on my UK setup but possible there are some WiFi config or firmware differences in the latest Raspbian (wrt what I shipped). I'll check. Should be an easy fix if so.
Best,
sakaki

User avatar
Gavinmc42
Posts: 3918
Joined: Wed Aug 28, 2013 3:31 am

Re: Bootable 64-bit Gentoo image for the RPi4 released (Xfce4 desktop)

Thu Aug 22, 2019 10:32 am

Sakaki, how do I get a file manager to open when a USB reader uSD card is inserted?
In the settings menu there is the removable drives and media settings but they don't seem to do anything.
ls /dev shows sda/sda1/sda2 when inserted, no sda when pulled out.

I would like to use file manager to copy files from another Gentoo64 uSD.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
sakaki
Posts: 381
Joined: Sun Jul 16, 2017 1:11 pm

Re: Bootable 64-bit Gentoo image for the RPi4 released (Xfce4 desktop)

Thu Aug 22, 2019 2:53 pm

Gavinmc42 wrote:
Thu Aug 22, 2019 10:32 am
Sakaki, how do I get a file manager to open when a USB reader uSD card is inserted?
In the settings menu there is the removable drives and media settings but they don't seem to do anything.
ls /dev shows sda/sda1/sda2 when inserted, no sda when pulled out.

I would like to use file manager to copy files from another Gentoo64 uSD.
Do normal USB sticks automount when you insert them? Does a dimmed out icon appear on your desktop?

You can always use Accessories -> Disks; when the drive is inserted it will appear there; click the partition you want then click the "play" symbol to mount it - you can then click the blue underlined link that appears to open the partition's filesystem in a file manager window.

Best, sakaki

ejolson
Posts: 3720
Joined: Tue Mar 18, 2014 11:47 am

Re: Bootable 64-bit Gentoo image for the RPi4 released (Xfce4 desktop)

Thu Aug 22, 2019 4:49 pm

sakaki wrote:
Mon Aug 19, 2019 9:50 am
If you have an RPi4, and would like to try running under it under a 64-bit (kernel+userland) OS (whether for comparative benchmarking, access to aarch64-only packages, or just out of curiosity), you might like to check out my recently released gentoo-on-rpi-64bit bootable image (downloadable from GitHub, here).
Thank you for your pioneering work to make a 64-bit operating system image. It appears stable and crash free.

As discussed in this post and what follows, the version of Python 3 included on the 64-bit Gentoo image seems unusually slow compared to Raspbian. I'm just drawing your attention to that thread, in case you hadn't noticed already.

User avatar
sakaki
Posts: 381
Joined: Sun Jul 16, 2017 1:11 pm

Re: Bootable 64-bit Gentoo image for the RPi4 released (Xfce4 desktop)

Thu Aug 22, 2019 5:44 pm

ejolson wrote:
Thu Aug 22, 2019 4:49 pm
Thank you for your pioneering work to make a 64-bit operating system image. It appears stable and crash free.

As discussed in this post and what follows, the version of Python 3 included on the 64-bit Gentoo image seems unusually slow compared to Raspbian. I'm just drawing your attention to that thread, in case you hadn't noticed already.
Thanks, as noted there, performance difference quite likely due to the fact that the 1.5.0 image uses a v3.6.9 Python 3, whereas Buster has v3.7.3. In the process of building the newer release now on the binhost.

Best, sakaki

User avatar
Gavinmc42
Posts: 3918
Joined: Wed Aug 28, 2013 3:31 am

Re: Bootable 64-bit Gentoo image for the RPi4 released (Xfce4 desktop)

Thu Aug 22, 2019 11:33 pm

Do normal USB sticks automount when you insert them? Does a dimmed out icon appear on your desktop?
No automount icon
Accessories -Disk worked.

Timezone change how?
Figured out the keyboard ;)
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
Gavinmc42
Posts: 3918
Joined: Wed Aug 28, 2013 3:31 am

Re: Bootable 64-bit Gentoo image for the RPi4 released (Xfce4 desktop)

Fri Aug 23, 2019 6:02 am

Timezone -tick :D

Add OpenSCAD to the list of what works.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
bleep42
Posts: 156
Joined: Wed Mar 07, 2012 12:43 pm
Location: Sussex

Re: Bootable 64-bit Gentoo image for the RPi4 released (Xfce4 desktop)

Fri Aug 23, 2019 1:47 pm

Hi Sakaki,
Fantastic achievement, well done :-)
Considering the amount of racket that certain people are making about the 'new Pi4' not having a 64bit operating system, I was expecting your thread to be heaving with activity, (echo) clearly they don't really care, can't be bothered, are just being a pain in the bum for the hell of it.......
Anyway, I have installed your 64bit Gentoo image onto my Pi4 and it all works very well thank you for all of your effort; the only thing I've had a problem with and I expected it to be a problem, was a C Mandelbrot program I wrote, which I compiled successfully, but crashes, I knew it would as it writes directly to /dev/fb0.
Otherwise everything I have tried works as expected, speed difference, as expected, none.
Again a brilliant piece of work.
Regards, Kevin.

geev03
Posts: 131
Joined: Thu Jun 07, 2012 12:40 pm
Location: London, UK

Re: Bootable 64-bit Gentoo image for the RPi4 released (Xfce4 desktop)

Mon Aug 26, 2019 5:19 pm

Docker is opening up new areas of exploration. Looked for a WoA -Windows 10 docker image to run on a RPi4B-4GB and ,apparently , there is none available . Then saw this ....
you can efficiently run additional guest operating systems on your 64-bit Gentoo RPi3/4, using QEMU virtualization with KVM acceleration (much as you might use, say, VirtualBox on a PC).
So, is it possible to run a WoA-Windows 10 1903/ KVM in the light of this, https://forums.theregister.co.uk/forum/ ... 10_on_kvm/, ?

Leeloo
Posts: 46
Joined: Fri Oct 06, 2017 9:53 pm

Re: Bootable 64-bit Gentoo image for the RPi4 released (Xfce4 desktop)

Tue Aug 27, 2019 2:25 am

wondering does this open possibilities of other 64 distributions being made? or maybe more was there any obstacles stopping other distributions being made full 64 bit?

User avatar
Gavinmc42
Posts: 3918
Joined: Wed Aug 28, 2013 3:31 am

Re: Bootable 64-bit Gentoo image for the RPi4 released (Xfce4 desktop)

Tue Aug 27, 2019 2:51 am

wondering does this open possibilities of other 64 distributions being made? or maybe more was there any obstacles stopping other distributions being made full 64 bit?
Yes, other distributions are now possible, but it requires someone to do it with some Linux skills.

I don't think old versions like Ubuntu 18 will be easy.
Lots of the new GPU stuff is in the later releases, 19+.
They will need latest Mesa3D and recent kernels.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

Leeloo
Posts: 46
Joined: Fri Oct 06, 2017 9:53 pm

Re: Bootable 64-bit Gentoo image for the RPi4 released (Xfce4 desktop)

Tue Aug 27, 2019 3:16 am

I did a little poking around so gentoo (and others) are possible because of the UEFI firmware thing ? or something else ? thanks :3

User avatar
sakaki
Posts: 381
Joined: Sun Jul 16, 2017 1:11 pm

Re: Bootable 64-bit Gentoo image for the RPi4 released (Xfce4 desktop)

Tue Aug 27, 2019 10:36 am

geev03 wrote:
Mon Aug 26, 2019 5:19 pm
Docker is opening up new areas of exploration. Looked for a WoA -Windows 10 docker image to run on a RPi4B-4GB and ,apparently , there is none available . Then saw this ....
you can efficiently run additional guest operating systems on your 64-bit Gentoo RPi3/4, using QEMU virtualization with KVM acceleration (much as you might use, say, VirtualBox on a PC).
So, is it possible to run a WoA-Windows 10 1903/ KVM in the light of this, https://forums.theregister.co.uk/forum/ ... 10_on_kvm/, ?
Windows not really my thing tbh, but gilius2k15 has a post here that may be of interest. QEMU with KVM is already installed on the current v1.5.0 Gentoo release (his linked instructions are for Ubuntu, but should work, mutatis mutandis, on Gentoo also).

hth, sakaki

geev03
Posts: 131
Joined: Thu Jun 07, 2012 12:40 pm
Location: London, UK

Re: Bootable 64-bit Gentoo image for the RPi4 released (Xfce4 desktop)

Tue Aug 27, 2019 9:20 pm

sakaki wrote:
Tue Aug 27, 2019 10:36 am


Windows not really my thing tbh, but gilius2k15 has a post here that may be of interest. QEMU with KVM is already installed on the current v1.5.0 Gentoo release (his linked instructions are for Ubuntu, but should work, mutatis mutandis, on Gentoo also).

hth, sakaki
Sakaki, thanks a lot for the link. The details there can be useful in my attempt to check if Windows 10 (WoA) can run on pi64.

Return to “Gentoo”