Difference between revisions of "Linux rootfs on Orange Pi 4"
| (3 intermediate revisions by the same user not shown) | |||
| Line 6: | Line 6: | ||
{{Todo|THIS PAGE}} | {{Todo|THIS PAGE}} | ||
| + | |||
| + | == Base rootfs selection == | ||
| + | There are various base root filesystem packages maintained by different [[Linux distribution|Linux distributions]], e.g. Debian, Arch Linux. | ||
| + | |||
| + | We'll be using [https://archlinuxarm.org/ Arch Linux ARM]. | ||
| + | |||
| + | {{Code-block|1= | ||
| + | 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: | ||
| + | {{code-block|1= | ||
| + | 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 {{code|boot.img}} image. | ||
| + | |||
| + | === /boot/extlinux/extlinux.conf === | ||
| + | <pre> | ||
| + | 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 | ||
| + | </pre> | ||
| + | |||
| + | This part enables {{code|dmesg}} printing to debug console right from the start: {{code|earlycon=uart8250,mmio32,0xff1a0000}} | ||
| + | |||
| + | To find out PARTUUID, try {{code|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 == | == External Links == | ||
* [[Rockchip]] wiki on building a Debian rootfs [http://opensource.rock-chips.com/wiki_Debian] | * [[Rockchip]] wiki on building a Debian rootfs [http://opensource.rock-chips.com/wiki_Debian] | ||
| + | * [[Xunlong]]'s [[BSP Linux on Orange Pi 4]]: RK3399 external repository's [https://github.com/orangepi-xunlong/OrangePiRK3399_external/blob/master/extlinux/ extlinux configs] for eMMC / SD card | ||
| + | * Arch Linux ARM [https://archlinuxarm.org/] | ||
| + | ** Generic AArch64 rootfs [https://archlinuxarm.org/platforms/armv8/generic] | ||
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
Contents
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
- Rockchip wiki on building a Debian rootfs [1]
- Xunlong's BSP Linux on Orange Pi 4: RK3399 external repository's extlinux configs for eMMC / SD card
- Arch Linux ARM [2]
- Generic AArch64 rootfs [3]