Group: Hardware/FSDG distributions/Trisquel

From LibrePlanet
< Group:Hardware‎ | FSDG distributions
Revision as of 11:34, 17 March 2023 by GNUtoo (talk | contribs) (How to install Trisquel 10 (etiona) on 32bit ARM SBCs: mount required filesystems)
Jump to: navigation, search

Trisquel versions

Version Can be debootstrapped Based on Kernel version Comments
Trisquel 10 (nabia) Yes Ubuntu 20.04 LTS (Focal Fossa)
  • 5.4
  • 5.13 (though linux-image-generic-hwe-20.04)

Installing

How to install Trisquel 10 (etiona) on 32bit ARM SBCs

If you're doing that on Parabola, you need to enable etiona support:

# cd /usr/share/debootstrap/scripts/
# ln -s trisquel etiona

Then you can install Trisquel as usual:

# qemu-img create -f raw storage.img 2G
# fdisk storage.img # create 1 partition
# udisksctl loop-setup -f storage.img
# mkdir rootfs
# mkfs.ext4 -O ^metadata_csum -O ^64bit /dev/loop0p1
# mount /dev/loop0p1 rootfs
# mkdir -p rootfs/usr/bin
# debootstrap --foreign --arch armhf etiona rootfs
# cp /usr/bin/qemu-arm-static rootfs/usr/bin
# LANG=C.UTF-8 chroot rootfs qemu-arm-static /bin/bash
# export TERM=xterm-color
# /debootstrap/debootstrap --second-stage

You then need to create the extlinux.conf file in /boot/extlinux/extlinux.conf with the following content:

menu title Welcome to U-Boot with Extlinux support!

timeout 10

label Trisquel GNU/Linux-libre, linux-libre kernel
        kernel /boot/vmlinuz
        append loglevel=8 root=/dev/mmcblk0p1 rw
        fdtdir /boot/dtb/
        initrd /boot/initrd.img

Then you need to install a kernel:

# for d in proc dev dev/pts sys ; do mount -o bind /$d rootfs/$d ; done
# LANG=C.UTF-8 chroot rootfs qemu-arm-static /bin/bash
# source /etc/environment
# apt remove flash-kernel
# apt install linux-image-generic

You then need to write a script in /etc/kernel/postinst.d/zz-generate-dtb-link to generate a symlink from /lib/firmware/<<your-kernel-version>>/device-tree/ to /boot/dtb, so for instance from /lib/firmware/5.4.0-96-generic/device-tree/ to /boot/dtb. I've an incomplete script here:

#!/bin/sh
set -e

version="$1"

ln -sf /lib/firmware/${version}/device-tree/ /boot/dtb

The caveat of this script is that it has not been tested with multiple kernel versions installed, so during apt upgrade, it may or may not make the /boot/dtb link point to the wrong kernel. So that needs to be tested.

With only one kernel installed it should not be a problem.

In addition to that you will also need to make the symlink yourself the first time, before booting the image, like that:

# LANG=C.UTF-8 chroot rootfs qemu-arm-static /bin/bash
# source /etc/environment
# ln -sf /lib/firmware/<your-kernel-version>/device-tree/ /boot/dtb

You will need to replace the <your-kenrel-version> with your kenrel version, for instance:

# LANG=C.UTF-8 chroot rootfs qemu-arm-static /bin/bash
# source /etc/environment
# ln -sf /lib/firmware/5.4.0-96-generic/device-tree/ /boot/dtb

You will then need to install a bootloader, here's an example for the beagleboard:

# LANG=C.UTF-8 chroot rootfs qemu-arm-static /bin/bash
# source /etc/environment
# apt update
# apt install u-boot-omap
# cat /usr/share/doc/u-boot-omap/README.Debian
# dd conv=fsync,notrunc seek=256 if=/usr/lib/u-boot/omap3_beagle/MLO of=/dev/loop0
# dd conv=fsync,notrunc seek=768 if=/usr/lib/u-boot/omap3_beagle/u-boot.img of=/dev/loop0

References