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

Re: £50 reward: 64-bit Linux *any distro* on RPi3B+ with a KVM-enabled kernel!

Wed Apr 11, 2018 1:08 am

(* except some VC4 features won't work on 64bit, so really, 32 is better)
Wonder if Aarch64 would run in 3 cores and 32bit in the forth core as interface to the VC4 stuff?
Er, what? Please a read back what you have written - if you cannot understand what you are writing, neither can we! But to try and answer some of your seemingly random questions, but to make it more interesting, I've answered in a random order.
Sorry, my random thoughts are hard to follow unless you are in my head, I think faster than I type so full explanations are truncated :oops:
AWK and SED are not for writing apps. Use C/C++ or Python.
Actually AWK and SED are very useful for some apps, like extracting data from files or modifying files from shell script.
Even used it for live HTML5 server webpage updating ;)

I started in C, moved to python then went seemingly backwards to shell script/AWK/SED.
The reason was C and Python dependencies are hard to install behind University firewalls. "What virus checker are you putting on the Pi?"
Had to learn the old/hard way to write apps with just Kernel and busybox. Off track now.

Looking for a nice reliable Aarch64 OS where I can learn this newfangled 64bit/NEON stuff.
With Pi stuff going upstream it probably won't be long.
We don't advertise new products in advance.
Noted :D Does that mean there is a new CM3 with the new SoC package coming but you are not allowed to tell us now?
Actually that was a random thought, it just seemed a logical move to do for RPT for the industrial customers.
For embedded Pi's Aarch64 server makes more sense than Workstation except for that NEC TV thing.

Hmm now that Pi3B+ is out, RPT need to keep the hardware guys busy designing new stuff.
New CM and new LAN probably means new Eval dev kit? Just guessing ;)
If there is no RF on the CM then only the thermals need sorting? but if there is RF on new Eval kit than expect longer delay?
Don't have any CM's yet but the "new un-announched one" might be nice to play with 8-)

Speculation.
I hear Pink fluffy Unicorn's galloping nearer ;)
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

feelslikeautumn
Posts: 307
Joined: Wed Aug 09, 2017 9:51 pm

Re: £50 reward: 64-bit Linux *any distro* on RPi3B+ with a KVM-enabled kernel!

Wed Apr 11, 2018 7:24 am

gilius wrote:
Tue Apr 10, 2018 11:27 pm
feelslikeautumn wrote:
Tue Apr 10, 2018 11:09 pm
The generic arm64 kernels will have kvm I'm sure.
I am having a bit of trouble installing the generic kernels on there because if I do an apt-get update or apt-get install linux-image-xxxx or even try to install any app I get NOT FOUND for the ports.ubuntu.com repository. Does the sources.list need to be updated to something else?
Are you saying you have working internet?

gilius
Posts: 96
Joined: Sun Apr 08, 2018 1:12 pm

Re: £50 reward: 64-bit Linux *any distro* on RPi3B+ with a KVM-enabled kernel!

Wed Apr 11, 2018 7:50 am

feelslikeautumn wrote:
Wed Apr 11, 2018 7:24 am
gilius wrote:
Tue Apr 10, 2018 11:27 pm
feelslikeautumn wrote:
Tue Apr 10, 2018 11:09 pm
The generic arm64 kernels will have kvm I'm sure.
I am having a bit of trouble installing the generic kernels on there because if I do an apt-get update or apt-get install linux-image-xxxx or even try to install any app I get NOT FOUND for the ports.ubuntu.com repository. Does the sources.list need to be updated to something else?
Are you saying you have working internet?
Only on your old lubuntu image without kvm enabled.

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

Re: £50 reward: 64-bit Linux *any distro* on RPi3B+ with a KVM-enabled kernel!

Wed Apr 11, 2018 8:08 am

I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

feelslikeautumn
Posts: 307
Joined: Wed Aug 09, 2017 9:51 pm

Re: £50 reward: 64-bit Linux *any distro* on RPi3B+ with a KVM-enabled kernel!

Wed Apr 11, 2018 8:43 am

gilius wrote:
Wed Apr 11, 2018 7:50 am
Only on your old lubuntu image without kvm enabled.
Then it should work on a more modern distro. 17.04 isn't supported anymore that's why it fails to find packages. You would have to manually download and install them from Launchpad.net. I also don't know whether 17.04 contains pi related kvm patches.

