<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.pine64.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ianfoss</id>
	<title>PINE64 - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.pine64.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ianfoss"/>
	<link rel="alternate" type="text/html" href="https://wiki.pine64.org/wiki/Special:Contributions/Ianfoss"/>
	<updated>2026-04-20T16:11:33Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=ROCKPro64_Installing_Arch_Linux_ARM&amp;diff=19666</id>
		<title>ROCKPro64 Installing Arch Linux ARM</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=ROCKPro64_Installing_Arch_Linux_ARM&amp;diff=19666"/>
		<updated>2023-05-25T02:52:54Z</updated>

		<summary type="html">&lt;p&gt;Ianfoss: Reflect that there may be some unmet dependencies that users need to deal with when compiling u-boot.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{warning|This page is a work in progress, use at your own risk}}&lt;br /&gt;
&lt;br /&gt;
Commands to be run as a normal user are prefixed with &amp;lt;code&amp;gt;$&amp;lt;/code&amp;gt;, commands to be run as root are prefixed with &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt;. We assume your target device is &amp;lt;tt&amp;gt;/dev/sdX&amp;lt;/tt&amp;gt;, adjust accordingly.&lt;br /&gt;
&lt;br /&gt;
== Obtaining and Building U-Boot And TF-A ==&lt;br /&gt;
&lt;br /&gt;
The first step is to compile the open firmware (TF-A) and the open bootloader (u-boot).&lt;br /&gt;
&lt;br /&gt;
Clone u-boot git repository:&lt;br /&gt;
&lt;br /&gt;
 $ git clone https://source.denx.de/u-boot/u-boot.git&lt;br /&gt;
&lt;br /&gt;
Clone TF-A git repository:&lt;br /&gt;
&lt;br /&gt;
 $ git clone https://github.com/ARM-software/arm-trusted-firmware.git&lt;br /&gt;
&lt;br /&gt;
Build TF-A (you will need &amp;lt;tt&amp;gt;aarch64-linux-gnu-gcc&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;arm-none-eabi-gcc&amp;lt;/tt&amp;gt; for this)&lt;br /&gt;
&lt;br /&gt;
 $ cd arm-trusted-firmware&lt;br /&gt;
 $ make realclean&lt;br /&gt;
 $ make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399&lt;br /&gt;
&lt;br /&gt;
Next, export the path to your compiled BL31 in the shell you'll build u-boot in. Adjust the path as necessary.&lt;br /&gt;
&lt;br /&gt;
 $ export BL31=/path/to/arm-trusted-firmware/build/rk3399/release/bl31/bl31.elf&lt;br /&gt;
