Skip to content

Commit

Permalink
update linux-amd.patch / add linux-rt.patch
Browse files Browse the repository at this point in the history
* updates linux-amd.patch
* adds linux-rt.patch
  - NB: `zfs` does NOT build yet under real-time kernels (compilation
    crashes with various unsupported symbols)

* update README.md for zenpower3
  • Loading branch information
itoffshore committed Oct 6, 2024
1 parent d2a1980 commit f135243
Show file tree
Hide file tree
Showing 4 changed files with 144 additions and 19 deletions.
6 changes: 6 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Version [0.7.7] - 20241006
- update patch for linux-amd
- add new patch for linux-rt => NB: zfs modules do not support
real-time kernels yet & will fail to build
- update README for zenpower3 & linux-rt

Version [0.7.6] - 20240901
- small fix to rebuilds

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* `linux-hardened`
* `linux-hardened-git`
* `linux-zen`
* `linux-rt`
* `linux-amd`
* `linux-ck`
* `linux-libre`
Expand All @@ -23,6 +24,7 @@ With **DKMS** support for the following _Out of Tree_ Kernel Modules:
* [ZFS](https://aur.archlinux.org/packages/zfs-dkms/)
* [Nvidia](https://archlinux.org/packages/extra/x86_64/nvidia-dkms/)
* [Linux Kernel Runtime Guard](https://aur.archlinux.org/packages/lkrg-dkms/)
* [Zenpower3](https://aur.archlinux.org/packages/zenpower3-dkms)

---

Expand Down
51 changes: 32 additions & 19 deletions patches/linux-amd.patch
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
--- PKGBUILD.orig 2022-05-04 13:49:26.745366029 +0100
+++ PKGBUILD 2022-05-04 13:52:24.646487838 +0100
@@ -41,7 +41,35 @@ pkgver() {
}
--- PKGBUILD.orig 2024-10-06 17:02:27.645290233 +0100
+++ PKGBUILD 2024-10-06 17:05:04.978140296 +0100
@@ -56,11 +56,11 @@ makedepends=(
kmod
xmlto
# htmldocs
- graphviz
- imagemagick
- python-sphinx
- python-yaml
- texlive-latexextra
+# graphviz
+# imagemagick
+# python-sphinx
+# python-yaml
+# texlive-latexextra
)
makedepends+=(
bison
@@ -121,6 +121,31 @@ export KBUILD_BUILD_USER=$pkgbase
export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})"

prepare() {
- cd "${_srcname}"
+ # Out-of-tree module signing
prepare(){
+ # Out-of-tree module signing
+ #
+ ######################################################
+ # this is added at the start of prepare() & replaces #
Expand All @@ -30,18 +46,15 @@
+ # /usr/src/certs-local/genkeys.py -h
+ ./genkeys.py -v --config '../config*'
+
+ cd ../$_srcname
+
+# cd $_srcname
+
if [ "${CARCH}" = "x86_64" ]; then
cat "${srcdir}/config.x86_64" > ./.config
else
@@ -229,6 +257,32 @@ _package-headers() {
rm -rf $modarch
done <<< $(find "${pkgdir}"/usr/lib/modules/${_kernver}/build/arch/ -maxdepth 1 -mindepth 1 -type d | grep -v /x86$)
cd ${srcdir}/linux-$_pkgver

+ # Out-of-tree module signing
local src
@@ -357,6 +382,33 @@ _package-headers(){
msg "Adding symlink..."
mkdir -p "$pkgdir/usr/src"
ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase"
+
+ # Out-of-tree module signing
+ ##################################################
+ # this is added at the end of _package-headers() #
+ ##################################################
Expand Down Expand Up @@ -69,4 +82,4 @@
+ rsync -a $dkms_src/{kernel-sign.conf,kernel-sign.sh} $dkms_dst/
}

_package-docs() {
sha256sums=('30909eb2e0434dce97a93cd97ed0dfab7688a124bc3ebc3ecf6c776de09ccc0b'
104 changes: 104 additions & 0 deletions patches/linux-rt.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
--- PKGBUILD.orig 2024-10-06 16:04:28.526485430 +0100
+++ PKGBUILD 2024-10-06 16:10:34.065141343 +0100
@@ -8,8 +8,9 @@ pkgdesc='Linux RT'
arch=(x86_64)
url="https://gitlab.archlinux.org/dvzrv/linux-rt/-/commits/v${pkgver}"
license=(GPL2)
-makedepends=(bc cpio git graphviz imagemagick libelf pahole perl
-python-sphinx python-sphinx_rtd_theme tar texlive-latexextra xmlto xz)
+#makedepends=(bc cpio git graphviz imagemagick libelf pahole perl
+#python-sphinx python-sphinx_rtd_theme tar texlive-latexextra xmlto xz)
+makedepends=(bc cpio git libelf pahole perl tar xmlto xz)
options=(!strip)
source=(
git+https://gitlab.archlinux.org/dvzrv/linux-rt#tag=v$pkgver?signed
@@ -31,7 +32,34 @@ export KBUILD_BUILD_USER=$pkgbase
export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})"

prepare() {
- cd $pkgbase
+ # Out-of-tree module signing
+ #
+ ######################################################
+ # this is added at the start of prepare() & replaces #
+ # 'cd $_srcname' #
+ ######################################################
+ # uncomment for linux-xanmod-cacule & some other AUR kernels
+ # to match the Package Maintainer's variable for the kernel
+ # sources directory.
+ #
+ # local _srcname=linux-${_major}
+
+ msg2 "Rebuilding local signing key..."
+
+ cp -rf /usr/src/certs-local ./
+ cd certs-local
+
+ msg2 "Updating kernel config with new key..."
+
+ # NB: config path must be quoted for file globbing to work
+ # some kernels have multiple config files (e.g linux-libre)
+ # to see configurable options run:
+ # /usr/src/certs-local/genkeys.py -h
+ ./genkeys.py -v --config '../config*'
+
+ cd ../$pkgbase
+
+# cd $pkgbase

echo "Setting version..."
scripts/setlocalversion --save-scmversion
@@ -60,7 +88,8 @@ prepare() {

build() {
cd $pkgbase
- make htmldocs all
+# make htmldocs all
+ make all
}

_package() {
@@ -170,6 +199,33 @@ _package-headers() {
echo "Adding symlink..."
mkdir -p "$pkgdir/usr/src"
ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase"
+
+ # Out-of-tree module signing
+ ##################################################
+ # this is added at the end of _package-headers() #
+ ##################################################
+ # This is run in the kernel source / build directory
+ #
+ # some AUR kernels may also need to set $builddir to match
+ # the Package Maintainer's variable for the build dir
+ # inside the package:
+ #
+ # local builddir="$pkgdir/usr/lib/modules/${_kernver}/build"
+
+ msg2 "Local Signing certs for out-of-tree modules..."
+
+ certs_local_src="../certs-local"
+ certs_local_dst="${builddir}/certs-local"
+
+ # install certificates
+ ${certs_local_src}/install-certs.py $certs_local_dst
+
+ # install dkms tools
+ dkms_src="$certs_local_src/dkms"
+ dkms_dst="${pkgdir}/etc/dkms"
+ mkdir -p $dkms_dst
+
+ rsync -a $dkms_src/{kernel-sign.conf,kernel-sign.sh} $dkms_dst/
}

_package-docs() {
@@ -191,7 +247,8 @@ _package-docs() {
ln -sr "$builddir/Documentation" "$pkgdir/usr/share/doc/$pkgbase"
}

-pkgname=("$pkgbase" "$pkgbase-headers" "$pkgbase-docs")
+#pkgname=("$pkgbase" "$pkgbase-headers" "$pkgbase-docs")
+pkgname=("$pkgbase" "$pkgbase-headers")
for _p in "${pkgname[@]}"; do
eval "package_$_p() {
$(declare -f "_package${_p#$pkgbase}")

0 comments on commit f135243

Please sign in to comment.