gilius
Posts: 96
Joined: Sun Apr 08, 2018 1:12 pm

Re: £50 reward: 64-bit Linux *any distro* on RPi3B+ with a KVM-enabled kernel!

Wed Apr 11, 2018 10:08 am

Gavinmc42 wrote:
Wed Apr 11, 2018 8:08 am
viewtopic.php?f=63&t=208314&p=1300530#p1300530
https://github.com/sakaki-/gentoo-on-rpi3-64bit

Not sure if KVM enabled but it looks good.
Will test tonight - thanks!

gilius
Posts: 96
Joined: Sun Apr 08, 2018 1:12 pm

Re: £50 reward: 64-bit Linux *any distro* on RPi3B+ with a KVM-enabled kernel!

Wed Apr 11, 2018 10:11 am

feelslikeautumn wrote:
Wed Apr 11, 2018 8:43 am
gilius wrote:
Wed Apr 11, 2018 7:50 am
Only on your old lubuntu image without kvm enabled.
Then it should work on a more modern distro. 17.04 isn't supported anymore that's why it fails to find packages. You would have to manually download and install them from Launchpad.net. I also don't know whether 17.04 contains pi related kvm patches.
KVM is disabled, hence I was trying to install a different kernel that you suggested, which might have KVM enabled, but then I encountered the package download problems. I can't really work without updates working because I need to build Qemu-System-Aarch64 among other things, so maybe that's not a viable option. Will your 18 Arm64 release at the end of the month have KVM enabled?

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

Re: £50 reward: 64-bit Linux *any distro* on RPi3B+ with a KVM-enabled kernel!

Wed Apr 11, 2018 11:15 am

gilius wrote:
Wed Apr 11, 2018 10:08 am
Gavinmc42 wrote:
Wed Apr 11, 2018 8:08 am
viewtopic.php?f=63&t=208314&p=1300530#p1300530
https://github.com/sakaki-/gentoo-on-rpi3-64bit

Not sure if KVM enabled but it looks good.
Will test tonight - thanks!
Unfortunately, KVM is not enabled in the shipped gentoo-on-rpi3-64bit kernel, as it uses the "vanilla" upstream bcmrpi3_defconfig (which omits this feature). But, it isn't hard to create a custom binary kernel package supporting this. What exactly do you need turned on for your use case, CONFIG_KVM, CONFIG_VHOST_NET and CONFIG_VHOST_CROSS_ENDIAN_LEGACY?

gilius
Posts: 96
Joined: Sun Apr 08, 2018 1:12 pm

Re: £50 reward: 64-bit Linux *any distro* on RPi3B+ with a KVM-enabled kernel!

Wed Apr 11, 2018 11:47 am

sakaki wrote:
Wed Apr 11, 2018 11:15 am
gilius wrote:
Wed Apr 11, 2018 10:08 am
Gavinmc42 wrote:
Wed Apr 11, 2018 8:08 am
viewtopic.php?f=63&t=208314&p=1300530#p1300530
https://github.com/sakaki-/gentoo-on-rpi3-64bit

Not sure if KVM enabled but it looks good.
Will test tonight - thanks!
Unfortunately, KVM is not enabled in the shipped gentoo-on-rpi3-64bit kernel, as it uses the "vanilla" upstream bcmrpi3_defconfig (which omits this feature). But, it isn't hard to create a custom binary kernel package supporting this. What exactly do you need turned on for your use case, CONFIG_KVM, CONFIG_VHOST_NET and CONFIG_VHOST_CROSS_ENDIAN_LEGACY?
Just need /dev/kvm to appear - indicating that KVM is enabled, so that hosts running under qemu-system-aarch64 will be able to use hardware acceleration via the -enable-kvm flag. Another way to test is sudo kvm-ok. All the other commands I found only test for x86 or amd virtualization - doesn't apply to ARM64. So I don't know what that would equate to in terms of the features you list re: custom kernel packages - I am not qualified and have no experience with creating kernels - but any help would be much appreciated! My offer/incentive still stands.

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

Re: £50 reward: 64-bit Linux *any distro* on RPi3B+ with a KVM-enabled kernel!

Wed Apr 11, 2018 12:37 pm

