Skip to content

Commit

Permalink
Merge branch 'kernel' into kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
joske authored Jan 24, 2024
2 parents e4744fc + 24e9863 commit 5e8edfa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 42 deletions.
55 changes: 14 additions & 41 deletions linux-asahi/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ buildarch=8

_rcver=6.6
#_rcrel=3
_asahirel=14
pkgrel=2

_m1n1_version=1.4.9
_asahirel=15
pkgrel=1

_m1n1_version=1.4.11
_mesa_version=24.0.0_pre20240123-1

pkgbase=linux-asahi
#_commit_id=asahi-${_nextver}-${_asahirel}
Expand All @@ -28,14 +30,12 @@ options=('!strip')
source=(
https://github.com/AsahiLinux/linux/archive/${_commit_id}.tar.gz
config # the main kernel config file
config.edge # overrides for linux-asahi-edge
)
sha256sums=('b633c6055dbbbd56b6af555afa07c8c68ba27d778c4be1b630c6e56fc6da73c2'
'9d89cfd453c04b0f3054df1eda25df71cb4da88156cdca4f58a1f175657ea452'
'a30d8bfd24b9cdd45755bf5eda9ba876195a860527552d1e704516702e792872')
b2sums=('5ead418fa294d5015af560b4249324aa2531a2aa34db214be4d09ab9cef602b6ffdbee7a45a21329b35a9df96bbaf7312b8b311a6461066af33ceafdb1aabeb7'
'efdd875bf6b28e97b31524f92d99d927610fd82586bea274d52648d864b70b448c4e573f41e60cd70ac8e4aebb537d6bd4fc527740195d4cad627a1dd4711350'
'329d247959ba2862a7e55714ebc59886c62b840f1cab9d27b7b74b2379789f0da607b08c22b5ceddf6d2487761f6cba350d6e0997d53c0f2642e81d7da3c4c8b')
sha256sums=('1d8d82dcfd87fb7153d81f52d01789be226c79637898de2b7407019ec7d35c8e'
'9d89cfd453c04b0f3054df1eda25df71cb4da88156cdca4f58a1f175657ea452')
b2sums=('f0cdce0421bb8637d52e82d2ff0b7e07c29e828783c7cb8733f1582916be81bfd14a0b6a98f51f633ee9da3d10aa1fff6b27c5779bd9fa55c1d04615173d6d4b'
'efdd875bf6b28e97b31524f92d99d927610fd82586bea274d52648d864b70b448c4e573f41e60cd70ac8e4aebb537d6bd4fc527740195d4cad627a1dd4711350')

export KBUILD_BUILD_HOST=archlinux
export KBUILD_BUILD_USER=$pkgbase
export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})"
Expand All @@ -56,45 +56,31 @@ prepare() {
done

echo "Creating build directories..."
mkdir -p build/base build/edge
mkdir -p build/base

echo "Setting config (base)..."
cp ../config build/base/.config
make olddefconfig prepare O=$PWD/build/base
diff -u ../config build/base/.config || :
make -s kernelrelease O=$PWD/build/base > build/base/version

echo "Setting config (edge)..."
cat build/base/.config ../config.edge > build/edge/.config
make olddefconfig prepare O=$PWD/build/edge
make -s kernelrelease O=$PWD/build/edge > build/edge/version

echo "Prepared $pkgbase version $(<build/base/version)"
}

build() {
cd $_srcname
echo "Building base..."
make all O=$PWD/build/base
echo "Copying objects..."
cp build/edge/.config{,.save}
touch build/base/.config
cp -urT build/{base,edge}
rm build/edge/init/version.o
make O=$PWD/build/edge oldconfig prepare
cp build/edge/.config{.save,}
echo "Building edge..."
make O=$PWD/build/edge oldconfig prepare
make O=$PWD/build/edge all
}

_package_kernel() {
pkgdesc="The $pkgdesc kernel and modules"
depends=(coreutils kmod initramfs $2 "m1n1>=$_m1n1_version")
depends=(coreutils kmod initramfs $2 "m1n1>=$_m1n1_version" "mesa-asahi-edge>=$_mesa_version")
optdepends=('crda: to set the correct wireless channels of your country'
'linux-firmware: firmware images needed for some devices')
provides=(WIREGUARD-MODULE linux=${pkgver})
replaces=(wireguard-arch)
conflicts=($pkgbase-edge)

local kernver="$(<$O/version)"
local modulesdir="$pkgdir/usr/lib/modules/$kernver"
Expand Down Expand Up @@ -123,12 +109,6 @@ _package() {
_package_kernel "$pkgbase"
}

_package-edge() {
cd $_srcname
export O="$PWD/build/edge"
_package_kernel "$pkgbase-edge" "$pkgbase=$pkgver"
}

_package-headers() {
pkgdesc="Headers and scripts for building modules for the $pkgdesc kernel"
depends=(pahole)
Expand Down Expand Up @@ -217,16 +197,9 @@ _package-headers() {
mkdir -p "$pkgdir/usr/src"
ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase"

O=build/edge
local builddir2="$pkgdir/usr/lib/modules/$(<${O}/version)/build"
mkdir -p $builddir2
cp -rl $builddir/* $builddir2
cp --remove-destination $O/{.config,System.map,version,Module.symvers,vmlinux} $builddir2
rm -rf $builddir2/include/config
cp -r $O/include/config $builddir2/include/config
}

pkgname=("$pkgbase" "$pkgbase-headers" "$pkgbase-edge")
pkgname=("$pkgbase" "$pkgbase-headers")
for _p in "${pkgname[@]}"; do
eval "package_$_p() {
$(declare -f "_package${_p#$pkgbase}")
Expand Down
1 change: 0 additions & 1 deletion linux-asahi/config.edge

This file was deleted.

0 comments on commit 5e8edfa

Please sign in to comment.