Difference between revisions of "Linux rootfs on Orange Pi 4"

From Dejvino's Knowledge Base
Jump to navigation Jump to search
 
Line 12: Line 12:
 
We'll be using [https://archlinuxarm.org/ Arch Linux ARM].
 
We'll be using [https://archlinuxarm.org/ Arch Linux ARM].
  
{{code-block|1=wget http://os.archlinuxarm.org/os/ArchLinuxARM-aarch64-latest.tar.gz}}
+
{{Code-block|1=
 +
wget http://os.archlinuxarm.org/os/ArchLinuxARM-aarch64-latest.tar.gz
 +
}}
  
 
== Partitioning ==
 
== Partitioning ==

Latest revision as of 23:20, 28 March 2020

Root filesystem for an Orange Pi 4.

Prerequisite: Linux kernel on Orange Pi 4

Next steps: Flashing Linux to SD Card

TODO: THIS PAGE

Base rootfs selection

There are various base root filesystem packages maintained by different Linux distributions, e.g. Debian, Arch Linux.

We'll be using Arch Linux ARM.

wget http://os.archlinuxarm.org/os/ArchLinuxARM-aarch64-latest.tar.gz

Partitioning

U-Boot supports booting from ext2/3/4 partitions. Thanks to this all we have to do is create a single ext2/3/4 partition on a storage device and put all the data onto this partition.

TODO: Create a single ext2/3/4 partition on an SD card / USB flash drive

TODO: Format the partition

Populating rootfs

TODO: Mount the storage to /mnt/disk

Run as root: bsdtar -xpf ArchLinuxARM-aarch64-latest.tar.gz -C /mnt/disk

Preparing /boot

See U-Boot for details on how first bootloaders prime the device and how it looks for a followup bootloader. We make use of a standardized syslinux (extlinux) bootloader configuration. Alternatively we could configure a U-Boot specific boot script or create a combined kernel + DTB boot.img image.

/boot/extlinux/extlinux.conf

label rockchip-kernel-4.4
    kernel /boot/Image
    fdt /boot/dt.dtb
    append earlycon=uart8250,mmio32,0xff1a0000 root=PARTUUID=B921B045-1D rootwait rootfstype=ext4 init=/sbin/init

This part enables dmesg printing to debug console right from the start: {{{1}}}

To find out PARTUUID, try ls /dev/disk/by-partuuid/* -all.

/boot/Image

TODO: Copy the compiled kernel Image file to /boot/Image

/boot/dt.dtb

TODO: Copy the compiled device tree ??? dt.dtb file to /boot/dt.dtb

External Links