summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorPiotr Gorski2018-08-20 16:39:41 +0200
committerPiotr Gorski2018-08-20 16:39:41 +0200
commitdcc2cc752db3cda577e31c022508f32758eafc3b (patch)
tree70304d2883897224f0c3424a67361aa0bf74fa63 /PKGBUILD
parenta50e5b17c97779673b2c243ffe3be63a3b98a2ef (diff)
downloadaur-dcc2cc752db3cda577e31c022508f32758eafc3b.tar.gz
Sync with Arch
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD547
1 files changed, 295 insertions, 252 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 3aa3ebfb768d..9ce63148b14c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,57 +2,74 @@
# Contributor: shivik <> PGP-Key: 761E423C
# Contributor: Michael Duell <mail@akurei.me> PGP-Key: 6EE23EBE
# A special thanks to Steven Barrett for very important sugestions
+# Contributor: Tobias Powalowski <tpowa@archlinux.org>
+# Contributor: Thomas Baechler <thomas@archlinux.org>
+
+### BUILD OPTIONS
+# Set these variables to ANYTHING that is not null to enable them
+
+### Tweak kernel options prior to a build via nconfig
+_makenconfig=
+
+### Tweak kernel options prior to a build via menuconfig
+_makemenuconfig=
+
+### Tweak kernel options prior to a build via xconfig
+_makexconfig=
+
+### Tweak kernel options prior to a build via gconfig
+_makegconfig=
+
+# NUMA is optimized for multi-socket motherboards.
+# A single multi-core CPU actually runs slower with NUMA enabled.
+# See, https://bugs.archlinux.org/task/31187
+_NUMAdisable=y
+
+# Compile ONLY probed modules
+# As of mainline 2.6.32, running with this option will only build the modules
+# that you currently have probed in your system VASTLY reducing the number of
+# modules built and the build time to do it.
+#
+# WARNING - ALL modules must be probed BEFORE you begin making the pkg!
+#
+# To keep track of which modules are needed for your specific system/hardware,
+# give module_db script a try: https://aur.archlinux.org/packages/modprobed-db
+# This PKGBUILD will call it directly to probe all the modules you have logged!
+#
+# More at this wiki page ---> https://wiki.archlinux.org/index.php/Modprobed_db
+_localmodcfg=
+
+# Use the current kernel's .config file
+# Enabling this option will use the .config of the RUNNING kernel rather than
+# the ARCH defaults. Useful when the package gets updated and you already went
+# through the trouble of customizing your config options. NOT recommended when
+# a new kernel is released, but again, convenient for package bumps.
+_use_current=
+
+### Disable MUQSS
+_muqss_disable=
+
+### Do not edit below this line unless you know what you're doing
-###########################################################################################################
-# Patch and Build Options
-###########################################################################################################
-_custom="no" # "m": custom config via menuconfig
- # "n": custom config via nconfig
- # "x": custom config via xconfig
- # "no": nothing
-
-_config="pkg" # "local": compile only probed modules(https://aur.archlinux.org/packages/modprobed-db/)
- # "nomod": don't use modules(make localyesconfig)
- # "old": make with old config (/proc/config.gz)
- # "pkg": use this package's config
-
-_akcs="" # Append Kernel Custom String.Not working on some systems.
- # Use if you wnat to append a custom string to kernel version.
- # No risc if you have a backup kernel in case of boot failure.
-
-_use_MUQSS="yes" # "yes": Use MUQSS cpu scheduler.
- # "no": Use CFS cpu scheduler.
-
-_use_KSM="no" # "yes": Enable Kernel SamePage Merging (KSM).
- # "no": Don't use Kernel SamePage Merging (KSM).
-
-###########################################################################################################
-
-pkgdesc='A desktop oriented kernel and modules with Liquorix patches'
-__basekernel=4.17
+pkgbase=linux-lqx
+# pkgname=('linux-lqx' 'linux-lqx-headers' 'linux-lqx-docs')
+_major=4.17
_minor=17
-pkgver=${__basekernel}.${_minor}
+pkgver=${_major}.${_minor}
+_srcname=linux-${_major}
pkgrel=1
lqxrel=2
-pkgbase=linux-lqx
-# pkgname=('linux-lqx' 'linux-lqx-headers' 'linux-lqx-docs')
_lqxpatchname="${pkgver}-${lqxrel}.patch"
arch=('x86_64')
-license=('GPL2')
url="http://liquorix.net/"
+license=('GPL2')
+options=('!strip')
+makedepends=('kmod' 'inetutils' 'bc' 'libelf')
-if [ "$_custom" = "x" ]; then
- makedepends=('qt5-base' 'kmod' 'inetutils' 'bc' 'libelf')
-else
- makedepends=('kmod' 'inetutils' 'bc' 'libelf')
-fi
-
-options=(!strip)
-install='linux.install'
-source=("https://www.kernel.org/pub/linux/kernel/v4.x/linux-${__basekernel}.tar.xz"
- "https://www.kernel.org/pub/linux/kernel/v4.x/linux-${__basekernel}.tar.sign"
+source=("https://www.kernel.org/pub/linux/kernel/v4.x/${_srcname}.tar.xz"
+ "https://www.kernel.org/pub/linux/kernel/v4.x/${_srcname}.tar.sign"
"https://liquorix.net/sources/${_lqxpatchname}.gz"
- "https://liquorix.net/sources/${__basekernel}/config.amd64"
+ "https://liquorix.net/sources/${_major}/config.amd64"
# pacman hook for depmod
'60-linux.hook'
# pacman hook for initramfs regeneration
@@ -60,267 +77,293 @@ source=("https://www.kernel.org/pub/linux/kernel/v4.x/linux-${__basekernel}.tar.
# pacman hook for remove initramfs
'99-linux.hook'
# standard config files for mkinitcpio ramdisk
- 'linux.preset')
-
-sha512sums=('4d9de340a26155a89ea8773131c76220cc2057f2b5d031b467b60e8b14c1842518e2d60a863d8c695f0f7640f3f18d43826201984a238dade857b6cef79837db'
- 'SKIP'
- '67a649cd808e7ef1f47a54be56cd6a5da0ba02698e3e3c3307b885b3c75464e6b0ec0f91a776e379486fdb50b00fc99ea9ceac9d6392f3d389b6a46e2dd699a8'
- 'bfe1df7716a071086c91d847886bf7e0340c643f175969794b0e97f88c07e959dae8bbbf4d40e73ff27a035a8f58e4f4a45f6eaf844cc07fdfc8ef589a83e3ae'
- '7ad5be75ee422dda3b80edd2eb614d8a9181e2c8228cd68b3881e2fb95953bf2dea6cbe7900ce1013c9de89b2802574b7b24869fc5d7a95d3cc3112c4d27063a'
- '4a8b324aee4cccf3a512ad04ce1a272d14e5b05c8de90feb82075f55ea3845948d817e1b0c6f298f5816834ddd3e5ce0a0e2619866289f3c1ab8fd2f35f04f44'
- '6346b66f54652256571ef65da8e46db49a95ac5978ecd57a507c6b2a28aee70bb3ff87045ac493f54257c9965da1046a28b72cb5abb0087204d257f14b91fd74'
- '2dc6b0ba8f7dbf19d2446c5c5f1823587de89f4e28e9595937dd51a87755099656f2acec50e3e2546ea633ad1bfd1c722e0c2b91eef1d609103d8abdc0a7cbaf')
-
-validpgpkeys=(
- 'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds
- )
+ 'linux.preset'
+ '0002-Increase-timeout-in-lspcon_wait_mode.patch')
_kernelname=${pkgbase#linux}
-: ${_kernelname:=-ARCH}
+: ${_kernelname:=-lqx}
prepare() {
- KARCH=x86
-
- cd ${srcdir}/linux-${__basekernel}
-
- # Add Liquorix patches
- patch -Np1 -i ../$_lqxpatchname
-
- # Trying oldcfg if possible and if selected
- if [ "$_config" = "old" ]; then
- if [ -e /proc/config.gz ]; then
- zcat /proc/config.gz > ./.config
- else
- echo "WARNING: There's no /proc/config.gz... You cannot use the old config. Aborting..."
- exit 1
- fi
- else
- cat ../config.amd64 >./.config
- fi
-
- if [ "${_kernelname}" != "" ]; then
- sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
- sed -i "s|CONFIG_LOCALVERSION_AUTO=.*|CONFIG_LOCALVERSION_AUTO=n|" ./.config
- fi
-
- #Disable MUQSS cpu scheduler in config
- if [ "${_use_MUQSS}" = "no" ]; then
- sed -i -e 's/CONFIG_SCHED_MUQSS=y/# CONFIG_SCHED_MUQSS is not set/' ./.config
- fi
-
- #Enable KSM (Kernel SamePage Merging)
- if [ "${_use_KSM}" = "yes" ]; then
- sed -i -e 's/# CONFIG_KSM is not set/CONFIG_KSM=y/' ./.config
- sed -i '/CONFIG_KSM=y/a \CONFIG_UKSM=y/n' ./.config
- sed -i '/CONFIG_UKSM=y/a \# CONFIG_KSM_LEGACY is not set' ./.config
- fi
-
- # set extraversion to pkgrel and empty localversion
- sed -e "/^EXTRAVERSION =/s/=.*/= -${pkgrel}/" \
- -e "/^EXTRAVERSION =/aLOCALVERSION =" \
- -i Makefile
-
- # don't run depmod on 'make install'. We'll do this ourselves in packaging
- sed -i '2iexit 0' scripts/depmod.sh
-
- # set sublevel to kernel minor version
- sed -ri "s|^(SUBLEVEL =).*|\1 ${_minor}|" Makefile
-
- msg "Running make prepare"
- make prepare
-
-### Optionally load needed modules for the make localmodconfig
- # See https://aur.archlinux.org/packages/modprobed-db/
- if [ $_config = "local" ]; then
- msg "If you have modprobe-db installed, running it in recall mode now"
- if [ -e /usr/bin/modprobed-db ]; then
- [[ ! -x /usr/bin/sudo ]] && echo "Cannot call modprobe with sudo. Install via pacman -S sudo and configure to work with this user." && exit 1
- sudo /usr/bin/modprobed-db recall
- fi
- msg "Running Steven Rostedt's make localmodconfig now"
- make localmodconfig
- else
- yes "" | make config
- fi
-
- if [ $_config = "nomod" ]; then
- msg "Running localYESconfig now"
- make localyesconfig
- else
- yes "" | make config
- fi
-
- if [ $_custom = "m" ]; then
- msg "Running make menuconfig"
- make menuconfig
- fi
-
- if [ $_custom = "n" ]; then
- msg "Running make nconfig"
- make nconfig
- fi
-
- if [ $_custom = "x" ]; then
- msg "Running make xconfig"
- make xconfig
- fi
+ cd ${_srcname}
+
+ ### Add Liquorix patches
+ msg2 "Add Liqurix patches"
+ patch -Np1 -i ../$_lqxpatchname
+
+ ### Setting version
+ msg2 "Setting version..."
+ scripts/setlocalversion --save-scmversion
+ echo "-$pkgrel" > localversion.10-pkgrel
+ echo "$_kernelname" > localversion.20-pkgname
+
+ ### Patching sources
+ local src
+ for src in "${source[@]}"; do
+ src="${src%%::*}"
+ src="${src##*/}"
+ [[ $src = *.patch ]] || continue
+ msg2 "Applying patch $src..."
+ patch -Np1 < "../$src"
+ done
+
+ ### Setting config
+ msg2 "Setting config..."
+ cp ../config.amd64 .config
+ make olddefconfig
+
+ ### Prepared version
+ make -s kernelrelease > ../version
+ msg2 "Prepared %s version %s" "$pkgbase" "$(<../version)"
+
+ ### Optionally use running kernel's config
+ # code originally by nous; http://aur.archlinux.org/packages.php?ID=40191
+ if [ -n "$_use_current" ]; then
+ if [[ -s /proc/config.gz ]]; then
+ msg2 "Extracting config from /proc/config.gz..."
+ # modprobe configs
+ zcat /proc/config.gz > ./.config
+ else
+ warning "You kernel was not compiled with IKCONFIG_PROC!"
+ warning "You cannot read the current config!"
+ warning "Aborting!"
+ exit
+ fi
+ fi
+
+ ### Disable MUQSS
+ if [ -n "$_muqss_disable" ]; then
+ msg2 "Disabling MUQSS..."
+ sed -i -e s'/^CONFIG_SCHED_MUQSS=y/# CONFIG_SCHED_MUQSS is not set/' ./.config
+ fi
+
+ ### Optionally disable NUMA for 64-bit kernels only
+ # (x86 kernels do not support NUMA)
+ if [ -n "$_NUMAdisable" ]; then
+ msg2 "Disabling NUMA from kernel config..."
+ sed -i -e 's/CONFIG_NUMA=y/# CONFIG_NUMA is not set/' \
+ -i -e '/CONFIG_AMD_NUMA=y/d' \
+ -i -e '/CONFIG_X86_64_ACPI_NUMA=y/d' \
+ -i -e '/CONFIG_NODES_SPAN_OTHER_NODES=y/d' \
+ -i -e '/# CONFIG_NUMA_EMU is not set/d' \
+ -i -e '/CONFIG_NODES_SHIFT=6/d' \
+ -i -e '/CONFIG_NEED_MULTIPLE_NODES=y/d' \
+ -i -e '/# CONFIG_MOVABLE_NODE is not set/d' \
+ -i -e '/CONFIG_USE_PERCPU_NUMA_NODE_ID=y/d' \
+ -i -e '/CONFIG_ACPI_NUMA=y/d' ./.config
+ fi
+
+ ### Optionally load needed modules for the make localmodconfig
+ # See https://aur.archlinux.org/packages/modprobed-db
+ if [ -n "$_localmodcfg" ]; then
+ msg2 "If you have modprobe-db installed, running it in recall mode now"
+ if [ -e /usr/bin/modprobed-db ]; then
+ [[ -x /usr/bin/sudo ]] || {
+ echo "Cannot call modprobe with sudo. Install sudo and configure it to work with this user."
+ exit 1; }
+ sudo /usr/bin/modprobed-db recall
+ fi
+ msg2 "Running Steven Rostedt's make localmodconfig now"
+ make localmodconfig
+ fi
+
+ ### Running make nconfig
+
+ [[ -z "$_makenconfig" ]] || make nconfig
+
+ ### Running make menuconfig
+
+ [[ -z "$_makemenuconfig" ]] || make menuconfig
+
+ ### Running make xconfig
+
+ [[ -z "$_makexconfig" ]] || make xconfig
+
+ ### Running make gconfig
+
+ [[ -z "$_makegconfig" ]] || make gconfig
+
+ ### Save configuration for later reuse
+ cat .config > "${startdir}/config.last"
}
build() {
- cd ${srcdir}/linux-${__basekernel}
+ cd ${_srcname}
make bzImage modules
}
_package() {
-pkgdesc="A desktop oriented kernel and modules with Liquorix patches"
-depends=('coreutils' 'linux-firmware' 'mkinitcpio>=0.8')
-optdepends=('crda: to set the correct wireless channels of your country' 'nvidia-lqx: nVidia drivers for linux-lqx' 'linux-firmware: Firmware files for Linux')
-backup=("etc/mkinitcpio.d/${pkgbase}.preset")
-install=linux.install
+ pkgdesc="A desktop oriented kernel and modules with Liquorix patches"
+ depends=('coreutils' 'linux-firmware' 'mkinitcpio>=0.7')
+ optdepends=('crda: to set the correct wireless channels of your country' 'modprobed-db: Keeps track of EVERY kernel module that has ever been probed - useful for those of us who make localmodconfig')
+ backup=("etc/mkinitcpio.d/$pkgbase.preset")
+ install=linux.install
-cd "${srcdir}/linux-${__basekernel}"
+ local kernver="$(<version)"
- # get kernel version
- _kernver="$(make kernelrelease)"
- _basekernel=${_kernver%%-*}
- _basekernel=${_basekernel%.*}
+ cd $_srcname
- mkdir -p "${pkgdir}"/{boot,usr/lib/modules}
- make INSTALL_MOD_PATH="${pkgdir}/usr" modules_install
- cp arch/x86/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgbase}"
+ msg2 "Installing boot image..."
+ install -Dm644 "$(make -s image_name)" "$pkgdir/boot/vmlinuz-$pkgbase"
- # make room for external modules
- local _extramodules="extramodules-${_basekernel}${_kernelname}"
- ln -s "../${_extramodules}" "${pkgdir}/usr/lib/modules/${_kernver}/extramodules"
+ msg2 "Installing modules..."
+ local modulesdir="$pkgdir/usr/lib/modules/$kernver"
+ mkdir -p "$modulesdir"
+ make INSTALL_MOD_PATH="$pkgdir/usr" modules_install
- # add real version for building modules and running depmod from hook
- echo "${_kernver}" |
- install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modules/${_extramodules}/version"
+ # 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 "${pkgdir}"/usr/lib/modules/${_kernver}/{source,build}
-
- # now we call depmod...
- depmod -b "${pkgdir}/usr" -F System.map "${_kernver}"
+ rm "$modulesdir"/{source,build}
- # add vmlinux
- install -Dt "${pkgdir}/usr/lib/modules/${_kernver}/build" -m644 vmlinux
+ msg2 "Installing hooks..."
# sed expression for following substitutions
- local _subst="
- s|%PKGBASE%|${pkgbase}|g
- s|%KERNVER%|${_kernver}|g
- s|%EXTRAMODULES%|${_extramodules}|g
+ local subst="
+ s|%PKGBASE%|$pkgbase|g
+ s|%KERNVER%|$kernver|g
+ s|%EXTRAMODULES%|$extramodules|g
"
# hack to allow specifying an initially nonexisting install file
- sed "${_subst}" "${startdir}/${install}" > "${startdir}/${install}.pkg"
- true && install=${install}.pkg
-
- # install mkinitcpio preset file
- sed "${_subst}" ../linux.preset |
- install -Dm644 /dev/stdin "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
-
- # install pacman hooks
- 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"
- sed "${_subst}" ../99-linux.hook |
- install -Dm644 /dev/stdin "${pkgdir}/usr/share/libalpm/hooks/99-${pkgbase}.hook"
+ sed "$subst" "$startdir/$install" > "$startdir/$install.pkg"
+ true && install=$install.pkg
+
+ # 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"
+ sed "$subst" ../99-linux.hook | install -Dm644 /dev/stdin \
+ "$pkgdir/usr/share/libalpm/hooks/99-${pkgbase}.hook"
+
+ msg2 "Fixing permissions..."
+ chmod -Rc u=rwX,go=rX "$pkgdir"
}
_package-headers() {
-pkgdesc="Header files and scripts to build modules for linux-lqx."
-depends=('linux-lqx')
-
-cd "${srcdir}/linux-${__basekernel}"
+ pkgdesc='Header files and scripts to build modules for linux-lqx'
+ depends=('linux-lqx')
+ local builddir="$pkgdir/usr/lib/modules/$(<version)/build"
- local _builddir="${pkgdir}/usr/lib/modules/${_kernver}/build"
+ cd $_srcname
- install -Dt "${_builddir}" -m644 Makefile .config Module.symvers
- install -Dt "${_builddir}/kernel" -m644 kernel/Makefile
+ msg2 "Installing build files..."
+ install -Dt "$builddir" -m644 Makefile .config Module.symvers System.map vmlinux
+ install -Dt "$builddir/kernel" -m644 kernel/Makefile
+ install -Dt "$builddir/arch/x86" -m644 arch/x86/Makefile
+ cp -t "$builddir" -a scripts
- mkdir "${_builddir}/.tmp_versions"
+ # add objtool for external module building and enabled VALIDATION_STACK option
+ install -Dt "$builddir/tools/objtool" tools/objtool/objtool
- cp -t "${_builddir}" -a include scripts
+ # add xfs and shmem for aufs building
+ mkdir -p "$builddir"/{fs/xfs,mm}
- install -Dt "${_builddir}/arch/x86" -m644 arch/x86/Makefile
- install -Dt "${_builddir}/arch/x86/kernel" -m644 arch/x86/kernel/asm-offsets.s
+ # ???
+ mkdir "$builddir/.tmp_versions"
- cp -t "${_builddir}/arch/x86" -a arch/x86/include
+ msg2 "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
+ install -Dt "$builddir/drivers/md" -m644 drivers/md/*.h
+ install -Dt "$builddir/net/mac80211" -m644 net/mac80211/*.h
# http://bugs.archlinux.org/task/13146
- install -Dt "${_builddir}/drivers/media/i2c" -m644 drivers/media/i2c/msp3400-driver.h
+ install -Dt "$builddir/drivers/media/i2c" -m644 drivers/media/i2c/msp3400-driver.h
# http://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
-
- # add xfs and shmem for aufs building
- mkdir -p "${_builddir}"/{fs/xfs,mm}
-
- # copy in Kconfig files
- find . -name Kconfig\* -exec install -Dm644 {} "${_builddir}/{}" \;
-
- # add objtool for external module building and enabled VALIDATION_STACK option
- install -Dt "${_builddir}/tools/objtool" tools/objtool/objtool
-
- # remove unneeded architectures
- local _arch
- for _arch in "${_builddir}"/arch/*/; do
- [[ ${_arch} == */x86/ ]] && continue
- rm -r "${_arch}"
+ 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
+
+ msg2 "Installing KConfig files..."
+ find . -name 'Kconfig*' -exec install -Dm644 {} "$builddir/{}" \;
+
+ msg2 "Removing unneeded architectures..."
+ local arch
+ for arch in "$builddir"/arch/*/; do
+ [[ $arch = */x86/ ]] && continue
+ echo "Removing $(basename "$arch")"
+ rm -r "$arch"
done
- # remove files already in linux-docs package
- rm -r "${_builddir}/Documentation"
-
- # remove now broken symlinks
- find -L "${_builddir}" -type l -printf 'Removing %P\n' -delete
-
- # Fix permissions
- chmod -R u=rwX,go=rX "${_builddir}"
-
- # strip scripts directory
- local _binary _strip
- while read -rd '' _binary; do
- case "$(file -bi "${_binary}")" in
- *application/x-sharedlib*) _strip="${STRIP_SHARED}" ;; # Libraries (.so)
- *application/x-archive*) _strip="${STRIP_STATIC}" ;; # Libraries (.a)
- *application/x-executable*) _strip="${STRIP_BINARIES}" ;; # Binaries
- *) continue ;;
+ msg2 "Removing documentation..."
+ rm -r "$builddir/Documentation"
+
+ msg2 "Removing broken symlinks..."
+ find -L "$builddir" -type l -printf 'Removing %P\n' -delete
+
+ msg2 "Removing loose objects..."
+ find "$builddir" -type f -name '*.o' -printf 'Removing %P\n' -delete
+
+ msg2 "Stripping build tools..."
+ local file
+ while read -rd '' file; do
+ case "$(file -bi "$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
- /usr/bin/strip ${_strip} "${_binary}"
- done < <(find "${_builddir}/scripts" -type f -perm -u+w -print0 2>/dev/null)
+ done < <(find "$builddir" -type f -perm -u+x ! -name vmlinux -print0)
+
+ msg2 "Fixing permissions..."
+ chmod -Rc u=rwX,go=rX "$pkgdir"
}
-_package-docs() {
-pkgdesc="Kernel hackers manual - HTML documentation that comes with the linux-lqx kernel"
-depends=('linux-lqx' )
- cd "${srcdir}/linux-${__basekernel}"
+_package-docs() {
+ pkgdesc='Kernel hackers manual - HTML documentation that comes with the linux-lqx.'
+ depends=('linux-lqx')
+
+ local builddir="$pkgdir/usr/lib/modules/$(<version)/build"
- local _builddir="${pkgdir}/usr/lib/modules/${_kernver}/build"
+ cd $_srcname
- mkdir -p "${_builddir}"
- cp -t "${_builddir}" -a Documentation
+ msg2 "Installing documentation..."
+ mkdir -p "$builddir"
+ cp -t "$builddir" -a Documentation
- # Fix permissions
- chmod -R u=rwX,go=rX "${_builddir}"
+ msg2 "Fixing permissions..."
+ chmod -Rc u=rwX,go=rX "$pkgdir"
}
-pkgname=("${pkgbase}" "${pkgbase}-headers" "${pkgbase}-docs")
-for _p in ${pkgname[@]}; do
- eval "package_${_p}() {
- $(declare -f "_package${_p#${pkgbase}}")
- _package${_p#${pkgbase}}
+
+pkgname=("$pkgbase" "$pkgbase-headers" "$pkgbase-docs")
+for _p in "${pkgname[@]}"; do
+ eval "package_$_p() {
+ $(declare -f "_package${_p#$pkgbase}")
+ _package${_p#$pkgbase}
}"
done
+
+sha512sums=('4d9de340a26155a89ea8773131c76220cc2057f2b5d031b467b60e8b14c1842518e2d60a863d8c695f0f7640f3f18d43826201984a238dade857b6cef79837db'
+ 'SKIP'
+ '67a649cd808e7ef1f47a54be56cd6a5da0ba02698e3e3c3307b885b3c75464e6b0ec0f91a776e379486fdb50b00fc99ea9ceac9d6392f3d389b6a46e2dd699a8'
+ 'bfe1df7716a071086c91d847886bf7e0340c643f175969794b0e97f88c07e959dae8bbbf4d40e73ff27a035a8f58e4f4a45f6eaf844cc07fdfc8ef589a83e3ae'
+ '7ad5be75ee422dda3b80edd2eb614d8a9181e2c8228cd68b3881e2fb95953bf2dea6cbe7900ce1013c9de89b2802574b7b24869fc5d7a95d3cc3112c4d27063a'
+ '4a8b324aee4cccf3a512ad04ce1a272d14e5b05c8de90feb82075f55ea3845948d817e1b0c6f298f5816834ddd3e5ce0a0e2619866289f3c1ab8fd2f35f04f44'
+ '6346b66f54652256571ef65da8e46db49a95ac5978ecd57a507c6b2a28aee70bb3ff87045ac493f54257c9965da1046a28b72cb5abb0087204d257f14b91fd74'
+ '2dc6b0ba8f7dbf19d2446c5c5f1823587de89f4e28e9595937dd51a87755099656f2acec50e3e2546ea633ad1bfd1c722e0c2b91eef1d609103d8abdc0a7cbaf'
+ '38e3d30fba9ec7faa2e7ef2bc13f054fe30d863192d340c45b1e5624716617b21fe825537cefb00c5257f31f77e7050175ad098b9bbc0f29359bf1b7487e5afd')
+
+validpgpkeys=(
+ 'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linux Torvalds
+ '647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman
+ )