&lt;br /&gt;
Build U-Boot (you may need to install additional packages to successfully compile, such as &amp;lt;tt&amp;gt;bc&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;python-pyelftools&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;swig&amp;lt;/tt&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
 $ make mrproper&lt;br /&gt;
 $ make rockpro64-rk3399_defconfig&lt;br /&gt;
 $ make CROSS_COMPILE=aarch64-linux-gnu- -j$(nproc)&lt;br /&gt;
&lt;br /&gt;
== Preparing The Block Device ==&lt;br /&gt;
&lt;br /&gt;
Here we assume your block device is &amp;lt;tt&amp;gt;/dev/sdX&amp;lt;/tt&amp;gt;, adjust as needed.&lt;br /&gt;
&lt;br /&gt;
Create a new partition table:&lt;br /&gt;
&lt;br /&gt;
 # parted -s /dev/sdX mklabel gpt&lt;br /&gt;
&lt;br /&gt;
Create the partitions for loader and u-boot:&lt;br /&gt;
 &lt;br /&gt;
 # parted -s /dev/sdX mkpart loader 64s 8MiB&lt;br /&gt;
 # parted -s /dev/sdX mkpart uboot 8MiB 16MiB&lt;br /&gt;
&lt;br /&gt;
Create the partition for u-boot's environment (optional, but you'll have to adjust the following offsets if you don't do it):&lt;br /&gt;
&lt;br /&gt;
 # parted -s /dev/sdX mkpart env 16MiB 32MiB&lt;br /&gt;
&lt;br /&gt;
Create the &amp;quot;efi&amp;quot; boot partition and mark it as bootable:&lt;br /&gt;
&lt;br /&gt;
 # parted -s /dev/sdX mkpart efi fat32 32MiB 544MiB&lt;br /&gt;
 # parted -s /dev/sdX set 4 boot on&lt;br /&gt;
&lt;br /&gt;
Create the root partition:&lt;br /&gt;
&lt;br /&gt;
 # parted -s /dev/sdX mkpart root ext4 544MiB 100%&lt;br /&gt;
&lt;br /&gt;
=== Creating The File Systems ===&lt;br /&gt;
&lt;br /&gt;
Now create the file systems for boot and root:&lt;br /&gt;
&lt;br /&gt;
 # mkfs.vfat -n &amp;quot;efi&amp;quot; /dev/sdX4&lt;br /&gt;
 # mkfs.ext4 -L &amp;quot;rootfs&amp;quot; /dev/sdX5&lt;br /&gt;
&lt;br /&gt;
=== Flashing U-Boot ===&lt;br /&gt;
&lt;br /&gt;
Flash idbloader.img and uboot.img:&lt;br /&gt;
&lt;br /&gt;
 # dd if=idbloader.img of=/dev/sdX1&lt;br /&gt;
 # dd if=u-boot.itb of=/dev/sdX2&lt;br /&gt;
&lt;br /&gt;
== Fetching The Root File System Tarball ==&lt;br /&gt;
&lt;br /&gt;
Fetch the root filesystem tarball and the PGP signature&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ wget -N http://os.archlinuxarm.org/os/ArchLinuxARM-aarch64-latest.tar.gz{,.sig}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fetch the gpg keys:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;$ curl 'https://keyserver.ubuntu.com/pks/lookup?op=get&amp;amp;search=0x68b3537f39a313b3e574d06777193f152bdbe6a6' | gpg --import=-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compare the key ID provided in the above command with the one listed here: https://archlinuxarm.org/about/package-signing (Take good note of the domain and HTTPS)&lt;br /&gt;
&lt;br /&gt;
Verify the tarball's authenticity&lt;br /&gt;
&lt;br /&gt;
 $ gpg --verify ArchLinuxARM-aarch64-latest.tar.gz.sig&lt;br /&gt;
&lt;br /&gt;
{{note|Do not skip verifying the authenticity. This is important. It also protects you from prematurely aborted transfers giving you a corrupt archive.}}&lt;br /&gt;
&lt;br /&gt;
== Installing The Root File System ==&lt;br /&gt;
&lt;br /&gt;
 # mount /dev/sdX5 /mnt/alarm-root&lt;br /&gt;
 # mkdir /mnt/alarm-root/boot&lt;br /&gt;
 # mount /dev/sdX4 /mnt/alarm-root/boot&lt;br /&gt;
 # bsdtar -xpf ArchLinuxARM-aarch64-latest.tar.gz -C /mnt/alarm-root&lt;br /&gt;
&lt;br /&gt;
=== Editing fstab ===&lt;br /&gt;
&lt;br /&gt;
Find your partition UUIDs for both partitions using &amp;lt;code&amp;gt;lsblk&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 $ lsblk -o NAME,SIZE,MOUNTPOINTS,PARTUUID&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;/mnt/alarm-root/etc/fstab&amp;lt;/tt&amp;gt;, put the lines&lt;br /&gt;
&lt;br /&gt;
 PARTUUID=''root-uuid-here''  /       ext4    defaults        0       1&lt;br /&gt;
 PARTUUID=''boot-uuid-here''  /boot   vfat    defaults        0       2&lt;br /&gt;
&lt;br /&gt;
with your UUIDs in place of the placeholder.&lt;br /&gt;
&lt;br /&gt;
=== Writing extlinux.conf ===&lt;br /&gt;
&lt;br /&gt;
Create a &amp;lt;tt&amp;gt;/mnt/alarm-root/boot/extlinux/extlinux.conf&amp;lt;/tt&amp;gt; with these contents:&lt;br /&gt;
&lt;br /&gt;
 default l0&lt;br /&gt;
 menu title ROCKPro64 Boot Menu&lt;br /&gt;
 prompt 0&lt;br /&gt;
 timeout 50&lt;br /&gt;
 &lt;br /&gt;
 label l0&lt;br /&gt;
 menu label Boot Arch Kernel&lt;br /&gt;
 linux /Image&lt;br /&gt;
 fdt /dtbs/rockchip/rk3399-rockpro64.dtb&lt;br /&gt;
 append initrd=/initramfs-linux.img earlycon=uart8250,mmio32,0xff1a0000 console=ttyS2,1500000n8 root=LABEL=rootfs rw rootwait&lt;br /&gt;
&lt;br /&gt;
Once done, unmount the partitions:&lt;br /&gt;
	&lt;br /&gt;
 # umount /mnt/alarm-root/boot&lt;br /&gt;
 # umount /mnt/alarm-root&lt;br /&gt;
&lt;br /&gt;
== Finishing Setup ==&lt;br /&gt;
&lt;br /&gt;
SSH in as &amp;lt;tt&amp;gt;root&amp;lt;/tt&amp;gt; with password &amp;lt;tt&amp;gt;root&amp;lt;/tt&amp;gt; and run&lt;br /&gt;
&lt;br /&gt;
 # pacman-key --init&lt;br /&gt;
 # pacman-key --populate archlinuxarm&lt;br /&gt;
&lt;br /&gt;
[[Category:ROCKPro64]]&lt;/div&gt;</summary>
		<author><name>Ianfoss</name></author>
	</entry>
</feed>