Skip to content

Instantly share code, notes, and snippets.

@joske
Last active November 30, 2024 19:39
Show Gist options
  • Save joske/52be3f1e5d0239706cd5a4252606644b to your computer and use it in GitHub Desktop.
Save joske/52be3f1e5d0239706cd5a4252606644b to your computer and use it in GitHub Desktop.
Arch Linux Arm on Lenovo Yoga Slim 7x (X elite)

Arch

This is the method I used to install Arch on the yoga slim 7x. This is from memory so I may have forgotten things

prerequisites

  • disable bitlocker in windows
  • resize the windows partition
  • disable secure boot in BIOS

installation

  • Download the Debian 12 image from https://git.codelinaro.org/linaro/qcomlt/demos/debian-12-installer-image
  • write it to USB, use gparted to resize the partition
  • download the latest (ancient) arch linux arm generic image from https://archlinuxarm.org/platforms/armv8/generic
  • unpack the initrd and add this tarball
  • also add some tools like mkfs.ext4 and fdisk (I downloaded debian 12 versions and unpacked the necessary libs and binaries)
  • boot from the USB (use F12)
  • once in installer, press Fn+alt+F2 to get to another TTY
  • create a wpa_supplicant file and start wpa_supplicant
  • back on tty1, continue the installer until it has setup networking
  • return to tty2
  • create /boot and / partitions (and any other you want)
  • mount / on /mnt
  • unpack the tarball into /mnt
  • mount /boot on /mnt/boot
  • bind mount /sys, /dev, /proc and /run in /mnt
  • chroot in /mnt
  • set the date with the date command (otherwise signature verification fails)
  • use
pacman-key --init
pacman-key --populate archlinuxarm
  • update with pacman -Syyu
  • copy kernel, initrd and device tree from the USB
  • do the rest of Arch setup
  • do some of the steps outlined by linaro, in particular the zink environment
  • exit the chroot
  • edit the USB grub to load from the nvme
  • reboot with F12 and boot from the nvme
  • build newer kernel, initrd and dtb
  • get firmware from https://github.com/Seraphin-/linux-firmware-x1e80100-lenovo-yoga-slim7x

post installation

  • I replaced the windows nvme with a bigger one that has only linux, that way I was able to update the UEFI boot manager to load Arch without the USB stick
    • Download shellaa64.efi and place it on USB stick
    • use the following grub entry:
    menuentry "UEFI Shell" {
      insmod fat
      insmod chain
      search --no-floppy --set=root --file /shellaa64.efi
      chainloader /shellaa64.efi
    }
    
    • boot to UEFI shell
    • use the commands in the debian 12 image explanation to set Arch as first boot entry
  • install mesa from this PKGBUILD https://github.com/joske/PKGBUILDs-x1e/tree/master/mesa
@kuruczgy
Copy link

@kmeaw just to give an update, in the last 5 days I made a lot of progress. I can now boot my machine in EL2, and run QEMU VMs without issues. Steps that are needed (also see this draft PR for my NixOS repo):

The things that don't work compared to EL1 are the battery indicator and DP altmode.

(There is also a patch that makes slbounce detect whether you are loading an overlayed device tree (see my PR for that), and only do SL if that's the case. This way you can select between EL1 and EL2 mode from the boot menu without having to go through an EFI shell.)

@kmeaw
Copy link

kmeaw commented Nov 30, 2024

@kuruczgy Thank you for the update! I think this information would be really useful for someone considering buying a Snapdragon laptop and running Linux on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment