You are not logged in.
Pages: 1
I'm trying to make my PKGBUILD to build from kernel sources and i need some advice.
First: i get my config file from the kernel i'm running with:
zcat /proc/config.gz > config
What about the new configs introduced in the update? Make will prompt you for those but i noticed makepkg doesn't. Will it just stick to the defaults?
Second: pkgver doesn't accept dashes in the field, should i use underscores instead?
Offline
What kernel are you packaging? Rather take existing PKGBUILDs such as https://gitlab.archlinux.org/archlinux/ … type=heads
Online
What kernel are you packaging? Rather take existing PKGBUILDs such as https://gitlab.archlinux.org/archlinux/ … type=heads
linux-6.12-rc1 from kernel.org
Last edited by Leprotto (2024-09-30 21:10:01)
Offline
See for a maintained PKGBUILD: https://aur.archlinux.org/pkgbase/linux-mainline
Online
See for a maintained PKGBUILD: https://aur.archlinux.org/pkgbase/linux-mainline
oh yes it hadn't occured to me to edit the aur PKGBUILD. That explains many things by itself.
Offline
Why would you want to edit it? it's at v6.12-rc1
Online
Why would you want to edit it? it's at v6.12-rc1
I've just built futex_wait_multiple and some misc patches. Is there a way to remove the "dirty" flag?
Offline
Online
So i did this:
prepare() {
cd $_srcname
touch .scmversion # avoid "dirty" flag in kernel name
echo "Setting version..."
echo "-$pkgrel" > localversion.10-pkgrel
echo "${pkgbase#linux}" > localversion.20-pkgname
although an user suggests it doesn't work anymore as 6.11
Well, now i have another issue i didn't had yesterday:
Makefile:193: *** source directory cannot contain spaces or colons. Stop.
I checked it happens with the unedited aur PKGBUILD too. Maybe some issue on sources?
Offline
You should just commit your local patches to indicate what that kernel actually is, but, oh well.
Makefile:193: *** source directory cannot contain spaces or colons. Stop.
And what *is* the source directory path?
Online
You should just commit your local patches to indicate what that kernel actually is, but, oh well.
Makefile:193: *** source directory cannot contain spaces or colons. Stop.
And what *is* the source directory path?
Oh yes, it misleaded me to think it was the kernel source directory and not the build one. Just a lame typo!
Offline
So i did this:
prepare() { cd $_srcname touch .scmversion # avoid "dirty" flag in kernel name echo "Setting version..." echo "-$pkgrel" > localversion.10-pkgrel echo "${pkgbase#linux}" > localversion.20-pkgname
although an user suggests it doesn't work anymore as 6.11
You can see the replacement Arch used for .scmversion (before switching back to tarballs) which I believe was equivalent to `scripts/setlocalversion --save-scmversion` in https://gitlab.archlinux.org/archlinux/ … 3f097c8e51.
Offline
Leprotto wrote:So i did this:
prepare() { cd $_srcname touch .scmversion # avoid "dirty" flag in kernel name echo "Setting version..." echo "-$pkgrel" > localversion.10-pkgrel echo "${pkgbase#linux}" > localversion.20-pkgname
although an user suggests it doesn't work anymore as 6.11
You can see the replacement Arch used for .scmversion (before switching back to tarballs) which I believe was equivalent to `scripts/setlocalversion --save-scmversion` in https://gitlab.archlinux.org/archlinux/ … 3f097c8e51.
It doesn't work. From the script code:
echo "Usage: $0 [--no-local] [srctree]"
Offline
Based on Arch's replacement for `scripts/setlocalversion --save-scmversion` did you come up with something like:
diff --git a/PKGBUILD b/PKGBUILD
index ee2b6fb..0583063 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -53,12 +53,20 @@ export KBUILD_BUILD_HOST=archlinux
export KBUILD_BUILD_USER=$pkgbase
export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})"
+_make() {
+ test -s version
+ make KERNELRELEASE="$(<version)" "$@"
+}
+
prepare() {
cd $_srcname
echo "Setting version..."
echo "-$pkgrel" > localversion.10-pkgrel
echo "${pkgbase#linux}" > localversion.20-pkgname
+ make defconfig
+ make -s kernelrelease > version
+ make mrproper
local src
for src in "${source[@]}"; do
@@ -75,15 +83,14 @@ prepare() {
make olddefconfig
diff -u ../config .config || :
- make -s kernelrelease > version
echo "Prepared $pkgbase version $(<version)"
}
build() {
cd $_srcname
- make all
- make -C tools/bpf/bpftool vmlinux.h feature-clang-bpf-co-re=1
- make htmldocs
+ _make all
+ _make -C tools/bpf/bpftool vmlinux.h feature-clang-bpf-co-re=1
+ _make htmldocs
}
_package() {
@@ -119,7 +126,7 @@ _package() {
echo "$pkgbase" | install -Dm644 /dev/stdin "$modulesdir/pkgbase"
echo "Installing modules..."
- ZSTD_CLEVEL=19 make INSTALL_MOD_PATH="$pkgdir/usr" INSTALL_MOD_STRIP=1 \
+ ZSTD_CLEVEL=19 _make INSTALL_MOD_PATH="$pkgdir/usr" INSTALL_MOD_STRIP=1 \
DEPMOD=/doesnt/exist modules_install # Suppress depmod
# remove build link
Which from v6.12.0-rc1 if you then do:
$ git revert -n HEAD
$ make -s kernelrelease
6.11.0-1-mainline-12115-g9852d85ec9d4-dirty
$ _make -s kernelrelease
6.12.0-rc1-1-mainline
Last edited by loqs (2024-10-01 21:41:17)
Offline
Pages: 1