Group: Hardware/FSDG distributions/Trisquel

From LibrePlanet
Jump to: navigation, search
(How to install Trisquel 10 (etiona) on ARM SBCs: fix kernel and initrd location)
(Installing: move /dtb to /boot/dtb for consistency)
Line 51: Line 51:
 
         kernel /boot/vmlinuz
 
         kernel /boot/vmlinuz
 
         append loglevel=8 root=/dev/mmcblk0p1 rw
 
         append loglevel=8 root=/dev/mmcblk0p1 rw
         fdtdir /dtb/
+
         fdtdir /boot/dtb/
 
         initrd /boot/initrd.img
 
         initrd /boot/initrd.img
  
Line 60: Line 60:
 
  # apt install linux-image-generic
 
  # 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 /dtb, so for instance from /lib/firmware/5.4.0-96-generic/device-tree/ to /dtb. I've an incomplete script here:
+
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
 
  #!/bin/sh
 
  set -e
 
  set -e
Line 66: Line 66:
 
  version="$1"
 
  version="$1"
 
   
 
   
  ln -sf /lib/firmware/${version}/device-tree/ /dtb
+
  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 /dtb link point to the wrong kernel. So that needs to be tested.
+
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.
 
With only one kernel installed it should not be a problem.
Line 75: Line 75:
 
  # LANG=C.UTF-8 chroot rootfs qemu-arm-static /bin/bash
 
  # LANG=C.UTF-8 chroot rootfs qemu-arm-static /bin/bash
 
  # source /etc/environment
 
  # source /etc/environment
  # ln -sf /lib/firmware/<your-kernel-version>/device-tree/ /dtb
+
  # 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:
 
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
 
  # LANG=C.UTF-8 chroot rootfs qemu-arm-static /bin/bash
 
  # source /etc/environment
 
  # source /etc/environment
  # ln -sf /lib/firmware/5.4.0-96-generic/device-tree/ /dtb
+
  # 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:
 
You will then need to install a bootloader, here's an example for the beagleboard:

Revision as of 11:48, 17 March 2023

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:

# 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