Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Alxhr0
kernel-malfunction
PKGBUILD
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File PKGBUILD of Package kernel-malfunction
pkgbase=kernel-malfunction pkgname=kernel-malfunction pkgver=6.8.8.malfunction pkgrel=2 linuxver=6.8 pkgdesc='Custom kernel which may or may not malfunction.' url='https://github.com/torvalds/linux' arch=(x86_64) license=(GPL-2.0-only) makedepends=( bc cpio gettext libelf pahole perl python3 tar xz zstd kmod graphviz imagemagick python-sphinx python-yaml texlive-latexextra ) options=( !debug !strip ) _srcname=linux-${pkgver%.*} _srctag=v${pkgver%.*}-${pkgver##*.} source=("linux-$linuxver.tar.xz" "config.tar.gz" "patches.tar.bz2" "scripts.tar.gz") md5sums=("0331e130a96abc5f9304701caaab05a8" "c8275fd23f9dbe866a12d2d2d9208842" "8a7ae27dea729ef6ff07369277fc1b5a" "2f2d79bf68bb2926e751c1bea28b52c8") export KBUILD_BUILD_HOST=archlinux export KBUILD_BUILD_USER=$pkgbase export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})" prepare() { chmod +x {guards,apply-patches} cd $_srcname echo "Setting version..." echo "-$pkgrel" > localversion.10-pkgrel echo "${pkgbase#linux}" > localversion.20-pkgname ../apply-patches ../series.conf .. $SYMBOLS echo "Setting config..." cp -v ../config/x86_64/malfunction .config make olddefconfig diff -u ../config/x86_64/malfunction .config || : } build() { cd $_srcname make -j$(nproc) } _package() { pkgdesc="The $pkgdesc kernel and modules" depends=( coreutils initramfs python3 zstd ) optdepends=( 'wireless-regdb: to set the correct wireless channels of your country' 'linux-firmware: firmware images needed for some devices' ) provides=( KSMBD-MODULE VIRTUALBOX-GUEST-MODULES WIREGUARD-MODULE ) replaces=( virtualbox-guest-modules-arch wireguard-arch ) cd $_srcname local modulesdir="$pkgdir/usr/lib/modules/$pkgver" echo "Installing boot image..." # systemd expects to find the kernel here to allow hibernation # https://github.com/systemd/systemd/commit/edda44605f06a41fb86b7ab8128dcf99161d2344 install -Dm644 "$(make -s image_name)" "$modulesdir/vmlinuz" # Used by mkinitcpio to name the kernel echo "$pkgbase" | install -Dm644 /dev/stdin "$modulesdir/pkgbase" echo "Installing modules..." ZSTD_CLEVEL=19 make INSTALL_MOD_PATH="$pkgdir/usr" INSTALL_MOD_STRIP=1 \ DEPMOD=/dev/null modules_install # Suppress depmod # remove build link rm "$modulesdir"/build } _package-headers() { pkgdesc="Headers and scripts for building modules for the $pkgdesc kernel" depends=(pahole) cd $_srcname local builddir="$pkgdir/usr/lib/modules/$pkgver/build" echo "Installing build files..." install -Dt "$builddir" -m644 .config Makefile Module.symvers System.map \ localversion.* version vmlinux tools/bpf/bpftool/vmlinux.h install -Dt "$builddir/kernel" -m644 kernel/Makefile install -Dt "$builddir/arch/x86" -m644 arch/x86/Makefile cp -t "$builddir" -a scripts # required when STACK_VALIDATION is enabled install -Dt "$builddir/tools/objtool" tools/objtool/objtool echo "Installing headers..." cp -t "$builddir" -a include cp -t "$builddir/arch/x86" -a arch/x86/include install -Dt "$builddir/arch/x86/kernel" -m644 arch/x86/kernel/asm-offsets.s install -Dt "$builddir/drivers/md" -m644 drivers/md/*.h install -Dt "$builddir/net/mac80211" -m644 net/mac80211/*.h # https://bugs.archlinux.org/task/13146 install -Dt "$builddir/drivers/media/i2c" -m644 drivers/media/i2c/msp3400-driver.h # https://bugs.archlinux.org/task/20402 install -Dt "$builddir/drivers/media/usb/dvb-usb" -m644 drivers/media/usb/dvb-usb/*.h install -Dt "$builddir/drivers/media/dvb-frontends" -m644 drivers/media/dvb-frontends/*.h install -Dt "$builddir/drivers/media/tuners" -m644 drivers/media/tuners/*.h # https://bugs.archlinux.org/task/71392 install -Dt "$builddir/drivers/iio/common/hid-sensors" -m644 drivers/iio/common/hid-sensors/*.h echo "Installing KConfig files..." find . -name 'Kconfig*' -exec install -Dm644 {} "$builddir/{}" \; echo "Removing unneeded architectures..." local arch for arch in "$builddir"/arch/*/; do [[ $arch = */x86/ ]] && continue echo "Removing $(basename "$arch")" rm -r "$arch" done echo "Removing broken symlinks..." find -L "$builddir" -type l -printf 'Removing %P\n' -delete echo "Removing loose objects..." find "$builddir" -type f -name '*.o' -printf 'Removing %P\n' -delete echo "Stripping build tools..." local file while read -rd '' file; do case "$(file -Sib "$file")" in application/x-sharedlib\;*) # Libraries (.so) strip -v $STRIP_SHARED "$file" ;; application/x-archive\;*) # Libraries (.a) strip -v $STRIP_STATIC "$file" ;; application/x-executable\;*) # Binaries strip -v $STRIP_BINARIES "$file" ;; application/x-pie-executable\;*) # Relocatable binaries strip -v $STRIP_SHARED "$file" ;; esac done < <(find "$builddir" -type f -perm -u+x ! -name vmlinux -print0) echo "Stripping vmlinux..." strip -v $STRIP_STATIC "$builddir/vmlinux" echo "Adding symlink..." mkdir -p "$pkgdir/usr/src" ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase" } pkgname=( "$pkgbase" "$pkgbase-headers" ) for _p in "${pkgname[@]}"; do eval "package_$_p() { $(declare -f "_package${_p#$pkgbase}") _package${_p#$pkgbase} }" done
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor