[ARM] Raspberry Pi Kernel update & 64 Bit on SSD

The good folks over at Arch Linux Arm have introduced a couple of new kernels based on the RPi Foundation Linux Kernel.

aarch64 core linux-rpi 5.10.82-1 RPi Foundation patched Linux kernel and modules
armv7h  core linux-rpi 5.10.82-1 RPi Foundation patched Linux kernel and modules 

I haven’t played with the linux-rpi 32 Bit version yet. So I am not sure what is going on with that yet. My main interest has been in the 64 Bit version.

There are now two versions of the 64 Bit image.
linux-aarch64
and
linux-rpi

The linux-aarch64 is the kernel installed by the official base image. However, it is easy to convert over to the linux-rpi version. The main attraction for the 64 Bit linux-rpi version is the ability to install to a USB SSD, including the RPi 4b 8 GB RAM verson. It’s a little convoluted, but it works.

The following is a tutorial / how to for installing a 64 Bit OS on a RPi 4b 8 GB with the new RPi Foundation kernel. With the option to installing on a USB SSD.

Install the 64 Bit OS on a RPi 4b 8 GB device

Use the image-install script as per

https://arm.endeavouros.com/automated-base-install/
When you get to the second screen, that offers which type of device to install to:
Choose the third option down “Raspberry Pi 64 Bit”.

After installing the base image, put the uSD card in a RPi4 4b 8 GB RAM.
login as root with a password of “root”

If you care to edit the mirrorlist and select mirrors close to you, use vi or nano:

# vi /etc/pacman.d/mirrorlist

then find the following lines at the top of the file:

## Geo-IP based mirror selection and load balancing
 Server = http://mirror.archlinuxarm.org/$arch/$repo

add # to the beginning of the second line to comment it out like this

## Geo-IP based mirror selection and load balancing
# Server = http://mirror.archlinuxarm.org/$arch/$repo

Then uncomment (remove the leading #) from the ‘Server =’ line(s)
for servers near you and close and save the file.

If you wish to enable parallel downloads in pacman

# vi /etc/pacman.conf

scroll down to the following line
#ParallelDownloads = 5
remove the leading # and change 5 to the number of parallel downloads you want.

At this time you are running the mainline kernel. We need to install the
raspberry pi foundation kernel.

# pacman-key --init
# pacman-key --populate archlinuxarm
# pacman -Syy
# pacman -S linux-rpi

Answer yes to the two conflicts questions

:: linux-rpi and linux-aarch64 are in conflict (linux). Remove linux-aarch64? [y/N] y
:: linux-rpi and uboot-raspberrypi are in conflict. Remove uboot-raspberrypi? [y/N] y

Next install the following

# pacman -S raspberrypi-bootloader-x raspberrypi-firmware

then reboot the RPi 4b

The RPi 4 is now running the
aarch64 linux-rpi 5.10.82-4 RPi Foundation patched Linux kernel and modules
If one lists the contents of the /boot directory, the friendly cmdline.txt will be present.

If the text is pulled towards the right side of the monitor and has space of the left side edit:
/boot/config.txt
and add the following just before the [pi4] line

disable_overscan=1

Install the linux-rpi testing version

If you want to run the latest version of linux-rpi 64 Bit then install the TESTING version
linux-rpi 5.15.1 from graysky’s repo as follows:

Use vi or nano to edit /etc/pacman.conf add this entry ABOVE the official repos:
right above [core]

[graysky]
Server = http://repo-ck.com/aarch64-test/

Add graysky’s keys

# pacman-key -r 5EE46C4C --keyserver hkp://keys.gnupg.net
# pacman-key --lsign-key 5EE46C4C
# pacman -Syu git libnewt wget

reboot and you should be running the testing linux-rpi 5.15.5-5-rpi-ARCH

Remember, if you want to go back to the regular Arch repo for the kernel,
adjustments must be made in pacman.conf, and possibly other considerations.

You can continue to use this system on the micro SD card and install a DE or WM.
OR you can copy the system on the micro SD to an external SSD.

Install the OS to a USB SSD

On a computer with a running Linux Desktop Environment, use Gparted or KDE partition manager to partition your SSD. Of course you can do it the retro way and use fdisk. Set KDE Partition Manager (or Gparted) as such:

Highlight the USB SSD device in the left column.
Be ABSOLUTELY sure you have the correct device highlighted for the USB SSD!

create a new partition table by clicking on “New Partition Table”

new partition table

Pick GPT and then “Create New Partition Table”.

Click to highlight the unallocated section, Right click on it and click “New”
Fill out the partition entry screen to look as such:

first partition

If “free space after” shows zero, click on it and it will auto fill.
Your “free space after” will probably be different depending on the size of the SSD
Click on the bottom unallocated section to highlight it. Right click and choose “New”
Fill out the partition entry screen as follows:

second partition

Again, “size” will vary by how big your SSD is.
Click on “Apply”

Once the SSD is partitioned and formatted, unmount it from the computer, and connect the USB SSD enclosure to a USB 3 port on the RPi 4b.

On the RPi4, as root in root’s home directory

pacman -S rsync
mkdir rpi4-copy
cd rpi4-copy
mkdir usb-boot usb-root
lsblk -f

lsblk should show sda listed and mmcblk0p1 listed. The sda device should be the SSD

mount /dev/sda1 usb-boot
mount /dev/sda2 usb-root

To copy the microSD system to the USB SSD

rsync --info=progress2  -axHAX  /boot/  usb-boot/        (the slashes are important as is)
rsync --info=progress2  -axHAX  /  usb-root/
sync
lsblk -f

If you didn’t do it before, write down the UUID for sda1, should be in the format XXX-XXX and for the UUID for sda2.
They will be used in the following configurations.

vi usb-root/etc/fstab
comment out existing by adding # in the beginning
# /dev/mmcblk0p1 /boot vfat defaults 0 0
create new entry
UUID=XXXX-XXXX /boot vfat defaults 0 0 ( XXXX-XXXX is the UUID for sda1)

edit the /boot/cmdline.txt file
vi usb-boot/cmdline.txt
at the beginning of the line, change from
root=/dev/mmcblk0p2
to
root=UUID=xxxxxxxx-xxxx-xxxx-xxx-xxxxxxxxxxxx (using the UUID for sda2)

Check the prompt, should show
[root@alarm rpi-copy]#
if not cd /root/rpi-copy

umount usb-boot usb-root

poweroff and remove the micro SD from the RPi4 and reboot from the SSD
Save the uSD card so if you want to reinstall, put the uSD card in the RPi 4
boot it up, then start with the section of this tutorial where the OS is
copied to a partitioned and formatted USB SSD. Then pacman -Syu and
you have a good base for a new DE or WM.

Now install any DE or WM of your desire.

7 Likes

Update, there is now a script available to do all the above.
Official announcement soon.

Pudge

4 Likes