OK, so for fun I just built a custom kernel with the above 3 options enabled, and /dev/kvm now shows up (on a 64-bit RPi3B+ Gentoo system booted under it).
I have no idea whether this will be usable for what you need, but I'll see if I can package it up, so you can at least try it out.
I'll post here again shortly.

sakaki

gilius
Posts: 96
Joined: Sun Apr 08, 2018 1:12 pm

Re: £50 reward: 64-bit Linux *any distro* on RPi3B+ with a KVM-enabled kernel!

Wed Apr 11, 2018 1:05 pm

sakaki wrote:
Wed Apr 11, 2018 12:37 pm
OK, so for fun I just built a custom kernel with the above 3 options enabled, and /dev/kvm now shows up (on a 64-bit RPi3B+ Gentoo system booted under it).
I have no idea whether this will be usable for what you need, but I'll see if I can package it up, so you can at least try it out.
I'll post here again shortly.

sakaki
Ok cool - thank you very much - look forward to it!

feelslikeautumn
Posts: 307
Joined: Wed Aug 09, 2017 9:51 pm

Re: £50 reward: 64-bit Linux *any distro* on RPi3B+ with a KVM-enabled kernel!

Wed Apr 11, 2018 2:06 pm

gilius wrote:
Wed Apr 11, 2018 10:11 am
feelslikeautumn wrote:
Wed Apr 11, 2018 8:43 am
gilius wrote:
Wed Apr 11, 2018 7:50 am
Only on your old lubuntu image without kvm enabled.
Then it should work on a more modern distro. 17.04 isn't supported anymore that's why it fails to find packages. You would have to manually download and install them from Launchpad.net. I also don't know whether 17.04 contains pi related kvm patches.
KVM is disabled, hence I was trying to install a different kernel that you suggested, which might have KVM enabled, but then I encountered the package download problems. I can't really work without updates working because I need to build Qemu-System-Aarch64 among other things, so maybe that's not a viable option. Will your 18 Arm64 release at the end of the month have KVM enabled?
There are two arm64 kernels in Ubuntu - raspi2 and generic. You can use either, but the generic has to be booted via uboot/grub2. You can try installing an 18.04 system - viewtopic.php?f=56&t=209763 . You need working Ethernet to do this.

gilius
Posts: 96
Joined: Sun Apr 08, 2018 1:12 pm

Re: £50 reward: 64-bit Linux *any distro* on RPi3B+ with a KVM-enabled kernel!

Wed Apr 11, 2018 4:07 pm

Without detailed instructions is too advanced for me, unfortunately.

feelslikeautumn
Posts: 307
Joined: Wed Aug 09, 2017 9:51 pm

Re: £50 reward: 64-bit Linux *any distro* on RPi3B+ with a KVM-enabled kernel!

Wed Apr 11, 2018 5:01 pm

gilius wrote:
Wed Apr 11, 2018 4:07 pm
Without detailed instructions is too advanced for me, unfortunately.
Kvm is pretty advanced stuff. Why exactly do you need it? This might seem harsh, but I can't help but think at the end of this, you are going to post "how do I use kvm?".

gilius
Posts: 96
Joined: Sun Apr 08, 2018 1:12 pm

Re: £50 reward: 64-bit Linux *any distro* on RPi3B+ with a KVM-enabled kernel!

Wed Apr 11, 2018 5:13 pm

feelslikeautumn wrote:
Wed Apr 11, 2018 5:01 pm
gilius wrote:
Wed Apr 11, 2018 4:07 pm
Without detailed instructions is too advanced for me, unfortunately.
Kvm is pretty advanced stuff. Why exactly do you need it? This might seem harsh, but I can't help but think at the end of this, you are going to post "how do I use kvm?".
That part i already know - I'm quite well versed with Qemu-kvm.

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

Re: £50 reward: 64-bit Linux *any distro* on RPi3B+ with a KVM-enabled kernel!

Wed Apr 11, 2018 5:16 pm

Hi again,

So, I have made a tweaked version of the current (v1.2.1) gentoo-on-rpi3-64bit image with a custom kernel, added a (baseline) build of app-emulation/qemu (aarch64 target only), and packaged this as a bootable 64-bit Gentoo image, suitable for the RPi3 B and B+.

You can download the custom bootable image from: https://isshoni.org/downloads/genpi64kvm.img.xz
A digital signature for the above is also available: https://isshoni.org/downloads/genpi64kvm.img.xz.asc

