Group: Hardware/FSDG distributions/PureOS

From LibrePlanet
Jump to: navigation, search
(PureOS versions: Add informations from my talk to the people on the PureOS table at the Capitole du libre 2019 in Toulouse in France)
(PureOS on ARM SBCs: Add link to /dtb to handle kernel upgrades)
Line 70: Line 70:
 
         kernel /vmlinuz
 
         kernel /vmlinuz
 
         append loglevel=8 root=/dev/mmcblk0p1 rw
 
         append loglevel=8 root=/dev/mmcblk0p1 rw
         fdtdir /usr/lib/linux-image-5.2.0-3-arm64/
+
         fdtdir /dtb/
 
         initrd /initrd.img
 
         initrd /initrd.img
 +
 +
You then need to write a script in /etc/kernel/postinst.d/zz-generate-dtb-link to generate a symlink from /usr/lib/linux-image-<your-kernel-version> to /dtb, so for instance from /usr/lib/linux-image-5.2.0-3-arm64/ to /dtb. I've an incomplete script here:
 +
#!/bin/sh
 +
set -e
 +
 +
version="$1"
 +
 +
ln -sf /usr/lib/linux-image-${version} /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.
 +
 +
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:
 +
ln -sf /usr/lib/linux-image-<your-kernel-version> /dtb
 +
You will need to replace the <your-kenrel-version> with your kenrel version, for instance:
 +
ln -sf /usr/lib/linux-image-5.2.0-3-arm64/ /dtb.
  
 
=== TODO ===
 
=== TODO ===

Revision as of 11:51, 26 September 2020

PureOS versions

Version Can be debootstrapped Kernel version Comments
Green Not anymore as October 2019:
E: Couldn't find these debs: ca-certificates pureos-minimal
?
  • Was on the live USB installer before but not anymore
Amber Yes 4.19
  • On the LiveUSB installer as October 2019
  • Based on Debian stable
  • Should be FSDG compliant
Byzantium Yes 5.2
  • "Development target"[1]
  • Based on Debian unstable
  • Not sure if it's FSDG compliant
Landing ? ?
  • Syncronized with Debian testing
  • Probably not fit for use but only as staging for development[2]

Installing

  • PureOS can be installed through the live USB installer
  • Parabola can debootstrap PureOS Amber for all the supported architectures

PureOS on ARM SBCs

u-boot

U-boot has a standard for booting distributions. The easiest way to configure your distribution to boot with u-boot is to create an extlinux.conf configuration file as explaned below. U-boot will then look for it in /boot/extlinux/extlinux.conf (and probably /extlinux/extlinux.conf too) on each partition that it can access.

How to install PureOS on an arm64 SBC

# 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 arm64 amber rootfs https://repo.puri.sm/pureos 
# cp /usr/bin/qemu-aarch64-static rootfs/usr/bin
# LANG=C.UTF-8 chroot rootfs qemu-aarch64-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 PureOS GNU/Linux-libre, linux-libre kernel
        kernel /vmlinuz
        append loglevel=8 root=/dev/mmcblk0p1 rw
        fdtdir /dtb/
        initrd /initrd.img

You then need to write a script in /etc/kernel/postinst.d/zz-generate-dtb-link to generate a symlink from /usr/lib/linux-image-<your-kernel-version> to /dtb, so for instance from /usr/lib/linux-image-5.2.0-3-arm64/ to /dtb. I've an incomplete script here:

#!/bin/sh
set -e

version="$1"

ln -sf /usr/lib/linux-image-${version} /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.

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:

ln -sf /usr/lib/linux-image-<your-kernel-version> /dtb

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

ln -sf /usr/lib/linux-image-5.2.0-3-arm64/ /dtb.

TODO

  • Add a symlink for /usr/lib/linux-image-5.2.0-3-arm64/ to /ftddir or something like that in Debian and backport it to FSDG distributions that support architecture with devicetree like PureOS

References