]> git.zerfleddert.de Git - m1-debian/commitdiff
Merge branch 'master' of a.gmvl.de:/git/m1-debian
authorThomas Glanzmann <thomas@glanzmann.de>
Sun, 11 Dec 2022 10:48:12 +0000 (11:48 +0100)
committerThomas Glanzmann <thomas@glanzmann.de>
Sun, 11 Dec 2022 10:48:12 +0000 (11:48 +0100)
gpu.sh
libunwind.sh [new file with mode: 0644]
mesa.sh
meta.sh [new file with mode: 0644]

diff --git a/gpu.sh b/gpu.sh
index 51ac4deafcb0d0442bd9418feee7da1208e60000..46cc25098e6d7823b46eeebcc98fa7dcb5e68bb8 100644 (file)
--- a/gpu.sh
+++ b/gpu.sh
@@ -51,9 +51,41 @@ build_uboot()
         cat m1n1/build/m1n1.bin   `find linux/arch/arm64/boot/dts/apple/ -name \*.dtb` <(gzip -c u-boot/u-boot-nodtb.bin) > u-boot.bin
 }
 
+package_boot_bin()
+{
+(
+        export M1N1_VERSION=1.2.2-1
+        rm -rf m1n1_${M1N1_VERSION}
+        mkdir -p m1n1_${M1N1_VERSION}/DEBIAN m1n1_${M1N1_VERSION}/usr/lib/m1n1/
+        cp u-boot.bin m1n1_${M1N1_VERSION}/usr/lib/m1n1/boot.bin
+cat > m1n1_${M1N1_VERSION}/DEBIAN/control <<EOF
+Package: m1n1
+Version: $M1N1_VERSION
+Section: base
+Priority: optional
+Architecture: arm64
+Maintainer: Thomas Glanzmann <thomas@glanzmann.de>
+Description: Apple silicon boot loader
+ Next to m1n1 this also contains the device trees and u-boot.
+EOF
+
+cat > m1n1_${M1N1_VERSION}/DEBIAN/postinst <<EOF
+#!/bin/bash
+
+export PATH=/bin
+cp /boot/efi/m1n1/boot.bin /boot/efi/m1n1/`date +%Y%m%d%H%M`.bin
+cp /usr/lib/m1n1/boot.bin /boot/efi/m1n1/
+EOF
+
+chmod 755 m1n1_${M1N1_VERSION}/DEBIAN/postinst
+)
+        dpkg-deb --build m1n1_${M1N1_VERSION}
+}
+
 mkdir -p build
 cd build
 
 build_linux
 build_m1n1
 build_uboot
+package_boot_bin
diff --git a/libunwind.sh b/libunwind.sh
new file mode 100644 (file)
index 0000000..bb95a64
--- /dev/null
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+
+set -o errexit
+set -o nounset
+set -o pipefail
+set -o xtrace
+
+cd "$(dirname "$0")"
+
+unset LC_CTYPE
+unset LANG
+
+main() {
+        mkdir -p build
+        cd build
+        dpkg -s devscripts >/dev/null 2>&1 || sudo apt-get install devscripts
+        rm -rf libunwind-1.6.2/
+        apt-get source libunwind
+        cd libunwind-1.6.2/
+        EMAIL=thomas@glanzmann.de dch 'Variable page size patch applied'
+        curl -sL https://tg.st/u/0001-libunwind-1.6.2-dynamic-page-size.patch > debian/patches/0001-libunwind-1.6.2-dynamic-page-size.patch
+        echo '0001-libunwind-1.6.2-dynamic-page-size.patch' >> debian/patches/series
+        sudo apt-get build-dep .
+        dpkg-buildpackage -uc -us -a arm64
+}
+
+main "$@"
diff --git a/mesa.sh b/mesa.sh
index c41008558af546fdd0b1bdd55087499c4d4f20d3..94df419d37b1a211ef6e9027af72995bcc5e2025 100644 (file)
--- a/mesa.sh
+++ b/mesa.sh
@@ -13,6 +13,10 @@ unset LANG
 main() {
         mkdir -p build
         cd build
+
+        # devscripts needed for dch and dcmd
+        dpkg -s devscripts >/dev/null 2>&1 || sudo apt-get install devscripts
+
         command -v git >/dev/null || sudo apt-get install git
         test -d mesa || git clone https://gitlab.freedesktop.org/asahi/mesa.git
         cd mesa
diff --git a/meta.sh b/meta.sh
new file mode 100644 (file)
index 0000000..6c3c1b7
--- /dev/null
+++ b/meta.sh
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+
+set -o errexit
+set -o nounset
+set -o pipefail
+set -o xtrace
+
+cd "$(dirname "$0")"
+
+unset LC_CTYPE
+unset LANG
+
+main() {
+        mkdir -p build
+        cd build
+        export META_VERSION=6.1.0-1
+        rm -rf linux-image-asahi_${META_VERSION}
+        mkdir -p linux-image-asahi_${META_VERSION}/DEBIAN
+cat > linux-image-asahi_${META_VERSION}/DEBIAN/control <<EOF
+Package: linux-image-asahi
+Version: $META_VERSION
+Section: base
+Depends: linux-image-6.1.0-rc8-asahi (>= 6.1.0-rc8-asahi-36)
+Priority: optional
+Architecture: arm64
+Maintainer: Thomas Glanzmann <thomas@glanzmann.de>
+Description: Linux for 64-bit apple silicon machines (meta-package)
+EOF
+        dpkg-deb --build linux-image-asahi_${META_VERSION}
+}
+
+main "$@"
+
Impressum, Datenschutz