Download the image file, and then verify it (using the digital signature if you wish, otherwise for a quick check, the md5sum of genpi64kvm.img.xz is ac8db3ea5b2aa31818124f54ffff14fa, file length 1,231,294,884 bytes = ~1,174MiB). Please note that the image is provided "as is", and without warranty.

Once you have the image file downloaded, write it to a microSD card - the image is 7.31GiB == 7.85GB when decompressed, so should fit on any card marked as >= 8GB. However, a card of at least 16GB capacity is recommended (the root partition will be automatically expanded to fill the remaining space, on first boot). To write, either follow the "xzcat" instructions on my gentoo-on-rpi3-64bit GitHub page (sustituting the filename genpi64kvm.img.xz for genpi64.img.xz, obviously), or use a tool like Etcher (which is a nice, all-in-one cross-platform graphical tool for exactly this purpose; it's free and open-source).

Once you have the image written, insert the card in your RPi3 (B or B+) and follow the instructions entitled "Booting!", on the project's GitHub page. Note that the screen will be blank for around 10 seconds after the 'rainbow square' on each boot, until the VC4 graphics driver loads, and that the system will reboot automatically shortly after first startup (to allow the partition resizing to happen, this only happens once). After that, you should be automatically launched into a standard Xfce4 desktop session as "demouser".

The whole process (from first power on to graphical desktop) should take less than two minutes or so (on subsequent reboots, the resizing process will not run, so it will be significantly faster).

The initial root password on the image is raspberrypi64. The password for demouser is also raspberrypi64 (you can also do "sudo su --login root" to get a root prompt at the terminal, without requiring a password).

Good luck and let me know how it goes! For other usage details etc. see the project's GitHub page: apart from the modified kernel and additional qemu package, this should work just like the v1.2.1 standard image.

sakaki

PS: I don't know the details of your use case, so I can make no guarantees that this image will work for you. It's 64 bit, boots on a 3B+, and has "/dev/kvm" present, that's all I can say ^-^

PPS: Please don't try to upgrade the kernel package on the image - you'll end up overwriting the custom kernel if you do. There's no point in me going into more detail about this, until and unless you try it out and see if it works at all! The kernel is up-to-date against the official RPi tree as of today though, so e.g. the latest Ethernet fixes are present. The supplied kernel is 4.14.33, in standard "bcmrpi3_defconfig" trim (but with CONFIG_KVM, CONFIG_VHOST_NET and CONFIG_VHOST_CROSS_ENDIAN_LEGACY additionally enabled).

gilius
Posts: 96
Joined: Sun Apr 08, 2018 1:12 pm

Re: £50 reward: 64-bit Linux *any distro* on RPi3B+ with a KVM-enabled kernel!

Wed Apr 11, 2018 7:41 pm

Cheers, sakaki, for taking the time to do that! I appreciate your comprehensive write-up. Downloading now...

It would be interesting to document the process of how you were able to take that distribution, like any arm64 distribution, and repackage it with a KVM-enabled kernel. And, just out of curiosity, are there any guides published on the Internet right now that resemble the process you undertook? It's my belief that a lot of these Linux techniques are not particularly well known, documented, distributed or shared in the open. Knowledge is power, and perhaps people's careers depend on keeping certain things under wraps - in spite of the free open-source nature of the software. That's just my impression from researching guides, searching online for solutions to problems, and mingling with you guys.

Nevertheless, you ought to know the power of KVM! It does seem there is a lack of awareness in the Linux world about virtualization, for some reason, and once you turn on KVM a virtual machine can run at near-native speeds! As you know ARM64 is still relatively new and will be the future - with Intel/AMD surely being phased out, ala SSD vs. HDD. ARM64 virtualization has yet to be openly tested as it's still cutting edge, so to be honest I don't even know if it's going to work yet myself - and without the /dev/kvm part it DEFINITELY cannot work! I already paid £1,000 for the first ever ARM64 laptop, but had to return it to the shop because it wouldn't boot up any Linux live USB/DVDs - nor even any Windows ARM-based ISOs despite being shipped with that as a base OS! But I accept sakaki cannot offer me any warranty... no problem. So, in order to get an idea of what the future holds and to find out the truth about ARM64 virtualization, it's been necessary to take a few risks here and there - potentially losing some hard earned cash in the process - but it's worth it IMO.

Incidentally, this page is a very good introduction to what I am trying to achieve here:
https://wiki.ubuntu.com/ARM64/QEMU

"Ubuntu/arm64 can run inside the QEMU emulator. You can either do this fully emulated (e.g. on an x86 host) or, accelerated w/ KVM if you have an arm64 host."

"For accelerated VMs (arm64 host w/ KVM support)
$ sudo qemu-system-aarch64 -enable-kvm"


This company even exists as consultants:
http://www.virtualopensystems.com/en/so ... -on-armv8/

So this is a really interesting field to get into with great potential in terms of running Linux hypervisors on ARM processors now and in the future, and just reading the above it appears quite promising that sakaki's approach might be all that's required to harnish such power. Interestingly, back in 2014/2015, these guys were the first to ever get Windows 10 running on a Smart phone, albeit the ASUS Zenfone 2 because it's one of the few phones that has an Intel CPU; nevertheless, the same concepts still applied back then:
Here are the tools you will need to get this running yourself ( ZE551 ):
"1. KVM enabled kernel - http://forum.xda-developers.com/zenf...piled-t3145055
2. Linux chroot - the one I use is called Linux Deploy ( in the Play Store )
3. Spice client - the one I use is called aSPICE ( in the Play Store )
4. Root - kinda duh
...."

https://forum.xda-developers.com/zenfon ... m-t3153299

Anyway, we're certainly having to take baby steps here - and this could hopefully be the kickstart that KVM needs to progress in the ARM64 world - since there are currently no other hypervisors that can achieve this on ARM64 hardware! VMware is a cop out. I guarantee others are watching this topic right now and will be testing out this image even before me. Just check out what this guy had to say:
"This story begins how most stories begin, browsing github issues and tech forums to hope that someone is going or has gone through the process of getting a working kvm virtualization on the Raspberry Pi 3...
...If you are like me and have been searching le interwebs for this exact product this probably looked too good to be true but lo and behold here we are."

https://medium.com/@valdiz777/setting-u ... faddf02f48

I am also in contact with another guy who is eager to make in-roads with KVM on ARM64. I can't wait to test the image, and I already know that if I'm able to get it to boot up even, that the first problem I will encounter will be getting the following software installed, as I'm only experienced with Ubuntu/Debian:

https://download.qemu.org/qemu-2.12.0-rc2.tar.xz
sudo apt-get install libglib2.0-dev
sudo apt-get install libpixman-1-dev
sudo apt-get install libpixman-1-0
sudo apt-get install libsdl2-dev
sudo apt-get install autoconf
make a new subdirectory named build and cd to that dir
../configure --disable-vnc --enable-sdl --with-sdlabi=2.0
sudo make
sudo make install

Who can translate the above?
Debian/Ubuntu: apt-get install
to
Gentoo: emerge --ask app-

Of course, the final steps above is really all down to me - I can't expect sakaki to assist with that in addition to his previous efforts. Again, of primary concern here is getting any ARM64 distro to boot up on the Pi3b+ with ethernet support, GUI - operating sufficiently to run qemu-aarch-64 software; these are the only prerequisites to claiming the reward.

To date, the situation is looking like this:
Ubuntu: awaiting new 18.xx ARM64 version (hopefully with KVM enabled) because the Lubuntu image version is no longer supported and doesn't have KVM enabled anyway. I have used the 16.04 Xenial version as ARM64 minimal, but that never had KVM enabled, either.
Debian: boots up with KVM, but has no network card support and no GUI
Fedora: boots up partially, has no network card support and requires some undisclosed U-Boot command to run it in "Multi-user environment" instead of graphical. KVM status is unknown.
OpenSUSE: others have been successful in getting this to run on the Rpi3b+, but it was far too technical for me, so I gave up.
Gentoo - to be tested tonight

There have also been network card drivers posted, but no instructions on how they could be used to patch up Debian/Fedora.
Debian certanily did not detect the Wifi, but Fedora may end up detecting Wifi with that magic U-boot command.
USB Ethernet hubs have had mixed results - untested by myself.

Besides the above we don't really have any other ARM64 leads that are in a fit state for the B+, at least, such as Arch, Kali, CentOS, etc.

gilius
Posts: 96
Joined: Sun Apr 08, 2018 1:12 pm

Re: £50 reward: 64-bit Linux *any distro* on RPi3B+ with a KVM-enabled kernel!

Wed Apr 11, 2018 8:45 pm

Not out of the woods yet... but blimey... looking beautiful so far.... GOOD MAN!!! :D
gentoo.jpg
gentoo.jpg (93.26 KiB) Viewed 1408 times
sakaki obviously, obviously knows what he's doing...

User avatar
procount
Posts: 1694
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: £50 reward: 64-bit Linux *any distro* on RPi3B+ with a KVM-enabled kernel!

Wed Apr 11, 2018 9:11 pm

(Just so you know...Sakaki is female ;) )
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

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

