493
edits
m (→Fetching The Root File System Tarball: since we do signature verification, we can drop the https requirement now) |
m (Update the kernel package to a 5.18-rc kernel with PCIe patches) |
||
(20 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{note|This page is a work in progress. | {{note|This page is a work in progress. If you are not familiar with user-mode QEMU, wait for [https://github.com/archlinuxarm/PKGBUILDs/pull/1918 the necessary kernel config changes] to be made.}} | ||
Commands to be run as a normal user are prefixed with <code>$</code>, commands to be run as root are prefixed with <code>#</code>. We assume your target device is <tt>/dev/ | Commands to be run as a normal user are prefixed with <code>$</code>, commands to be run as root are prefixed with <code>#</code>. We assume your target device is <tt>/dev/sdX</tt>, adjust accordingly. | ||
== Partitioning The Block Device == | == Partitioning The Block Device == | ||
' | Here we assume your block device is <tt>/dev/sdX</tt>, adjust as needed. | ||
Create a new partition table: | |||
# parted -s /dev/sdX mklabel gpt | |||
Create the partitions for loader and u-boot: | |||
# parted -s /dev/sdX mkpart loader 64s 8MiB | |||
# parted -s /dev/sdX mkpart uboot 8MiB 16MiB | |||
Create the partition for u-boot's environment: | |||
# parted -s /dev/sdX mkpart env 16MiB 32MiB | |||
Create the "efi" boot partition and mark it as bootable: | |||
# parted -s /dev/sdX mkpart efi fat32 32MiB 544MiB | |||
# parted -s /dev/sdX set 4 boot on | |||
Create the root partition: | |||
# parted -s /dev/sdX mkpart root ext4 544MiB 100% | |||
=== Creating The File Systems === | |||
Now create the file systems for boot and root: | |||
# mkfs.vfat -n "efi" /dev/sdX4 | |||
# mkfs.ext4 -L "rootfs" /dev/sdX5 | |||
== Fetching and Flashing U-Boot == | == Fetching and Flashing U-Boot == | ||
'' | For this we'll use the precompiled idblock and u-boot from pgwipeout's CI. | ||
Go to https://gitlab.com/pgwipeout/quartz64_ci/-/pipelines and click the three dots, download the merge-job artifacts. | |||
Unzip them: | |||
$ unzip artifacts.zip | |||
Flash idblock.bin and uboot.img: | |||
# dd if=artifacts/idblock.bin of=/dev/sdX1 | |||
# dd if=artifacts/uboot.img of=/dev/sdX2 | |||
== Fetching The Root File System Tarball == | == Fetching The Root File System Tarball == | ||
Line 31: | Line 71: | ||
== Installing The Root File System == | == Installing The Root File System == | ||
# mount /dev/sdX5 /mnt/alarm-root | |||
# mkdir /mnt/alarm-root/boot | |||
# mount /dev/sdX4 /mnt/alarm-root/boot | |||
# | |||
# mount /dev/ | |||
# bsdtar -xpf ArchLinuxARM-aarch64-latest.tar.gz -C /mnt/alarm-root | # bsdtar -xpf ArchLinuxARM-aarch64-latest.tar.gz -C /mnt/alarm-root | ||
Line 46: | Line 84: | ||
In <tt>/mnt/alarm-root/etc/fstab</tt>, put the lines | In <tt>/mnt/alarm-root/etc/fstab</tt>, put the lines | ||
PARTUUID=''root-uuid-here'' / ext4 defaults 0 | PARTUUID=''root-uuid-here'' / ext4 defaults 0 1 | ||
PARTUUID=''boot-uuid-here'' /boot vfat defaults 0 | PARTUUID=''boot-uuid-here'' /boot vfat defaults 0 2 | ||
with your UUIDs in place of the placeholder. | with your UUIDs in place of the placeholder. | ||
Line 69: | Line 107: | ||
For a different type of Quartz64 device (e.g. Model B) replace the <tt>fdt</tt> line with the appropriate <tt>/boot</tt>-relative path to the device tree. | For a different type of Quartz64 device (e.g. Model B) replace the <tt>fdt</tt> line with the appropriate <tt>/boot</tt>-relative path to the device tree. | ||
=== Finishing Touches === | |||
{{note|Here's where you'd do the part I said was iffy and won't be necessary once my PR is merged. You'll need an Arch Linux or Manjaro system. If it's not an aarch64 system, you'll also need <tt>qemu-user-static</tt>. | |||
First, get [https://fratti.ch/quartz64/alarm-kernels/linux-aarch64-rc-5.18.rc6-1-aarch64.pkg.tar.zst the linux-aarch64-rc package I patched and built], then copy it somewhere into your mounted root. | |||
Alternatively, patch and build the package yourself by [https://github.com/CounterPillow/PKGBUILDs/commit/622e03ba3753f823ea903bdbbf59c2f400dd2334 using my forked package sources]. | |||
Next, <code>arch-chroot</code> into the mounted root: | |||
<code># arch-chroot /mnt/alarm-root</code> | |||
and install the package | |||
<code># pacman -U linux-aarch64-rc-5.18.rc6-1-aarch64.pkg.tar.zst</code> | |||
Then <code>exit</code> the chroot again once it's done installing. | |||
}} | |||
Once done, unmount the partitions: | Once done, unmount the partitions: | ||
Line 74: | Line 131: | ||
# umount /mnt/alarm-root/boot | # umount /mnt/alarm-root/boot | ||
# umount /mnt/alarm-root | # umount /mnt/alarm-root | ||
== Booting And Finishing Setup == | |||
Hook up your UART dongle to your Quartz64, open a serial terminal at 1.5mbauds. Install the SD card or eMMC module inside the Quartz64, and plug in the power. | |||
Once you hit a login shell, log in as <code>root</code> with password <code>root</code> and run: | |||
# pacman-key --init | |||
# pacman-key --populate archlinuxarm | |||
You are now ready to use Arch Linux ARM! Either delete or rename (and move the homedir of) the <code>alarm</code> user, and you're all set. Don't forget to install things like <code>sudo</code> and setting up sudo groups and such. | |||
[[Category:Quartz64]] [[Category:Guide]] [[Category:Quartz64 Guides]] |
edits