diff options
Diffstat (limited to 'libre/linux-libre-pck/PKGBUILD')
-rw-r--r-- | libre/linux-libre-pck/PKGBUILD | 136 |
1 files changed, 50 insertions, 86 deletions
diff --git a/libre/linux-libre-pck/PKGBUILD b/libre/linux-libre-pck/PKGBUILD index 61c267a4a..bac90f957 100644 --- a/libre/linux-libre-pck/PKGBUILD +++ b/libre/linux-libre-pck/PKGBUILD @@ -9,36 +9,31 @@ # Based on linux-zen package -pkgbase=linux-libre-pck -_srcbasever=5.3-gnu -_srcver=5.3.1-gnu -_pckver=pck1 - _replacesarchkernel=('linux-zen') _replacesoldkernels=() _replacesoldmodules=() +pkgbase=linux-libre-pck +_srcbasever=5.3-gnu +_srcver=5.3.8-gnu _srcname=linux-${_srcbasever%-*} -_archpkgver=${_srcver%-*} -pkgver=${_srcver//-/.${_pckver}_} +_pckrel=1 +pkgver=${_srcver//-/.${_pckrel}_} pkgrel=1 -arch=(i686 x86_64 armv7h) url='https://wiki.parabola.nu/PCK' +arch=(i686 x86_64 armv7h) license=(GPL2) makedepends=( - xmlto kmod inetutils bc libelf git python-sphinx python-sphinx_rtd_theme - graphviz imagemagick + xmlto kmod inetutils bc libelf + python-sphinx python-sphinx_rtd_theme graphviz imagemagick ) - options=('!strip') source=( "https://linux-libre.fsfla.org/pub/linux-libre/releases/$_srcbasever/linux-libre-$_srcbasever.tar.xz"{,.sign} "https://linux-libre.fsfla.org/pub/linux-libre/releases/$_srcver/patch-$_srcbasever-$_srcver.xz"{,.sign} - "https://repo.parabola.nu/other/pck/patches/$_srcver/patch-$_srcver-$_pckver.patch"{,.sig} - config.i686 config.x86_64 config.armv7h # the main kernel config files - 60-linux.hook # pacman hook for depmod - 90-linux.hook # pacman hook for initramfs regeneration - linux.preset # standard config files for mkinitcpio ramdisk + "https://repo.parabola.nu/other/pck/patches/$_srcver/patch-$_srcver-pck$_pckrel.patch"{,.sig} + config.i686 config.x86_64 config.armv7h # the main kernel config files + linux-armv7h.preset # armv7h preset file for mkinitcpio ramdisk ) validpgpkeys=( '474402C8C582DAFBE389C427BCB7CF877E7D47A7' # Alexandre Oliva @@ -46,27 +41,28 @@ validpgpkeys=( ) sha512sums=('85d83c973ef96ab414354414da70ab3e1c3df19c3088458498cec1594952878b7967a8988bd9e36d4e728cc573a36e6eac056dbcab2f9aa742f18cbb4fb3164f' 'SKIP' - 'f58ba041868ef3475ca3b4ad2943ed2df3da17e4eadb6597131e9903a95b734d4df22d096e7cf66d30778e88c9e799512b2e3f51119c997dc2b7a766c104bcc2' + 'eca168c4c460bf8d8fbf322e1aa9c6b509f205c7597142967648c09402de95c8438ae302b4920c8f120192b1a54286f0fb860955c66414f3a3c376e41f246391' 'SKIP' - '8c977427292bcae7e98ffc87dc2c6d6ca9e17de71ce0205fefd4dd0ffd505ef9438f33434f389bc26e7927a8fb00d2d6dee70b4f49e47de3fba3b06753f8d5a6' + '79cec6e5ff5da8c54757f770ae9fa2a0f27c00d7c913c7466ccc69fdda3f62f5526886893253fb98279583848fbce244fc7cb86086d88b2d74305caf86c4a631' 'SKIP' - '9869ef8a0dd76697785a4546632cbbbfce9655224429eddc2c02e72452f2c5484e9a97c5afd2a29353deebf1ae5b50539782c8991a9ff84e6009a13d732cb261' - 'f1683475850206efe74f7fe0409a2e57162fa78daf8ad8d17b19a1244e61499ce74c34a9feeaa845335ac152c5db069b99f690a257f66d12368f9f9f57c2635b' - 'c098f6384b9bd0adf63e0451ab5b4587ed3fee96643659a243b950c2dece50f0e86a609480b19b57ddd78d2da72f10b08452cdd21d96ee485f63dcb6f42fb28f' - '7ad5be75ee422dda3b80edd2eb614d8a9181e2c8228cd68b3881e2fb95953bf2dea6cbe7900ce1013c9de89b2802574b7b24869fc5d7a95d3cc3112c4d27063a' - '2718b58dbbb15063bacb2bde6489e5b3c59afac4c0e0435b97fe720d42c711b6bcba926f67a8687878bd51373c9cf3adb1915a11666d79ccb220bf36e0788ab7' - '2dc6b0ba8f7dbf19d2446c5c5f1823587de89f4e28e9595937dd51a87755099656f2acec50e3e2546ea633ad1bfd1c722e0c2b91eef1d609103d8abdc0a7cbaf') - -_kernelname=${pkgbase#linux-libre} -_replacesarchkernel=("${_replacesarchkernel[@]/\%/${_kernelname}}") -_replacesoldkernels=("${_replacesoldkernels[@]/\%/${_kernelname}}") -_replacesoldmodules=("${_replacesoldmodules[@]/\%/${_kernelname}}") + '1e6d25562aaf9faabc44f7b4d9a392f236371913f09a74d1d1c04dda7857b0ebfc0743ce6bd772b4eb2c25caf3ba90ab1fc1e9336e18bb912dc20ae2b300dc66' + '74b3360256b49f918129a2d543ccbb92e28e68203ca0907aadbcb605f86db13010260898dc0f1148214638433888e5e7d8d56f5b4046c3254289a84de4f72b88' + '9e9184bc047fa1dd9341eca6d0ea334a1fde051e3126b1bb5537e23125e630c034c806ef104f28cd01a783620b026e0519b9c98c0bd8a79be748d1c9890193e3' + 'aca591b5a2e838754e3c5fd2c0e50098ad54c2d0f990de5bf9cff8608e881daf0e37132294ed1a0e0a7b9e1c194c0b89f95da001d94febdb25a01c409060e3ac') + +_replacesarchkernel=("${_replacesarchkernel[@]/\%/${pkgbase#linux-libre}}") +_replacesoldkernels=("${_replacesoldkernels[@]/\%/${pkgbase#linux-libre}}") +_replacesoldmodules=("${_replacesoldmodules[@]/\%/${pkgbase#linux-libre}}") case "$CARCH" in i686|x86_64) KARCH=x86;; armv7h) KARCH=arm;; esac +export KBUILD_BUILD_HOST=parabola +export KBUILD_BUILD_USER=$pkgbase +export KBUILD_BUILD_TIMESTAMP="@${SOURCE_DATE_EPOCH:-$(date +%s)}" + prepare() { cd $_srcname @@ -78,7 +74,7 @@ prepare() { msg2 "Setting version..." scripts/setlocalversion --save-scmversion echo "-$pkgrel" > localversion.10-pkgrel - echo "$_kernelname" > localversion.20-pkgname + echo "${pkgbase#linux-libre}" > localversion.20-pkgname local src for src in "${source[@]}"; do @@ -93,35 +89,32 @@ prepare() { cp ../config.$CARCH .config make olddefconfig - make -s kernelrelease > ../version - msg2 "Prepared %s version %s" "$pkgbase" "$(<../version)" + make -s kernelrelease > version + msg2 "Prepared %s version %s" "$pkgbase" "$(<version)" } build() { cd $_srcname if [ "$CARCH" = "armv7h" ]; then make zImage modules htmldocs dtbs - elif [ "$CARCH" = "x86_64" ] || [ "$CARCH" = "i686" ]; then + else make bzImage modules htmldocs fi } _package() { pkgdesc="The ${pkgbase^} kernel and modules with a handful of awesome features not merged into mainline [AUFS, BFQ, BFS, UKSM]" - [[ $pkgbase = linux-libre ]] && groups=(base base-openrc) - depends=(coreutils linux-libre-firmware kmod mkinitcpio) - optdepends=('crda: to set the correct wireless channels of your country') - provides=("${_replacesarchkernel[@]/%/=${_archpkgver}}" "LINUX-ABI_VERSION=${_srcver%%-*}") + depends=(coreutils kmod initramfs) + optdepends=('crda: to set the correct wireless channels of your country' + 'linux-libre-firmware: firmware images needed for some devices') + provides=("${_replacesarchkernel[@]/%/=${_srcver%%-*}}" "LINUX-ABI_VERSION=${_srcver%%-*}") conflicts=("${_replacesarchkernel[@]}" "${_replacesoldkernels[@]}" "${_replacesoldmodules[@]}") replaces=("${_replacesarchkernel[@]}" "${_replacesoldkernels[@]}" "${_replacesoldmodules[@]}") - backup=("etc/mkinitcpio.d/$pkgbase.preset") - install=linux.install + cd $_srcname local kernver="$(<version)" local modulesdir="$pkgdir/usr/lib/modules/$kernver" - cd $_srcname - msg2 "Installing boot image..." if [ "$CARCH" = "armv7h" ]; then make INSTALL_DTBS_PATH="$pkgdir/boot/dtbs/$pkgbase" dtbs_install @@ -129,49 +122,24 @@ _package() { # 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" - install -Dm644 "$modulesdir/vmlinuz" "$pkgdir/boot/vmlinuz-$pkgbase" + + # Used by mkinitcpio to name the kernel + echo "$pkgbase" | install -Dm644 /dev/stdin "$modulesdir/pkgbase" msg2 "Installing modules..." make INSTALL_MOD_PATH="$pkgdir/usr" modules_install - # a place for external modules, - # with version file for building modules and running depmod from hook - local extramodules="extramodules$_kernelname" - local extradir="$pkgdir/usr/lib/modules/$extramodules" - install -Dt "$extradir" -m644 ../version - ln -sr "$extradir" "$modulesdir/extramodules" - # remove build and source links rm "$modulesdir"/{source,build} - msg2 "Installing hooks..." - # sed expression for following substitutions + # armv7h presets only work with ALL_kver=$kernver if [ "$CARCH" = "armv7h" ]; then - local subst=" - s|/boot/vmlinuz-%PKGBASE%|$kernver|g - s|%PKGBASE%|$pkgbase|g - s|%KERNVER%|$kernver|g - s|%EXTRAMODULES%|$extramodules|g - " - else - local subst=" - s|%PKGBASE%|$pkgbase|g - s|%KERNVER%|$kernver|g - s|%EXTRAMODULES%|$extramodules|g - " - fi - - # hack to allow specifying an initially nonexisting install file - sed "$subst" "$startdir/$install" > "$startdir/$install.pkg" - true && install=$install.pkg + backup=("etc/mkinitcpio.d/$pkgbase.preset") - # fill in mkinitcpio preset and pacman hooks - sed "$subst" ../linux.preset | install -Dm644 /dev/stdin \ - "$pkgdir/etc/mkinitcpio.d/$pkgbase.preset" - sed "$subst" ../60-linux.hook | install -Dm644 /dev/stdin \ - "$pkgdir/usr/share/libalpm/hooks/60-$pkgbase.hook" - sed "$subst" ../90-linux.hook | install -Dm644 /dev/stdin \ - "$pkgdir/usr/share/libalpm/hooks/90-$pkgbase.hook" + msg2 "Installing mkinitcpio preset..." + sed "s|%PKGBASE%|$pkgbase|g;s|%KERNVER%|$kernver|g" ../linux-armv7h.preset \ + | install -Dm644 /dev/stdin "$pkgdir/etc/mkinitcpio.d/$pkgbase.preset" + fi msg2 "Fixing permissions..." chmod -Rc u=rwX,go=rX "$pkgdir" @@ -179,16 +147,16 @@ _package() { _package-headers() { pkgdesc="Header files and scripts for building modules for ${pkgbase^} kernel" - provides=("${_replacesarchkernel[@]/%/-headers=${_archpkgver}}") + provides=("${_replacesarchkernel[@]/%/-headers=${_srcver%%-*}}") conflicts=("${_replacesarchkernel[@]/%/-headers}" "${_replacesoldkernels[@]/%/-headers}") replaces=("${_replacesarchkernel[@]/%/-headers}" "${_replacesoldkernels[@]/%/-headers}") - local builddir="$pkgdir/usr/lib/modules/$(<version)/build" - cd $_srcname + local builddir="$pkgdir/usr/lib/modules/$(<version)/build" msg2 "Installing build files..." - install -Dt "$builddir" -m644 Makefile .config Module.symvers System.map vmlinux + install -Dt "$builddir" -m644 .config Makefile Module.symvers System.map \ + localversion.* version vmlinux install -Dt "$builddir/kernel" -m644 kernel/Makefile install -Dt "$builddir/arch/$KARCH" -m644 arch/$KARCH/Makefile if [[ $CARCH = i686 ]]; then @@ -204,9 +172,6 @@ _package-headers() { # add xfs and shmem for aufs building mkdir -p "$builddir"/{fs/xfs,mm} - # ??? - mkdir "$builddir/.tmp_versions" - msg2 "Installing headers..." cp -t "$builddir" -a include cp -t "$builddir/arch/$KARCH" -a arch/$KARCH/include @@ -276,7 +241,7 @@ _package-headers() { msg2 "Adding symlink..." mkdir -p "$pkgdir/usr/src" - ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase-$pkgver" + ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase" msg2 "Fixing permissions..." chmod -Rc u=rwX,go=rX "$pkgdir" @@ -284,13 +249,12 @@ _package-headers() { _package-docs() { pkgdesc="Kernel hackers manual - HTML documentation that comes with the ${pkgbase^} kernel" - provides=("${_replacesarchkernel[@]/%/-docs=${_archpkgver}}") + provides=("${_replacesarchkernel[@]/%/-docs=${_srcver%%-*}}") conflicts=("${_replacesarchkernel[@]/%/-docs}" "${_replacesoldkernels[@]/%/-docs}") replaces=("${_replacesarchkernel[@]/%/-docs}" "${_replacesoldkernels[@]/%/-docs}") - - local builddir="$pkgdir/usr/lib/modules/$(<version)/build" cd $_srcname + local builddir="$pkgdir/usr/lib/modules/$(<version)/build" msg2 "Installing documentation..." mkdir -p "$builddir" |