From b33d2b4a9a4568ba67f6ed07e343e9eac0be2f7e Mon Sep 17 00:00:00 2001 From: Thomas Glanzmann Date: Tue, 10 Oct 2023 20:55:59 +0200 Subject: [PATCH 01/16] simplify build script and get virqfd=y --- config.txt | 2 +- m1n1_uboot_kernel.sh | 12 +++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/config.txt b/config.txt index b0bda6e..f37d831 100644 --- a/config.txt +++ b/config.txt @@ -5705,7 +5705,7 @@ CONFIG_QCOM_GSBI=m CONFIG_ARM64_ERRATUM_1742098=y CONFIG_VIDEO_IVTV=m CONFIG_QEDF=m -CONFIG_VFIO_VIRQFD=m +CONFIG_VFIO_VIRQFD=y CONFIG_CARL9170_LEDS=y CONFIG_SERIAL_XILINX_PS_UART=y CONFIG_SCSI_BNX2_ISCSI=m diff --git a/m1n1_uboot_kernel.sh b/m1n1_uboot_kernel.sh index 9e9b90b..dc30fd4 100644 --- a/m1n1_uboot_kernel.sh +++ b/m1n1_uboot_kernel.sh @@ -26,9 +26,9 @@ build_linux() git fetch -a -t git reset --hard asahi-6.5-13 cat ../../config.txt > .config - make LLVM=${CLANG_VERSION} rustavailable - make LLVM=${CLANG_VERSION} olddefconfig - make -j `nproc` LLVM=${CLANG_VERSION} V=0 bindeb-pkg > /dev/null + make LLVM=-15 rustavailable + make LLVM=-15 olddefconfig + make -j `nproc` LLVM=-15 V=0 bindeb-pkg > /dev/null ) } @@ -90,12 +90,6 @@ EOF ) } -if type clang-15; then - export CLANG_VERSION=-15 -elif type clang-11; then - export CLANG_VERSION=-11 -fi - mkdir -p build cd build -- 2.39.2 From 4f88b92567806980ac34b8f0225d668790c4c955 Mon Sep 17 00:00:00 2001 From: Thomas Glanzmann Date: Thu, 12 Oct 2023 21:52:07 +0200 Subject: [PATCH 02/16] bump rust version --- prepare_rust.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prepare_rust.sh b/prepare_rust.sh index 7bdb067..8e66744 100644 --- a/prepare_rust.sh +++ b/prepare_rust.sh @@ -16,8 +16,8 @@ export RUSTUP_HOME="$(pwd)/build/rust" rm -rf ${CARGO_HOME} ${RUSTUP_HOME} curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path --default-toolchain none source "$(pwd)/build/cargo/env" -rustup override set 1.68.2 +rustup override set 1.70.0 rustup component add rust-src -cargo install --locked --version 0.56.0 bindgen #-cli +cargo install --locked --version 0.62.0 bindgen-cli rustup component add rustfmt rustup component add clippy -- 2.39.2 From e5a3ffbe79597596cf5987286a0711c00d65a047 Mon Sep 17 00:00:00 2001 From: Thomas Glanzmann Date: Thu, 12 Oct 2023 21:53:27 +0200 Subject: [PATCH 03/16] bump linux / u-boot version; Run clean -f -x -d in the kernel tree to make sure that no old artefacts that were compiled using the wrong llvm/clan version are lying around --- m1n1_uboot_kernel.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/m1n1_uboot_kernel.sh b/m1n1_uboot_kernel.sh index dc30fd4..5536715 100644 --- a/m1n1_uboot_kernel.sh +++ b/m1n1_uboot_kernel.sh @@ -24,7 +24,8 @@ build_linux() test -d linux || git clone https://github.com/AsahiLinux/linux cd linux git fetch -a -t - git reset --hard asahi-6.5-13 + git reset --hard asahi-6.5-15 + git clean -f -x -d > /dev/null cat ../../config.txt > .config make LLVM=-15 rustavailable make LLVM=-15 olddefconfig @@ -49,7 +50,7 @@ build_uboot() test -d u-boot || git clone https://github.com/AsahiLinux/u-boot cd u-boot git fetch -a -t - git reset --hard asahi-v2023.07.02-2; + git reset --hard asahi-v2023.07.02-3 make apple_m1_defconfig make -j `nproc` -- 2.39.2 From 65ef55f7c7ab2619eec53b9ab62b8271915f1f84 Mon Sep 17 00:00:00 2001 From: Thomas Glanzmann Date: Thu, 12 Oct 2023 22:09:46 +0200 Subject: [PATCH 04/16] fix typo --- m1n1_uboot_kernel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m1n1_uboot_kernel.sh b/m1n1_uboot_kernel.sh index 5536715..5d17dbb 100644 --- a/m1n1_uboot_kernel.sh +++ b/m1n1_uboot_kernel.sh @@ -39,7 +39,7 @@ build_m1n1() test -d m1n1 || git clone --recursive https://github.com/AsahiLinux/m1n1 cd m1n1 git fetch -a -t - git reset --hard v{M1N1_VERSION}; + git reset --hard v${M1N1_VERSION}; make -j `nproc` ) } -- 2.39.2 From cc33cf0ab01e935b59caf1c8a5a1a57d4c789be7 Mon Sep 17 00:00:00 2001 From: Thomas Glanzmann Date: Thu, 12 Oct 2023 22:36:18 +0200 Subject: [PATCH 05/16] bump version --- meta.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta.sh b/meta.sh index a42ba46..376d4e5 100644 --- a/meta.sh +++ b/meta.sh @@ -12,14 +12,14 @@ unset LANG mkdir -p build cd build -export META_VERSION=6.4.0-3 +export META_VERSION=6.5.0-1 rm -rf linux-image-asahi_${META_VERSION}_arm64 mkdir -p linux-image-asahi_${META_VERSION}_arm64/DEBIAN cat > linux-image-asahi_${META_VERSION}_arm64/DEBIAN/control < Date: Fri, 13 Oct 2023 18:36:40 +0200 Subject: [PATCH 06/16] bump version --- m1n1_uboot_kernel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m1n1_uboot_kernel.sh b/m1n1_uboot_kernel.sh index 5d17dbb..15d3cc4 100644 --- a/m1n1_uboot_kernel.sh +++ b/m1n1_uboot_kernel.sh @@ -16,7 +16,7 @@ source "$(pwd)/build/cargo/env" unset LC_CTYPE unset LANG -export M1N1_VERSION=1.4.2 +export M1N1_VERSION=1.4.3 build_linux() { -- 2.39.2 From c8c18241fdee4e453721940396a04cd38da2e976 Mon Sep 17 00:00:00 2001 From: Thomas Glanzmann Date: Sat, 14 Oct 2023 07:54:42 +0200 Subject: [PATCH 07/16] git clean m1n1 and u-boot as well --- m1n1_uboot_kernel.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/m1n1_uboot_kernel.sh b/m1n1_uboot_kernel.sh index 15d3cc4..3129b1b 100644 --- a/m1n1_uboot_kernel.sh +++ b/m1n1_uboot_kernel.sh @@ -40,6 +40,7 @@ build_m1n1() cd m1n1 git fetch -a -t git reset --hard v${M1N1_VERSION}; + git clean -f -x -d > /dev/null make -j `nproc` ) } @@ -51,6 +52,7 @@ build_uboot() cd u-boot git fetch -a -t git reset --hard asahi-v2023.07.02-3 + git clean -f -x -d > /dev/null make apple_m1_defconfig make -j `nproc` -- 2.39.2 From a5cc7a10225db8e3db23aac34369e3eed9e0333e Mon Sep 17 00:00:00 2001 From: Thomas Glanzmann Date: Tue, 31 Oct 2023 11:35:08 +0100 Subject: [PATCH 08/16] another faq --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index f9813ee..da10560 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,10 @@ Than open a terminal, and run the following commands: # FAQ +## Does it work on M2? + +Yes, M3 is not yet supported. + ## Are you still maintaining this? Yes, I do and will continue doing this until there is an official Debian installer. -- 2.39.2 From 271eb92000a6fa29081165136d3c07290321c20d Mon Sep 17 00:00:00 2001 From: Thomas Glanzmann Date: Sun, 5 Nov 2023 08:34:20 +0100 Subject: [PATCH 09/16] bump supported firmware --- installer_data.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/installer_data.json b/installer_data.json index fc7ae81..84964f8 100644 --- a/installer_data.json +++ b/installer_data.json @@ -1,12 +1,12 @@ { "os_list": [ { - "name": "Debian bookworm (testing) packaged by Thomas Glanzmann", + "name": "Debian bookworm packaged by Thomas Glanzmann", "default_os_name": "Debian", "boot_object": "m1n1.bin", "next_object": "m1n1/boot.bin", "package": "debian-base.zip", - "supported_fw": ["12.3", "12.4"], + "supported_fw": ["12.3", "12.3.1", "12.4", "13.5"], "partitions": [ { "name": "EFI", -- 2.39.2 From 03c61a1c8cc0d797dd17d40eda298d47c32ee791 Mon Sep 17 00:00:00 2001 From: Thomas Glanzmann Date: Sun, 5 Nov 2023 08:51:22 +0100 Subject: [PATCH 10/16] use Debian stable as image --- bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap.sh b/bootstrap.sh index cddb966..b723279 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -19,7 +19,7 @@ build_rootfs() ( sudo rm -rf testing mkdir -p cache - sudo eatmydata ${DEBOOTSTRAP} --cache-dir=`pwd`/cache --arch=arm64 --include initramfs-tools,pciutils,wpasupplicant,tcpdump,vim,tmux,vlan,ntpdate,parted,curl,wget,grub-efi-arm64,mtr-tiny,dbus,ca-certificates,sudo,openssh-client,mtools,gdisk,cryptsetup,wireless-regdb,zstd testing testing http://deb.debian.org/debian + sudo eatmydata ${DEBOOTSTRAP} --cache-dir=`pwd`/cache --arch=arm64 --include initramfs-tools,pciutils,wpasupplicant,tcpdump,vim,tmux,vlan,ntpdate,parted,curl,wget,grub-efi-arm64,mtr-tiny,dbus,ca-certificates,sudo,openssh-client,mtools,gdisk,cryptsetup,wireless-regdb,zstd stable testing http://deb.debian.org/debian cd testing -- 2.39.2 From a310314451c618a25b1403a58c0ad0726db760dc Mon Sep 17 00:00:00 2001 From: Thomas Glanzmann Date: Sun, 12 Nov 2023 09:55:24 +0100 Subject: [PATCH 11/16] bump versions --- m1n1_uboot_kernel.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/m1n1_uboot_kernel.sh b/m1n1_uboot_kernel.sh index 3129b1b..9ae38ef 100644 --- a/m1n1_uboot_kernel.sh +++ b/m1n1_uboot_kernel.sh @@ -16,7 +16,8 @@ source "$(pwd)/build/cargo/env" unset LC_CTYPE unset LANG -export M1N1_VERSION=1.4.3 +export M1N1_VERSION=1.4.6 +export KERNEL_VERSION=asahi-6.5-26 build_linux() { @@ -24,7 +25,7 @@ build_linux() test -d linux || git clone https://github.com/AsahiLinux/linux cd linux git fetch -a -t - git reset --hard asahi-6.5-15 + git reset --hard $KERNEL_VERSION git clean -f -x -d > /dev/null cat ../../config.txt > .config make LLVM=-15 rustavailable -- 2.39.2 From 31b39e6a66a20e6b984524f3f63117ac77f2bf18 Mon Sep 17 00:00:00 2001 From: Thomas Glanzmann Date: Sun, 12 Nov 2023 11:28:15 +0100 Subject: [PATCH 12/16] add build script for speakersafeteyd --- meta.sh | 4 ++-- prepare_rust.sh | 1 + speakersafetyd.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 speakersafetyd.sh diff --git a/meta.sh b/meta.sh index 376d4e5..999f97b 100644 --- a/meta.sh +++ b/meta.sh @@ -12,14 +12,14 @@ unset LANG mkdir -p build cd build -export META_VERSION=6.5.0-1 +export META_VERSION=6.5.0-2 rm -rf linux-image-asahi_${META_VERSION}_arm64 mkdir -p linux-image-asahi_${META_VERSION}_arm64/DEBIAN cat > linux-image-asahi_${META_VERSION}_arm64/DEBIAN/control <> Cargo.toml +[package.metadata.deb] +maintainer = "Thomas Glanzmann " +copyright = "The Asahi Linux Contributors" +license-file = ["LICENSE", "0"] +depends = "$auto" +assets = [ + ["LICENSE", "/var/lib/speakersafetyd/blackbox/", "644"], + ["target/release/speakersafetyd", "/usr/bin/speakersafetyd", "755"], + ["95-speakersafetyd.rules", "/usr/lib/udev/rules.d/95-speakersafetyd.rules", "644"], + ["speakersafetyd.service", "/usr/lib/systemd/system/speakersafetyd.service", "644"], + ["conf/apple/*", "/usr/share/speakersafetyd/apple/", "644"], +] +EOF + +make +cargo install cargo-deb +cargo deb -- 2.39.2 From 9885218516ed8dba97777a57188dee6f7b38af3b Mon Sep 17 00:00:00 2001 From: Thomas Glanzmann Date: Sun, 12 Nov 2023 12:02:25 +0100 Subject: [PATCH 13/16] add faq about sound --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index da10560..412b002 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,20 @@ Than open a terminal, and run the following commands: # FAQ +## How to enable spakers? + +Currently speakers are only supported on M1 air. Install the necessary packages: + + apt update + apt upgrade -y + apt dist-upgrade -y + apt install -y alsa-ucm-conf-asahi speakersafetyd + reboot + +After the reboot I need to restart the speakersafetyd in order to hear sound out of the speakers: + + sudo systemctl restart speakersafetyd + ## Does it work on M2? Yes, M3 is not yet supported. -- 2.39.2 From 2a045cd4d35693a74881fe42faf9c81e10aadf57 Mon Sep 17 00:00:00 2001 From: Thomas Glanzmann Date: Sun, 12 Nov 2023 12:08:00 +0100 Subject: [PATCH 14/16] default rustup version no longer needs to be specified --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index 412b002..b4f9cd2 100644 --- a/README.md +++ b/README.md @@ -182,10 +182,6 @@ updates are a little bit more cumbersome but also seldom. export RUSTUP_HOME="/home/sithglan/work/m1-debian/build/rust" source "/home/sithglan/work/m1-debian/build/cargo/env" -- You have to specify the default rust version: - - rustup default 1.68.2 - - Tell zfs which version of clang you use to compile the kernel: export KERNEL_LLVM=-15 -- 2.39.2 From 9703bbcfaa3c5b3dac1cf6f868934cae3256b408 Mon Sep 17 00:00:00 2001 From: Thomas Glanzmann Date: Sun, 17 Dec 2023 16:11:56 +0100 Subject: [PATCH 15/16] more kernel config options --- patch_kernel_config.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/patch_kernel_config.pl b/patch_kernel_config.pl index 1b39027..a93b64d 100644 --- a/patch_kernel_config.pl +++ b/patch_kernel_config.pl @@ -85,6 +85,7 @@ my %asahi_options = ( 'CONFIG_USB_DWC3_PCI' => 'm', 'CONFIG_USB_XHCI_PCI_ASMEDIA' => 'y', 'CONFIG_VIDEO_APPLE_ISP' => 'm', + 'CONFIG_REGULATOR_FIXED_VOLTAGE' => 'y', ); my %debian_options; -- 2.39.2 From 646674550434dc2fcee57238bc5ff589bbc2c822 Mon Sep 17 00:00:00 2001 From: Thomas Glanzmann Date: Wed, 20 Dec 2023 21:19:58 +0100 Subject: [PATCH 16/16] bump versions --- m1n1_uboot_kernel.sh | 7 ++++--- mesa.sh | 2 +- prepare_rust.sh | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/m1n1_uboot_kernel.sh b/m1n1_uboot_kernel.sh index 9ae38ef..72727a8 100644 --- a/m1n1_uboot_kernel.sh +++ b/m1n1_uboot_kernel.sh @@ -16,8 +16,9 @@ source "$(pwd)/build/cargo/env" unset LC_CTYPE unset LANG -export M1N1_VERSION=1.4.6 -export KERNEL_VERSION=asahi-6.5-26 +export M1N1_VERSION=1.4.11 +export KERNEL_VERSION=asahi-6.6-14 +export UBOOT_VERSION=asahi-v2023.07.02-4 build_linux() { @@ -52,7 +53,7 @@ build_uboot() test -d u-boot || git clone https://github.com/AsahiLinux/u-boot cd u-boot git fetch -a -t - git reset --hard asahi-v2023.07.02-3 + git reset --hard $UBOOT_VERSION git clean -f -x -d > /dev/null make apple_m1_defconfig diff --git a/mesa.sh b/mesa.sh index 166268d..c08938e 100644 --- a/mesa.sh +++ b/mesa.sh @@ -25,7 +25,7 @@ git fetch -a -t # the latest mesa tag will be in sync with the latest kernel tag and usually # also the latest live kernel (except when I'm about to do a release) # 17:18 if those two desync it'll refuse to initialize -git reset --hard asahi-20230904 +git reset --hard asahi-20231213 rm -rf debian cp -a ../../mesa-debian debian EMAIL=thomas@glanzmann.de dch -v 23.0.0-`date +%Y%m%d%H%M` 'asahi wip' diff --git a/prepare_rust.sh b/prepare_rust.sh index 31d85dd..325b96b 100644 --- a/prepare_rust.sh +++ b/prepare_rust.sh @@ -16,9 +16,9 @@ export RUSTUP_HOME="$(pwd)/build/rust" rm -rf ${CARGO_HOME} ${RUSTUP_HOME} curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path --default-toolchain none source "$(pwd)/build/cargo/env" -rustup override set 1.70.0 -rustup default 1.70.0 +rustup override set 1.71.1 +rustup default 1.71.1 rustup component add rust-src -cargo install --locked --version 0.62.0 bindgen-cli +cargo install --locked --version 0.65.1 bindgen-cli rustup component add rustfmt rustup component add clippy -- 2.39.2