Re: £50 reward: 64-bit Linux *any distro* on RPi3B+ with a KVM-enabled kernel!

Wed Apr 11, 2018 10:55 pm

(Just so you know...Sakaki is female ;) )
I did edit my post after I figured that out ;)

Likewise I have tried those other distributions but Sakaki's is the most impressive so far ;)
It comes with nearly everything as a Desktop :o

A minimal desktop version for development would be nice, ie smaller so playing and breaking it is easier to fix ;)

And now that KVM has been explained, that could be very interesting.
Getting into some interesting new territory to explore with Pi's.

2018 will be remembered as the year 64bit gets working on Pi3's. :D
$35 64bit PC's 8-)
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5860
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: £50 reward: 64-bit Linux *any distro* on RPi3B+ with a KVM-enabled kernel!

Thu Apr 12, 2018 10:03 am

Gavinmc42 wrote: 2018 will be remembered as the year 64bit gets working on Pi3's.
$35 64bit PC's
People have rolled 64bit kernels and userland for the pi since 2016, for example - viewtopic.php?t=143392. It's nothing new.

Not to take anything away from efforts to make 64bit distros more usable. It's one thing to be able to do it, it's another to actually do it properly and distribute it for everyone to use (as Sakaki, OpenSuse and Redhat are doing).

User avatar
B.Goode
Posts: 8239
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: £50 reward: 64-bit Linux *any distro* on RPi3B+ with a KVM-enabled kernel!

Thu Apr 12, 2018 10:12 am

And now that KVM has been explained, that could be very interesting.
Getting into some interesting new territory to explore with Pi's.

2018 will be remembered as the year 64bit gets working on Pi3's.


It will also be remembered as the year this reader learnt that "Keyboard, Video and Mouse" is not necessarily what 'KVM' stands for!

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

Re: £50 reward: 64-bit Linux *any distro* on RPi3B+ with a KVM-enabled kernel!

Thu Apr 12, 2018 10:54 am

People have rolled 64bit kernels and userland for the pi since 2016, for example - viewtopic.php?t=143392. It's nothing new.
There is a difference, just doing it and then doing it in a form that is easy to use for someone else.

I tried OpenSuse last year (er 2016, time flies) it took hours to get working, following instruction do this, then that .....
Got it going and then it crashed.
Opensuse forums are a pain to navigate :(
Er, my comment Jan 4th 2017.

Sakaki's way - download image, write to SD, boot and expand in Pi3, swap to Pi3B+ , Desktop still works ;)
It has gone from being a pain to easy.
It will also be remembered as the year this reader learnt that "Keyboard, Video and Mouse" is not necessarily what 'KVM' stands for!
I am glad someone explained that too :oops:

Some people just want to use Aarch64 on Pi's, not figure out how to roll their own version, that's for later, next year maybe?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

gilius
Posts: 96
Joined: Sun Apr 08, 2018 1:12 pm

Re: £50 reward: 64-bit Linux *any distro* on RPi3B+ with a KVM-enabled kernel!

Thu Apr 12, 2018 11:03 am

Not sure how sakaki was able to install that qemu-system-aarch64 because the process doesn't appear straightforward. Gentoo features a different software/package system compared to what I'm used to with Ubuntu/Debian - seems to attempt a compile and build of the latest versions every time using something called Portage/Emerge. I've been having a few issues getting some "dependencies" installed on there, which I would like to ensure are in place before I test aarch64:
https://forums.gentoo.org/viewtopic-t-1079782.html

I found this page quite interesting:
https://packages.gentoo.org/categories/app-emulation

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

Re: £50 reward: 64-bit Linux *any distro* on RPi3B+ with a KVM-enabled kernel!

Thu Apr 12, 2018 12:07 pm

gilius wrote:
Wed Apr 11, 2018 7:41 pm
It would be interesting to document the process of how you were able to take that distribution, like any arm64 distribution, and repackage it with a KVM-enabled kernel. And, just out of curiosity, are there any guides published on the Internet right now that resemble the process you undertook? It's my belief that a lot of these Linux techniques are not particularly well known, documented, distributed or shared in the open. Knowledge is power, and perhaps people's careers depend on keeping certain things under wraps - in spite of the free open-source nature of the software. That's just my impression from researching guides, searching online for solutions to problems, and mingling with you guys.

As to documentation, there isn't a single path that will suit everyone, but here are some pointers that may help if you want to deep dive...

First of all, if you haven't done so already, and you can afford to block out the time, I strongly recommend running through a Linux from Scratch install, as a learning exercise. It's easiest to do this on an old laptop or similar (or you can even do it on a VM on a PC) - while LFS does support various embedded targets, staring at a swapping compiler isn't perhaps the most educational part of the process ^-^. The manual for LFS is fantastic - if you can stick it through to the end, you'll learn a lot about how a Linux system works under the hood.

Next, I have written an end-to-end install guide for Gentoo Linux ("Sakaki's EFI Install Guide"), as a sort of augmented version of the Gentoo Handbook. Again, this is PC-focussed, but I blend in tutorial sections on things like Portage (Gentoo's package management system), building custom kernels, installing GNOME / XWayland, setting up secure boot, using firejail to properly isolate vulnerable apps etc., many of which have at least some application in the SBC domain. So that might be worth a look, particularly if you intend staying with Gentoo longer term, and would like to understand its system construction mechanics sufficiently to bend them to your own will (kind of the point of running Gentoo in the first place, it describes itself as a "metadistribution" after all ^-^).

Then, wrt this particular target (64-bit RPi3 B / B+)... actually Gentoo, being primarily a source-based distro where the average user has something of a "tinkering" mindset, tends to have pretty good sharing of info about architecture build-outs, and this case is no exception.

For example, also on the Gentoo Wiki, NeddySeagoon has an excellent page which covers building a 64-bit RPi3 system from scratch, here.

That was basically the process I followed originally for the baseline gentoo-on-rpi3-64bit system, but then I packaged the various platform-specific tweaks as OpenRC services (details here), the ebuilds for which live in this overlay. And I set up a custom profile to cover the various keywording, USE flags etc. needed to get a clean build (the profile files can be reviewed here).

Also, for the RPi3 B+, I needed to make some additional changes, covered in this post on the project's sticky thread on the Gentoo Forums.

As regards build setup, I use a distcc system which offloads compilation to a crossdev toolchain (Gentoo's cross-compiler framework) on a PC; I have instructions for setting this up on the gentoo-on-rpi3-64bit project's wiki, along with instructions on how to e.g. build an RPi3 kernel directly on your PC (this is how I created your custom kernel, incidentally). There is also a section on building a custom kernel on your RPi3 itself on the gentoo-on-rpi3-64bit GitHub page, here (be prepared for 4-5 hour build time though, if you don't use distcc).

Once the system is built I have a custom script to "clean" it and prepare a vanilla image; that's the only bit that isn't currently public, but it is fairly mature now, so I may publish it at some stage; in any event if you are only building out a system for local use, you don't need this.

Lastly, I have set up an automated build server covering the project's userland and kernel, to allow users to keep their system up-to-date via binary packages should they choose. Some details about this may be found here.

Hope that helps - if you have have any problems using Gentoo, just ask (either here, or you can post in the project's sticky thread on the Gentoo forum; we don't bite!)
gilius wrote:
Wed Apr 11, 2018 7:41 pm
sudo apt-get install libglib2.0-dev
sudo apt-get install libpixman-1-dev
sudo apt-get install libpixman-1-0
sudo apt-get install libsdl2-dev
sudo apt-get install autoconf
This being Gentoo, I've shipped all the dev libraries and tools you need to build all of the end-user binaries on the image, on the image ^-^
A full set of the supplied packages may be viewed here (the version numbers are from the Gentoo ebuilds, but these normally map 1-to-1 onto the upstream versions).
procount wrote:
Wed Apr 11, 2018 9:11 pm
(Just so you know...Sakaki is female ;) )
I've learnt to take things like "good man" as a compliment online tbh (& no one's yet made the mistake when they meet me in person lol) ^-^

Return to “General discussion”