├── .github └── workflows │ └── ci.yml ├── .gitignore ├── README.md ├── entrypoint.sh ├── geekbench-aarch64 └── PKGBUILD ├── linux-x13s-archiso ├── 60-linux.hook ├── 90-linux.hook ├── PKGBUILD ├── config ├── kernel.keyblock ├── kernel_data_key.vbprivk ├── linux-x13s-archiso.install └── linux.preset ├── linux-x13s-rc ├── 60-linux.hook ├── 90-linux.hook ├── PKGBUILD ├── config ├── kernel.keyblock ├── kernel_data_key.vbprivk ├── linux-x13s-rc.install └── linux.preset ├── linux-x13s ├── 60-linux.hook ├── 90-linux.hook ├── PKGBUILD ├── config ├── kernel.keyblock ├── kernel_data_key.vbprivk ├── linux-x13s.install ├── linux.preset ├── mkinitcpio.conf.d-x13s.conf └── patch_kernel_config.py └── x13s-firmware ├── PKGBUILD ├── a690_gmu.bin ├── hpnv21.b8c └── qcvss8280.mbn /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: Build packages 2 | on: [push, pull_request] 3 | jobs: 4 | build: 5 | runs-on: [self-hosted, linux, ARM64] 6 | environment: "signing key" 7 | steps: 8 | - name: cleanup work dir 9 | run: | 10 | echo ${{ secrets.SUDO_PASSWD }} | sudo -S rm -rf $PWD 11 | mkdir -p $PWD 12 | - name: checkout repo 13 | uses: actions/checkout@v2 14 | with: 15 | fetch-depth: '0' 16 | - name: Build packages 17 | run: | 18 | echo "$GITHUB_REPOSITORY" > ./repo 19 | echo -n "$GPG_SIGNING_KEY" > ./gpg_key 20 | file ./gpg_key 21 | docker run -t -v $PWD:/build ogarcia/archlinux /bin/bash /build/entrypoint.sh 22 | ls -l . 23 | env: 24 | GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY_2024 }} 25 | 26 | - name: generate tag 27 | id: tag 28 | run: | 29 | count=$(git rev-list --count HEAD) 30 | hash=$(git rev-parse --short HEAD) 31 | echo "::set-output name=tag::r${count}.${hash}" 32 | 33 | - name: Print sha512sums 34 | run: sha512sum */*.pkg.tar.* 35 | 36 | - name: Upload Packages Artifact 37 | uses: actions/upload-artifact@v4 38 | with: 39 | name: x13s-packages-${{ steps.tag.outputs.tag }} 40 | path: | 41 | ${{ github.workspace }}/*.pkg.tar.* 42 | ${{ github.workspace }}/*-x13s.files* 43 | ${{ github.workspace }}/*-x13s.db* 44 | 45 | - name: Release 46 | if: ${{ github.ref == 'refs/heads/trunk' && !contains(github.event.head_commit.message, '[no rel]') }} 47 | uses: softprops/action-gh-release@v1 48 | with: 49 | files: | 50 | ${{ github.workspace }}/*.pkg.tar.* 51 | ${{ github.workspace }}/*-x13s.files* 52 | ${{ github.workspace }}/*-x13s.db* 53 | tag_name: packages #${{ steps.tag.outputs.tag }} 54 | #draft: ${{ contains(github.event.head_commit.message, '[draft]') }} 55 | #prerelease: ${{ contains(github.event.head_commit.message, '[pre]') }} 56 | #generate_release_notes: true 57 | env: 58 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 59 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **/src 2 | **/pkg 3 | **/*.tar.xz 4 | **/*.tar.xz.sig 5 | **/*.tar.gz 6 | **/*.pkg.tar 7 | mutter/mutter -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Packages for the ThinkPad X13s 2 | 3 | ## Binary repository 4 | To use pre-built packages, add this section to the end of your `/etc/pacman.conf`: 5 | 6 | ```conf 7 | [ironrobin-x13s] 8 | Server = https://github.com/ironrobin/x13s-alarm/releases/download/packages 9 | ``` 10 | 11 | You'll need to trust the public key in order to verify package signature: 12 | 13 | ```bash 14 | sudo pacman-key --recv-keys 6ED02751500A833A 15 | sudo pacman-key --lsign-key 6ED02751500A833A 16 | ``` 17 | 18 | if it still says "unknown trust" even after you lsign it, try this and then resign: 19 | ```bash 20 | sudo rm -rf /etc/pacman.d/gnupg 21 | sudo pacman-key --init 22 | sudo pacman-key --populate archlinux 23 | sudo pacman-key --populate archlinuxarm 24 | ``` 25 | 26 | ## Note on `linux-x13s` 27 | For now, you will need `efi=noruntime clk_ignore_unused pd_ignore_unused arm64.nopauth` as kernel parameters to boot into the kernel. 28 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | cd /build 4 | 5 | 6 | repo_full=$(cat ./repo) 7 | repo_owner=$(echo $repo_full | cut -d/ -f1) 8 | repo_name=$(echo $repo_full | cut -d/ -f2) 9 | sed -i '/\[community\]/d' /etc/pacman.conf 10 | sed -i 's/#ParallelDownloads = 5/ParallelDownloads = 5/' /etc/pacman.conf 11 | pacman-key --init 12 | pacman -Syu --noconfirm --needed sudo git wget python 13 | useradd builduser -m 14 | chown -R builduser:builduser /build 15 | git config --global --add safe.directory /build 16 | sudo -u builduser gpg --keyserver keyserver.ubuntu.com --recv-keys 38DBBDC86092693E 17 | passwd -d builduser 18 | printf 'builduser ALL=(ALL) ALL\n' | tee -a /etc/sudoers 19 | 20 | cat ./gpg_key | base64 --decode | gpg --homedir /home/builduser/.gnupg --import 21 | rm ./gpg_key 22 | echo "checking out key" 23 | gpg --homedir /home/builduser/.gnupg --list-keys 24 | 25 | sudo pacman -S base-devel --noconfirm --needed 26 | 27 | for i in "linux-x13s" "linux-x13s-archiso" "x13s-firmware" ; do 28 | status=13 29 | git submodule update --init $i 30 | cd $i 31 | 32 | for i in $(sudo -u builduser makepkg --packagelist); do 33 | package=$(basename $i) 34 | wget https://github.com/$repo_owner/$repo_name/releases/download/packages/$package \ 35 | && echo "Warning: $package already built, did you forget to bump the pkgver and/or pkgrel? It will not be rebuilt." 36 | done 37 | sudo -u builduser bash -c 'export MAKEFLAGS=-j$(nproc) && makepkg --sign -s --noconfirm'||status=$? 38 | 39 | # Package already built is fine. 40 | if [ $status != 13 ]; then 41 | exit 1 42 | fi 43 | cd .. 44 | done 45 | 46 | cp */*.pkg.tar.* ./ 47 | repo-add --sign ./$repo_owner-x13s.db.tar.gz ./*.pkg.tar.xz 48 | 49 | for i in *.db *.files; do 50 | cp --remove-destination $(readlink $i) $i 51 | done 52 | -------------------------------------------------------------------------------- /geekbench-aarch64/PKGBUILD: -------------------------------------------------------------------------------- 1 | # Maintainer: Jake 2 | # Contributor: jose 3 | # Contributor: Roman Ajsin 4 | 5 | pkgname=geekbench 6 | pkgver=5.4.4 7 | pkgrel=1 8 | pkgdesc="A cross-platform benchmark that measures processor and memory performance" 9 | arch=('aarch64') 10 | url="https://www.geekbench.com/" 11 | depends=('zlib' 'gcc-libs') 12 | license=("custom") 13 | conflicts=("geekbench227") 14 | source=("http://cdn.geekbench.com/Geekbench-${pkgver}-LinuxARMPreview.tar.gz") 15 | sha512sums=('30fb53698f85acf4a269d23a3bddefc815a1f7353ba6224f07486f6c1c2a843fe250c50b8e14ca44be9265e9e7002ccd6fe0de01dee3e969b1a7f93330a3a62b') 16 | options=('!strip') 17 | 18 | package() { 19 | install -D -m755 $srcdir/Geekbench-${pkgver}-LinuxARMPreview/${pkgname}_aarch64 $pkgdir/opt/${pkgname}/${pkgname}_aarch64 20 | install -D -m644 $srcdir/Geekbench-${pkgver}-LinuxARMPreview/geekbench.plar $pkgdir/opt/${pkgname}/geekbench.plar 21 | install -D -m755 $srcdir/Geekbench-${pkgver}-LinuxARMPreview/${pkgname}5 $pkgdir/opt/${pkgname}/ 22 | install -d $pkgdir/usr/bin 23 | ln -s /opt/${pkgname}/${pkgname}5 $pkgdir/usr/bin/${pkgname} 24 | } 25 | 26 | -------------------------------------------------------------------------------- /linux-x13s-archiso/60-linux.hook: -------------------------------------------------------------------------------- 1 | [Trigger] 2 | Type = File 3 | Operation = Install 4 | Operation = Upgrade 5 | Operation = Remove 6 | Target = usr/lib/modules/%KERNVER%/* 7 | 8 | [Action] 9 | Description = Updating %PKGBASE% module dependencies... 10 | When = PostTransaction 11 | Exec = /usr/bin/depmod %KERNVER% 12 | -------------------------------------------------------------------------------- /linux-x13s-archiso/90-linux.hook: -------------------------------------------------------------------------------- 1 | [Trigger] 2 | Type = File 3 | Operation = Install 4 | Operation = Upgrade 5 | Target = boot/Image 6 | Target = usr/lib/initcpio/* 7 | 8 | [Action] 9 | Description = Updating %PKGBASE% initcpios... 10 | When = PostTransaction 11 | Exec = /usr/bin/mkinitcpio -p %PKGBASE% 12 | -------------------------------------------------------------------------------- /linux-x13s-archiso/PKGBUILD: -------------------------------------------------------------------------------- 1 | # AArch64 multi-platform 2 | # Maintainer: Kevin Mihelich 3 | 4 | buildarch=8 5 | 6 | pkgbase=linux-x13s-archiso 7 | _srcname=linux-lenovo-x13s-5.19.0 8 | _kernelname=${pkgbase#linux} 9 | _desc="ThinkPad X13s (Snapdragon 8cx Gen 3)" 10 | pkgver="5.19.0" 11 | pkgrel=1 12 | arch=('aarch64') 13 | url="http://www.kernel.org/" 14 | license=('GPL2') 15 | makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc' 'git' 'uboot-tools' 'vboot-utils' 'dtc') 16 | options=('!strip') 17 | source=("https://github.com/steev/linux/archive/refs/tags/lenovo-x13s-5.19.0.tar.gz" 18 | 'config' 19 | 'kernel.keyblock' 20 | 'kernel_data_key.vbprivk' 21 | 'linux.preset' 22 | '60-linux.hook' 23 | '90-linux.hook') 24 | md5sums=('a197bffd8b146ac351fe3042fb3f3358' 25 | 'c31ad0ebe639a9dd3472bc449c2faf16' 26 | '61c5ff73c136ed07a7aadbf58db3d96a' 27 | '584777ae88bce2c5659960151b64c7d8' 28 | '41cb5fef62715ead2dd109dbea8413d6' 29 | '0a5f16bfec6ad982a2f6782724cca8ba' 30 | '3dc88030a8f2f5a5f97266d99b149f77') 31 | 32 | prepare() { 33 | cd $_srcname 34 | 35 | echo "Setting version..." 36 | scripts/setlocalversion --save-scmversion 37 | echo "-$pkgrel" > localversion.10-pkgrel 38 | echo "${pkgbase#linux}" > localversion.20-pkgname 39 | 40 | # add upstream patch 41 | # We are using a custom tree, not needed 42 | 43 | # ALARM patches 44 | # Nothing to patch right now 45 | 46 | cat "${srcdir}/config" > ./.config 47 | } 48 | 49 | build() { 50 | cd ${_srcname} 51 | 52 | # get kernel version 53 | make prepare 54 | make -s kernelrelease > version 55 | 56 | # build! 57 | unset LDFLAGS 58 | make ${MAKEFLAGS} Image Image.gz modules 59 | # Generate device tree blobs with symbols to support applying device tree overlays in U-Boot 60 | make ${MAKEFLAGS} DTC_FLAGS="-@" dtbs 61 | } 62 | 63 | _package() { 64 | pkgdesc="The Linux Kernel and modules - ${_desc}" 65 | depends=('coreutils' 'x13s-firmware' 'kmod' 'mkinitcpio>=0.7') 66 | optdepends=('crda: to set the correct wireless channels of your country') 67 | provides=("linux=${pkgver}" "WIREGUARD-MODULE") 68 | replaces=('linux-armv8') 69 | conflicts=('linux') 70 | backup=("etc/mkinitcpio.d/${pkgbase}.preset") 71 | install=${pkgname}.install 72 | 73 | cd $_srcname 74 | local kernver="$(/dev/null && ! mountpoint -q /boot; then 3 | echo "WARNING: /boot appears to be a separate partition but is not mounted." 4 | fi 5 | } 6 | 7 | post_remove() { 8 | rm -f boot/initramfs-linux.img 9 | rm -f boot/initramfs-linux-fallback.img 10 | } 11 | -------------------------------------------------------------------------------- /linux-x13s-archiso/linux.preset: -------------------------------------------------------------------------------- 1 | # mkinitcpio preset file for the '%PKGBASE%' package 2 | 3 | ALL_config="/etc/mkinitcpio.conf" 4 | ALL_kver="%KERNVER%" 5 | 6 | PRESETS=('default' 'fallback') 7 | 8 | #default_config="/etc/mkinitcpio.conf" 9 | default_image="/boot/initramfs-linux.img" 10 | #default_options="" 11 | 12 | #fallback_config="/etc/mkinitcpio.conf" 13 | fallback_image="/boot/initramfs-linux-fallback.img" 14 | fallback_options="-S autodetect" 15 | -------------------------------------------------------------------------------- /linux-x13s-rc/60-linux.hook: -------------------------------------------------------------------------------- 1 | [Trigger] 2 | Type = File 3 | Operation = Install 4 | Operation = Upgrade 5 | Operation = Remove 6 | Target = usr/lib/modules/%KERNVER%/* 7 | 8 | [Action] 9 | Description = Updating %PKGBASE% module dependencies... 10 | When = PostTransaction 11 | Exec = /usr/bin/depmod %KERNVER% 12 | -------------------------------------------------------------------------------- /linux-x13s-rc/90-linux.hook: -------------------------------------------------------------------------------- 1 | [Trigger] 2 | Type = File 3 | Operation = Install 4 | Operation = Upgrade 5 | Target = boot/vmlinuz-linux 6 | Target = usr/lib/initcpio/* 7 | 8 | [Action] 9 | Description = Updating %PKGBASE% initcpios... 10 | When = PostTransaction 11 | Exec = /usr/bin/mkinitcpio -p %PKGBASE% 12 | -------------------------------------------------------------------------------- /linux-x13s-rc/PKGBUILD: -------------------------------------------------------------------------------- 1 | # AArch64 multi-platform 2 | # Maintainer: Alex R 3 | 4 | buildarch=8 5 | 6 | _rcver=6.7.0 7 | _rcrel=8 8 | _branch=lenovo-x13s-v6.7.0-rc8 9 | 10 | pkgbase=linux-x13s-rc 11 | _srcname=linux-${_rcver}-rc${_rcrel} 12 | _kernelname=${pkgbase#linux} 13 | _desc="ThinkPad X13s (Snapdragon 8cx Gen 3)" 14 | pkgver=${_rcver}.rc${_rcrel} 15 | pkgrel=0 16 | arch=('aarch64') 17 | url="http://www.kernel.org/" 18 | license=('GPL2') 19 | makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc' 'git' 'uboot-tools' 'vboot-utils' 'dtc') 20 | options=('!strip') 21 | source=('config' 22 | 'kernel.keyblock' 23 | 'kernel_data_key.vbprivk' 24 | 'linux.preset' 25 | '60-linux.hook' 26 | '90-linux.hook' 27 | ) 28 | md5sums=('6adaf682f926968aa80e2f149654e6f1' 29 | '61c5ff73c136ed07a7aadbf58db3d96a' 30 | '584777ae88bce2c5659960151b64c7d8' 31 | '41cb5fef62715ead2dd109dbea8413d6' 32 | '0a5f16bfec6ad982a2f6782724cca8ba' 33 | '6f99095fbe9f577233b53a83802aab59' 34 | ) 35 | 36 | prepare() { 37 | echo "Shallow cloning steev's linux repo" 38 | git clone --depth=1 https://github.com/steev/linux.git ${_srcname} -b ${_branch} 39 | 40 | cd $_srcname 41 | 42 | echo "Setting version..." 43 | #scripts/setlocalversion --save-scmversion 44 | echo "-$pkgrel" > localversion.10-pkgrel 45 | echo "${pkgbase#linux}" > localversion.20-pkgname 46 | 47 | # add upstream patch 48 | # We are using a custom tree, not needed 49 | 50 | # ALARM patches 51 | #patch -Np1 -i ../fix-mutter.patch 52 | 53 | cat "${srcdir}/config" > ./.config 54 | } 55 | 56 | build() { 57 | cd ${_srcname} 58 | 59 | # get kernel version 60 | make prepare 61 | make -s kernelrelease > version 62 | 63 | # build! 64 | unset LDFLAGS 65 | make ${MAKEFLAGS} Image Image.gz modules 66 | # Generate device tree blobs with symbols to support applying device tree overlays in U-Boot 67 | make ${MAKEFLAGS} DTC_FLAGS="-@" dtbs 68 | } 69 | 70 | _package() { 71 | pkgdesc="The Linux Kernel and modules - ${_desc}" 72 | depends=('coreutils' 'x13s-firmware' 'kmod' 'mkinitcpio>=0.7') 73 | optdepends=('crda: to set the correct wireless channels of your country') 74 | provides=("linux=${pkgver}" "WIREGUARD-MODULE") 75 | replaces=('linux-armv8') 76 | conflicts=('linux') 77 | backup=("etc/mkinitcpio.d/${pkgbase}.preset") 78 | install=${pkgname}.install 79 | 80 | cd $_srcname 81 | local kernver="$(/dev/null && ! mountpoint -q /boot; then 3 | echo "WARNING: /boot appears to be a separate partition but is not mounted." 4 | fi 5 | } 6 | 7 | post_remove() { 8 | rm -f boot/initramfs-linux.img 9 | rm -f boot/initramfs-linux-fallback.img 10 | } 11 | -------------------------------------------------------------------------------- /linux-x13s-rc/linux.preset: -------------------------------------------------------------------------------- 1 | # mkinitcpio preset file for the '%PKGBASE%' package 2 | 3 | ALL_config="/etc/mkinitcpio.conf" 4 | ALL_kver="%KERNVER%" 5 | 6 | PRESETS=('default' 'fallback') 7 | 8 | #default_config="/etc/mkinitcpio.conf" 9 | default_image="/boot/initramfs-linux.img" 10 | #default_options="" 11 | 12 | #fallback_config="/etc/mkinitcpio.conf" 13 | fallback_image="/boot/initramfs-linux-fallback.img" 14 | fallback_options="-S autodetect" 15 | -------------------------------------------------------------------------------- /linux-x13s/60-linux.hook: -------------------------------------------------------------------------------- 1 | [Trigger] 2 | Type = File 3 | Operation = Install 4 | Operation = Upgrade 5 | Operation = Remove 6 | Target = usr/lib/modules/%KERNVER%/* 7 | 8 | [Action] 9 | Description = Updating %PKGBASE% module dependencies... 10 | When = PostTransaction 11 | Exec = /usr/bin/depmod %KERNVER% 12 | -------------------------------------------------------------------------------- /linux-x13s/90-linux.hook: -------------------------------------------------------------------------------- 1 | [Trigger] 2 | Type = File 3 | Operation = Install 4 | Operation = Upgrade 5 | Target = boot/vmlinuz-linux 6 | Target = usr/lib/initcpio/* 7 | 8 | [Action] 9 | Description = Updating %PKGBASE% initcpios... 10 | When = PostTransaction 11 | Exec = /usr/bin/mkinitcpio -p %PKGBASE% 12 | -------------------------------------------------------------------------------- /linux-x13s/PKGBUILD: -------------------------------------------------------------------------------- 1 | # AArch64 multi-platform 2 | # Maintainer: Kevin Mihelich 3 | 4 | buildarch=8 5 | _branch=lenovo-x13s-linux-6.12.y 6 | 7 | pkgbase=linux-x13s 8 | _srcname=linux-6.12 9 | _kernelname=${pkgbase#linux} 10 | _desc="ThinkPad X13s (Snapdragon 8cx Gen 3)" 11 | pkgver="6.12.9" 12 | pkgrel=0 13 | arch=('aarch64') 14 | url="http://www.kernel.org/" 15 | license=('GPL2') 16 | makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc' 'git' 'uboot-tools' 'vboot-utils' 'dtc') 17 | options=('!strip') 18 | source=('config' 19 | 'kernel.keyblock' 20 | 'kernel_data_key.vbprivk' 21 | 'linux.preset' 22 | '60-linux.hook' 23 | '90-linux.hook' 24 | 'mkinitcpio.conf.d-x13s.conf' 25 | ) 26 | md5sums=('0834115a5d412eabf45d4b71e8c0407f' 27 | '61c5ff73c136ed07a7aadbf58db3d96a' 28 | '584777ae88bce2c5659960151b64c7d8' 29 | '593dacde485356f1ba746658d70b82d9' 30 | '0a5f16bfec6ad982a2f6782724cca8ba' 31 | '6f99095fbe9f577233b53a83802aab59' 32 | '431651c2d70b72482d5012b5eaf6c3e5' 33 | ) 34 | 35 | prepare() { 36 | MAKEFLAGS=-j8 37 | echo "Shallow cloning steev's linux repo" 38 | # if src dir exists, remove it 39 | [[ -d ${_srcname} ]] && rm -rf ${_srcname} 40 | git clone --depth=1 https://github.com/steev/linux.git ${_srcname} -b ${_branch} 41 | 42 | cd $_srcname 43 | 44 | echo "Setting version..." 45 | #scripts/setlocalversion --save-scmversion 46 | echo "-$pkgrel" > localversion.10-pkgrel 47 | echo "${pkgbase#linux}" > localversion.20-pkgname 48 | 49 | # add upstream patch 50 | # We are using a custom tree, not needed 51 | 52 | # ALARM patches 53 | #patch -Np1 -i ../fix-mutter.patch 54 | 55 | cat "${srcdir}/config" > ./.config 56 | } 57 | 58 | build() { 59 | cd ${_srcname} 60 | 61 | # get kernel version 62 | make prepare 63 | make -s kernelrelease > version 64 | 65 | # build! 66 | unset LDFLAGS 67 | make ${MAKEFLAGS} Image Image.gz modules 68 | # Generate device tree blobs with symbols to support applying device tree overlays in U-Boot 69 | make ${MAKEFLAGS} DTC_FLAGS="-@" dtbs 70 | } 71 | 72 | _package() { 73 | pkgdesc="The Linux Kernel and modules - ${_desc}" 74 | depends=('coreutils' 'x13s-firmware' 'kmod' 'mkinitcpio>=0.7') 75 | optdepends=('crda: to set the correct wireless channels of your country') 76 | provides=("linux=${pkgver}" "WIREGUARD-MODULE") 77 | replaces=('linux-armv8') 78 | conflicts=('linux') 79 | backup=("etc/mkinitcpio.d/${pkgbase}.preset") 80 | install=${pkgname}.install 81 | 82 | cd $_srcname 83 | local kernver="$(/dev/null && ! mountpoint -q /boot; then 3 | echo "WARNING: /boot appears to be a separate partition but is not mounted." 4 | fi 5 | } 6 | 7 | post_remove() { 8 | rm -f boot/initramfs-linux-x13s.img 9 | rm -f boot/initramfs-linux-x13s-fallback.img 10 | } 11 | -------------------------------------------------------------------------------- /linux-x13s/linux.preset: -------------------------------------------------------------------------------- 1 | # mkinitcpio preset file for the '%PKGBASE%' package 2 | 3 | ALL_config="/etc/mkinitcpio.conf.d/x13s.conf" 4 | ALL_kver="%KERNVER%" 5 | 6 | PRESETS=('default') 7 | 8 | #default_config="/etc/mkinitcpio.conf" 9 | default_image="/boot/initramfs-linux-x13s.img" 10 | #default_options="" 11 | -------------------------------------------------------------------------------- /linux-x13s/mkinitcpio.conf.d-x13s.conf: -------------------------------------------------------------------------------- 1 | MODULES=(nvme phy_qcom_qmp_pcie pcie_qcom i2c_hid_of i2c_qcom_geni leds_qcom_lpg pwm_bl qrtr pmic_glink_altmode gpio_sbu_mux phy_qcom_qmp_combo panel-edp msm phy_qcom_edp) 2 | 3 | BINARIES=() 4 | 5 | FILES=() 6 | 7 | HOOKS=(base udev autodetect modconf keyboard keymap consolefont block filesystems fsck) 8 | -------------------------------------------------------------------------------- /linux-x13s/patch_kernel_config.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import sys 4 | 5 | inputfile = sys.argv[1] 6 | outputfile = sys.argv[2] 7 | 8 | # uncomment for testing 9 | # inputfile = "/home/alex/src/git/x13s-alarm/linux-x13s/config" 10 | # outputfile = "config.out" 11 | 12 | with open(inputfile, "r") as f: 13 | lines = f.readlines() 14 | 15 | anomalies = { 16 | "CONFIG_CC_IMPLICIT_FALLTHROUGH": '"-Wimplicit-fallthrough=5"', 17 | } 18 | 19 | x13s_options = { 20 | # Add raw HID support so FIDO works in browsers 21 | "CONFIG_HIDRAW": "y", 22 | "CONFIG_USB_HIDDEV": "y", 23 | "CONFIG_HID_CP2112": "n", 24 | "CONFIG_HID_FT260": "n", 25 | # Turn on essential configuration options 26 | "CONFIG_BLOCK_LEGACY_AUTOLOAD": "y", 27 | "CONFIG_PHY_QCOM_APQ8064_SATA": "m", 28 | "CONFIG_PHY_QCOM_IPQ806X_SATA": "m", 29 | "CONFIG_PHY_QCOM_QMP": "y", 30 | "CONFIG_PHY_QCOM_QMP_PCIE": "y", 31 | "CONFIG_PHY_QCOM_QMP_PCIE_8996": "y", 32 | "CONFIG_PHY_QCOM_QMP_UFS": "y", 33 | "CONFIG_PHY_QCOM_QMP_USB": "y", 34 | "CONFIG_PHY_QCOM_QUSB2": "y", 35 | "CONFIG_PHY_QCOM_USB_SNPS_FEMTO_V2": "y", 36 | "CONFIG_BRIDGE": "m", 37 | "CONFIG_BRIDGE_NF_EBTABLES": "n", 38 | "CONFIG_BRIDGE_NETFILTER": "m", 39 | "CONFIG_BRIDGE_IGMP_SNOOPING": "y", 40 | "CONFIG_BRIDGE_MRP": "n", 41 | "CONFIG_BRIDGE_CFM": "n", 42 | "CONFIG_NETFILTER_XT_MATCH_PHYSDEV": "n", 43 | "CONFIG_IP_NF_NAT": "m", 44 | "CONFIG_NF_NAT": "m", 45 | "CONFIG_NETFILTER_XT_TARGET_NETMAP": "n", 46 | "CONFIG_NETFILTER_XT_TARGET_REDIRECT": "n", 47 | "CONFIG_NETFILTER_XT_TARGET_MASQUERADE": "n", 48 | "CONFIG_IP_NF_TARGET_MASQUERADE": "m", 49 | "CONFIG_IP_NF_TARGET_NETMAP": "n", 50 | "CONFIG_IP_NF_TARGET_REDIRECT": "n", 51 | # Turn on regularly used filystems 52 | "CONFIG_XFS_FS": "m", 53 | "CONFIG_XFS_SUPPORT_V4": "y", 54 | "CONFIG_XFS_SUPPORT_ASCII_CI": "y", 55 | "CONFIG_XFS_QUOTA": "y", 56 | "CONFIG_XFS_POSIX_ACL": "y", 57 | "CONFIG_XFS_RT": "n", 58 | "CONFIG_XFS_ONLINE_SCRUB": "n", 59 | "CONFIG_XFS_WARN": "n", 60 | "CONFIG_XFS_DEBUG": "n", 61 | "CONFIG_BTRFS_FS": "m", 62 | "CONFIG_BTRFS_FS_POSIX_ACL": "y", 63 | "CONFIG_BTRFS_FS_RUN_SANITY_TESTS": "y", 64 | "CONFIG_BTRFS_DEBUG": "y", 65 | "CONFIG_BTRFS_ASSERT": "n", 66 | "CONFIG_BTRFS_FS_REF_VERIFY": "n", 67 | "CONFIG_CEPH_FS": "n", 68 | "CONFIG_CODA_FS": "n", 69 | "CONFIG_AFS_FS": "n", 70 | "CONFIG_FS_ENCRYPTION": "y", 71 | "CONFIG_FS_ENCRYPTION_ALGS": "y", 72 | "CONFIG_FS_VERITY": "y", 73 | "CONFIG_FS_VERITY_BUILTIN_SIGNATURES": "n", 74 | "CONFIG_FSCACHE": "n", 75 | "CONFIG_NETFS_SUPPORT": "m", 76 | "CONFIG_NETFS_STATS": "n", 77 | "CONFIG_ISO9660_FS": "m", 78 | "CONFIG_JOLIET": "y", 79 | "CONFIG_ZISOFS": "y", 80 | "CONFIG_UDF_FS": "m", 81 | "CONFIG_FAT_DEFAULT_UTF8": "y", 82 | "CONFIG_EXFAT_FS": "m", 83 | "CONFIG_EXFAT_DEFAULT_IOCHARSET": '"utf8"', 84 | "CONFIG_NETWORK_FILESYSTEMS": "y", 85 | "CONFIG_NFS_FS": "m", 86 | "CONFIG_NFS_V2": "y", 87 | "CONFIG_NFS_V3": "y", 88 | "CONFIG_NFS_DISABLE_UDP_SUPPORT": "y", 89 | "CONFIG_NFS_V3_ACL": "n", 90 | "CONFIG_NFS_V4": "n", 91 | "CONFIG_NFS_SWAP": "n", 92 | "CONFIG_NFS_FSCACHE": "n", 93 | "CONFIG_NFSD": "n", 94 | "CONFIG_GRACE_PERIOD": "m", 95 | "CONFIG_LOCKD": "m", 96 | "CONFIG_LOCKD_V4": "y", 97 | "CONFIG_NFS_COMMON": "y", 98 | "CONFIG_SUNRPC": "m", 99 | "CONFIG_SUNRPC_GSS": "m", 100 | "CONFIG_SUNRPC_DEBUG": "n", 101 | "CONFIG_RPCSEC_GSS_KRB5": "m", 102 | "CONFIG_CIFS": "m", 103 | "CONFIG_CIFS_STATS2": "y", 104 | "CONFIG_CIFS_ALLOW_INSECURE_LEGACY": "y", 105 | "CONFIG_CIFS_DEBUG": "y", 106 | "CONFIG_CIFS_UPCALL": "n", 107 | "CONFIG_CIFS_XATTR": "n", 108 | "CONFIG_CIFS_DEBUG2": "n", 109 | "CONFIG_CIFS_DEBUG_DUMP_KEYS": "n", 110 | "CONFIG_CIFS_DFS_UPCALL": "n", 111 | "CONFIG_CIFS_SWN_UPCALL": "n", 112 | "CONFIG_SMB_SERVER": "n", 113 | "CONFIG_SMBFS": "m", 114 | "CONFIG_NLS_UCS2_UTILS": "m", 115 | "CONFIG_XOR_BLOCKS": "m", 116 | "CONFIG_CRYPTO_BLAKE2B": "m", 117 | "CONFIG_CRYPTO_XXHASH": "m", 118 | "CONFIG_RAID6_PQ": "m", 119 | "CONFIG_RAID6_PQ_BENCHMARK": "y", 120 | "CONFIG_CRC_ITU_T": "m", 121 | "CONFIG_ZLIB_DEFLATE": "m", 122 | "CONFIG_ZSTD_COMPRESS": "m", 123 | # Enable the hardware to use the filesystems 124 | "CONFIG_CDROM": "m", 125 | "CONFIG_BLK_DEV_SR": "m", 126 | "CONFIG_CHR_DEV_SG": "m", 127 | "CONFIG_USB_EHCI_HCD": "y", 128 | "CONFIG_USB_EHCI_ROOT_HUB_TT": "n", 129 | "CONFIG_USB_EHCI_FSL": "n", 130 | "CONFIG_USB_EHCI_HCD_PLATFORM": "n", 131 | "CONFIG_USB_SISUSBVGA": "n", 132 | "CONFIG_USB_EHCI_TT_NEWSCHED": "y", 133 | "CONFIG_BCM_SBA_RAID": "n", 134 | "CONFIG_NETFS_DEBUG": "n", 135 | } 136 | leftovers = [] 137 | for key in x13s_options: 138 | leftovers.append(key) 139 | 140 | options = {} 141 | 142 | new_lines = [] 143 | for line in lines: 144 | if line.startswith("#"): 145 | if "is not set" in line: 146 | foo = line.split("is not set")[0].strip() 147 | key = foo.split("#")[1].strip() 148 | new_lines.append((key, "not set")) 149 | else: 150 | new_lines.append(line) 151 | elif line == "\n": 152 | new_lines.append(line) 153 | else: 154 | key = line.split("=")[0] 155 | value = line.split("=")[1] 156 | new_lines.append((key, value)) 157 | 158 | output_lines = [] 159 | for line in new_lines: 160 | if isinstance(line, tuple): 161 | key, value = line 162 | if key in x13s_options: 163 | if value != x13s_options[key]: 164 | output_lines.append(f"{key}={x13s_options[key]}\n") 165 | else: 166 | output_lines.append(f"{key}={value}") 167 | leftovers.remove(key) 168 | elif key in anomalies: 169 | output_lines.append(f"{key}={anomalies[key]}\n") 170 | elif value != "not set": 171 | output_lines.append(f"{key}={value}") 172 | else: 173 | output_lines.append(f"# {key} is not set\n") 174 | else: 175 | output_lines.append(line) 176 | 177 | for extra_config in leftovers: 178 | output_lines.append(f"{extra_config}={x13s_options[extra_config]}\n") 179 | 180 | with open(outputfile, "w") as f: 181 | f.writelines(output_lines) 182 | 183 | print("Done!") 184 | print(leftovers) 185 | -------------------------------------------------------------------------------- /x13s-firmware/PKGBUILD: -------------------------------------------------------------------------------- 1 | pkgname="x13s-firmware" 2 | pkgdesc="ThinkPad X13s firmware" 3 | pkgver=20240610 4 | pkgrel=0 5 | arch=("any") 6 | options=('!strip') 7 | url="https://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git;a=summary" 8 | license=('GPL2' 'GPL3' 'custom') 9 | makedepends=('git') 10 | options=(!strip) 11 | pkgname=(x13s-firmware) 12 | _srcdir=linux-firmware 13 | 14 | source=("git+https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git" 15 | "a690_gmu.bin" 16 | "hpnv21.b8c" 17 | "qcvss8280.mbn" 18 | ) 19 | sha256sums=('SKIP' 20 | '163c1e3126d70d36c1ad9db5dd3721969b164f9623f6a7db773677882e40936d' 21 | '8b6a1e2d4233e0a17d5c2dce568386fe9c7974b872da47900242c3485f57d0f7' 22 | 'c81f3f060f69c5940121fe6e36da20d9c864d78b3bbffe361ec8878a7f9bd7b3' 23 | ) 24 | 25 | prepare() { 26 | cd linux-firmware 27 | git checkout tags/${pkgver} 28 | local _c 29 | for _c in "${_backports[@]}"; do 30 | git log --oneline -1 "${_c}" 31 | git cherry-pick -n "${_c}" 32 | done 33 | } 34 | 35 | package_x13s-firmware() { 36 | pkgdesc+=" - X13s / Firmware for ThinkPad X13s" 37 | 38 | install -Dt "${pkgdir}/usr/share/licenses/${pkgname}" -m644 ${_srcdir}/WHENCE 39 | 40 | mkdir -pv "${pkgdir}"/usr/lib/firmware 41 | cp -rv "${_srcdir}"/qca "${pkgdir}"/usr/lib/firmware 42 | cp -rv "${_srcdir}"/qcom "${pkgdir}"/usr/lib/firmware 43 | cp -rv "${_srcdir}"/ath11k "${pkgdir}"/usr/lib/firmware 44 | cp -rv "${_srcdir}"/rtl_nic "${pkgdir}"/usr/lib/firmware 45 | # Install video acceleration support (venus) firmware for X13s 46 | cp qcvss8280.mbn "${pkgdir}"/usr/lib/firmware/qcom/sc8280xp/LENOVO/21BX 47 | # Install bluetooth firmware for X13s 48 | cp hpnv21.b8c "${pkgdir}"/usr/lib/firmware/qca 49 | # Install gpu firmware for X13s 50 | cp a690_gmu.bin "${pkgdir}"/usr/lib/firmware/qcom 51 | # Create a symlink for X13s sound firmware 52 | cd "${pkgdir}"/usr/lib/firmware/qcom/sc8280xp 53 | ln -s LENOVO/21BX/audioreach-tplg.bin SC8280XP-LENOVO-X13S-tplg.bin 54 | # Create a symlink for X13s's WiFi card 55 | cd "${pkgdir}"/usr/lib/firmware/ath11k/WCN6855 56 | ln -s hw2.0/ hw2.1 57 | } 58 | -------------------------------------------------------------------------------- /x13s-firmware/a690_gmu.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironrobin/x13s-alarm/8a42d8f2eee2e09dd2953df68816a11b6d4952f5/x13s-firmware/a690_gmu.bin -------------------------------------------------------------------------------- /x13s-firmware/hpnv21.b8c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironrobin/x13s-alarm/8a42d8f2eee2e09dd2953df68816a11b6d4952f5/x13s-firmware/hpnv21.b8c -------------------------------------------------------------------------------- /x13s-firmware/qcvss8280.mbn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironrobin/x13s-alarm/8a42d8f2eee2e09dd2953df68816a11b6d4952f5/x13s-firmware/qcvss8280.mbn --------------------------------------------------------------------------------