Most direct (but slightly buggy) way to get Ubuntu-MATE 18.04 on Pi 4.
These procedures were written and validated on 11 August 2019 and used a
laptop with Ubuntu-MATE 18.04 (AMD64 version) as a workstation to store
files and manipulate images, and a Raspberry Pi 3 (not B+ although that
should be Ok as well) as a temporary install machine. I used the most
recent ubuntu-MATE image for 32-bit Raspberry Pi3 which is:
ubuntu-mate-18.04.2-beta1-desktop-armhf+raspi-ext4.img (uncompressed) and
the Raspbian Buster install (updated to kernel 4.19-58). Any instances of
'' refer to your local user account name, and the procedures assume
that you work from your local home directory.
Install and update Raspbian on your Pi 4 per Raspberry Pi instructions.
After all files are updated, insert the microSD card in a computer (I used a
Ubuntu-MATE AMD64 installation with a SD-to-microSD adapter so that the
system is mounted on /media//boot and /media//rootfs). In your
local workspace create three directories; 'Boot', 'libModules' and
'libFirmware' and copy files from the microSD card to these directories as:
Umount and remove the Raspbian installation. Insert a microSD card on
which to install Ubuntu-MATE and unmount any partitions that automount with
commands such as: sudo umount /dev/mmcblk0p1
Assuming you have already downloaded the Ubuntu-MATE 32-bit image as
cited above, install it on the microSD card (I use the old, slow way with: sudo dd if=ubuntu-mate-18.04.2-beta1-desktop-armhf+raspi-ext4.img of=/dev/mmcblk0 bs=1024K)
When complete, remove the card and install it in
a Raspberry Pi 3. Boot the machine and complete the installation and
configuration as you desire. When you are satisfied with the configuration,
power down the Raspberry Pi, remove the microSD card and mount it in your
workstation.
The directory structure of Raspbian and Ubuntu-MATE differ particularly
in the /boot partition and we will clear out some of the Ubuntu-MATE
structure to allow the Pi 4 to boot. First clean out some files not needed
in the final product:
Using your favorite editor (after the 'jstar' variant of 'joe', I use
vim.tiny), edit /media/<user>/system-boot/cmdline.txt and replace the
PARTUUID value in the line with the value you just read above which ends
with '-02'. This tells the Raspbian boot sequence where to find the Root
partition. We will keep the LABEL references in the /etc/fstab image for
now, so there is no need to edit that file for the PARTUUID, but you do need
to edit it to reflect the correct /boot reference, so edit /media/<user>/writable/etc/fstab and change the entry reading
'/boot/firmware' to just '/boot'.
We also need to disable the accelerated graphics on the Pi4 since the
version of Mesa in Ubuntu 18.04 is too old. Do this by editing /media/<user>/system-boot/config.txt and commenting out (by placing a '#'
in front of) the line near the end: 'dtoverlay=vc4-fkms-v3d'. If you do not
/do this, you will be restricted to command-line only. (NOTE: this makes it
the same as the line in the [all] section)
Now you are ready for the big smoke test. Insert the microSD card in your
Pi4 and turn it on! Have patience since there is a lot going on behind the
scenes in the system. You should first see the 4 Raspberries, then the
Raspbian scripts followed by a quick switch to the Ubuntu-MATE symbol and then
a blank screen for a couple of minutes before the login screen appears. I
don't know why the delay is happening, but this does give you a way to get
Ubuntu-MATE 18.04 up on a Raspberry Pi 4.
After the seemingly interminable wait, you may now log into the system and
have a functioning system just as you configured on the Pi 3 system. You
will need to reconfigure the wifi (if used) since the new hardware will not
recognize the earlier Pi 3 configuration.
Second and longer method of getting Ubuntu-MATE 18.04 on Raspberry Pi 4.
These procedures were written and validated on 11 August 2019 and used a
laptop with Ubuntu-MATE 18.04 (AMD64 version) as a workstation to store
files and manipulate images, and a Raspberry Pi 3 (not B+ although that
should be Ok as well) as a temporary install machine. In order to duplicate
the procedure I used for real, I started with an old system which was on my
Raspberry 3 and 3+ workstations over the past few years. I found an
Ubuntu-MATE image for 16.02.2 and installed it on a microSD card, installed
in a Pi 3 and configured it to resemble my original system.
I had updated my system to 18.04 on line which necessitates expanding the
/boot partition. To do this, mount the microSD card on your workstation and
use 'gparted' to adjust partitions in the following order:
- adjust the start of mmcblk0p2 upward by approx 130-170 MB
- adjust the end of mmcblk0p1 upward to fill the freed space
Now re-insert the microSD card back in the Pi3 and execute:
sudo do-release-upgrade
and follow the prompts to upgrade to bionic beaver (18.04). When finished,
reboot the system and insure that everything is as you configured. If Ok,
you are now ready to prepare the micro-SD card for booting on a Pi 4.
Install and update Raspbian on your Pi 4 per Raspberry Pi instructions.
After all files are updated, insert the microSD card in a computer (I used a
Ubuntu-MATE AMD64 installation with a SD-to-microSD adapter so that the
system is mounted on /media//boot and /media//rootfs). In your
local workspace create three directories; 'Boot', 'libModules' and
'libFirmware' and copy files from the microSD card to these directories as:
Umount and remove the Raspbian installation. Insert the microSD card
with Ubuntu-MATE 18.04 into your workstation and you should see the two
partitions mounted as; /media//PI_BOOT and /media//PI_ROOT.
Since the directory structure of this upgraded image is similar to that
of Raspbian, we can simply replace parts of this image with the locally
saved Raspbian contents. Start by cleaning out some files not needed
in the final product:
Now we need to tell the new image where to find files, so we need the
identification of the new image partitions. I ran: ls -lF /dev/disk/by-partuuid
which resulted in the following for the microSD card partitions:
Using your favorite editor (after the 'jstar' variant of 'joe', I use
vim.tiny), edit /media/<user>/PI_BOOT/cmdline.txt and replace the
PARTUUID value in the line with the value you just read above which ends
with '-02'. This tells the Raspbian boot sequence where to find the Root
partition. We will keep the /dev/mmcblk0p1 and p2 references in the /etc/fstab image for now, so there is no need to edit that file.
We also need to disable the accelerated graphics on the Pi4 since the
version of Mesa in Ubuntu 18.04 is too old. Do this by editing /media/<user>/PI_BOOT/config.txt and commenting out (by placing a '#'
in front of) the line near the end: 'dtoverlay=vc4-fkms-v3d'. If you do not
/do this, you will be restricted to command-line only. (NOTE: this makes it
the same as the line in the [all] section)
Now you are ready for the big smoke test. Insert the microSD card in your
Pi4 and turn it on! You should first see the 4 Raspberries, then the
Raspbian boot scripts and then the Ubuntu-MATE splash screen and progress
bar. Then that is done you should be presented with the login screen. You
will need to reconfigure wifi (if used) since the hardware differs from that
configured on the Pi 3, but you should now have Raspbian 18.04.3 up and
running on a Pi 4.
Thanks Hal for posting detailed step by step guide ... I avoid for now buying a Raspberry Pi 4, knowing no Ubuntu Mate ready image, but with your guide I might order soon.
My interest for future will be a 64bit version, so I can use ZFS storage safe on it, par example for a small in car/caravan server where I connect my mobile storage, avoid hooking it directly to laptop for safe and mobility reason.
In your first message, you seem to be confusing the two different methods I described. The partition names 'system-boot' and 'writable' refer to the first procedure which updated from the Ubuntu-MATE 18.04 beta image, while 'PI_BOOT' and 'PI_ROOT' refer to the second method which is to update from Ubuntu-MATE 16.04 online, and then modify the image.
Check your procedures again. It sounds as though your boot partition doesn't match the contents of /lib/modules and/or /lib/firmware. Make sure that all of the files in /boot (PI_BOOT), /lib/modules (PI_ROOT/lib/modules) and /lib/firmware (PI_ROOT/lib/firmware) come from the same release of Raspbian Buster (/boot, /rootfs/lib/modules, and /rootfs/lib/firmware respectively). If there is any mismatch, then it will most certainly not work.
I tried this again -- very meticulously following the directions. I still get a kernel panic. The directions seem confusing at step 3. We remove PI_BOOT and PI_ROOT/firmware. but you copy libModules from the raspbian sd-card to the mate sd-card. Was there a reason why you didn't delete that first, and copy afresh?
Thanks for all your help. Seems a much more daunting task than first imaged.
I will post the steps I did (with screenshots) at a later date.
Have anyone tried ZFS drives on an RPI 4, 4gb?
My intention is to buy those if I can use them as my file server for my mobile zfs drives. Par example in my caravan when I am on camping to access drives through wireless and keep drives secured inside. Second option same thing in my car.
How about also video recording /processing from some webcam in my car / caravan?
In the end I might buy one for test but also thinking as spend money instead on some intel nucs, or even use some old netbooks as work well on zfs, but not so good on video survaillance
I have not tried ZFS, but do use JFS on most of my systems including a 900 GB partition on my Pi 4 Server. I serve music over my wired/wireless LAN in FLAC as well as MP4 videos with no problems. I find JFS to be very robust and fast on Pi's as well as my Athlon and Ryzen systems.
Thanks @Hal58 for reply. Nice audio "project" you have, I have also think about it in the past, but ...
Unfortunately I use ZFS from quite a long time, from the time OpenSolaris was my favorite OS. On that OS ZFS works on 32bit system, but on Linux it locks, so it run OK only on 64bit system (even I know that with some tweaks it might works also on 32 bit system).
All my data drives are ZFS and encrypted with Luks, and I don't want to change that, only one small documents drive that I use in a palm size server with Raspbery pi 0 is ext4 and luks encrypted.
Of course I continue to investigate this on internet as I am quite happy with those three Raspberry pi that I have 0w/2/3... so I arrive here ...
It looks this guy put some effort this autumn in the pi4, so it might be another variant to your very nice guide how to create a pi4 image, that I already saved on my PC for future use.... so thank you again for it.