summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorFigue2018-12-02 01:23:16 +0100
committerFigue2018-12-02 01:23:16 +0100
commit63e1a7d207aa7d171b398600865ebfae5f4cb85a (patch)
treeb52e4a070e5e29719c3a9d73bc56f27311721744
parentef3a6188eaa48630fb426bdab0d7f09ced474701 (diff)
downloadaur-63e1a7d207aa7d171b398600865ebfae5f4cb85a.tar.gz
4.19.6-xanmod4. Merged almost all from stock
-rw-r--r--.SRCINFO22
-rw-r--r--0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch102
-rw-r--r--90-linux.hook2
-rw-r--r--PKGBUILD283
-rw-r--r--patches-from-archlinux-stable-git.patch0
5 files changed, 246 insertions, 163 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 7c49842581fc..b7b298609b4e 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,5 +1,5 @@
pkgbase = linux-xanmod
- pkgver = 4.19.4
+ pkgver = 4.19.6
pkgrel = 1
url = http://www.xanmod.org/
arch = x86_64
@@ -9,20 +9,22 @@ pkgbase = linux-xanmod
makedepends = inetutils
makedepends = bc
makedepends = libelf
+ makedepends = python-sphinx
+ makedepends = graphviz
options = !strip
- source = https://github.com/xanmod/linux/archive/4.19.4-xanmod3.tar.gz
+ source = https://github.com/xanmod/linux/archive/4.19.6-xanmod4.tar.gz
source = 60-linux.hook
source = 90-linux.hook
source = linux-xanmod.preset
source = choose-gcc-optimization.sh
- source = patches-from-archlinux-stable-git.patch
- sha256sums = b4f47c125aff211c4e8b248d1856d01b9c780dfe50ea8348fca6fb353d40cd3d
+ source = 0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch
+ sha256sums = 7c945a49388840a388aafb903e492258d9cf4b287c1292f9adbe05c6ea367a5d
sha256sums = ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21
- sha256sums = 75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919
+ sha256sums = c043f3033bb781e2688794a59f6d1f7ed49ef9b13eb77ff9a425df33a244a636
sha256sums = ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65
sha256sums = 9d2623553e79fae8420fff03175614b29dd566e8280b294b53ab318a0eebeb50
- sha256sums = e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
- source_x86_64 = config_1d6806a0676a04c8dc6b3327204a58996420a15f::https://git.archlinux.org/svntogit/packages.git/plain/trunk/config?h=packages/linux&id=1d6806a0676a04c8dc6b3327204a58996420a15f
+ sha256sums = 112b16c247dae8ff44066fd0268012f9c623d5da349ebd66896e54257b3404a5
+ source_x86_64 = config_c64696ecf1075e3ad6ab1c0c74e043f8fdf5b3c1::https://git.archlinux.org/svntogit/packages.git/plain/trunk/config?h=packages/linux&id=c64696ecf1075e3ad6ab1c0c74e043f8fdf5b3c1
sha256sums_x86_64 = e7fa30bb2de12d1a2488423e27c00f26d55668e310e69aaf93673c1afd89dbaf
pkgname = linux-xanmod
@@ -31,7 +33,7 @@ pkgname = linux-xanmod
depends = coreutils
depends = linux-firmware
depends = kmod
- depends = mkinitcpio>=0.7
+ depends = mkinitcpio
optdepends = crda: to set the correct wireless channels of your country
provides = linux
provides = linux-xanmod-git
@@ -46,7 +48,3 @@ pkgname = linux-xanmod-headers
conflicts = linux-xanmod-git-headers
replaces = linux-xanmod-git-headers
-pkgname = linux-xanmod-docs
- pkgdesc = Kernel hackers manual - HTML documentation that comes with the Linux kernel
- provides = linux-docs
-
diff --git a/0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch b/0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch
new file mode 100644
index 000000000000..fdcc8faea235
--- /dev/null
+++ b/0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch
@@ -0,0 +1,102 @@
+From 1ce3e84fdf0b56f477d30acdc8797dedd7330e37 Mon Sep 17 00:00:00 2001
+From: Serge Hallyn <serge.hallyn@canonical.com>
+Date: Fri, 31 May 2013 19:12:12 +0100
+Subject: [PATCH 1/2] add sysctl to disallow unprivileged CLONE_NEWUSER by
+ default
+
+Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
+[bwh: Remove unneeded binary sysctl bits]
+Signed-off-by: Daniel Micay <danielmicay@gmail.com>
+---
+ kernel/fork.c | 15 +++++++++++++++
+ kernel/sysctl.c | 12 ++++++++++++
+ kernel/user_namespace.c | 3 +++
+ 3 files changed, 30 insertions(+)
+
+diff --git a/kernel/fork.c b/kernel/fork.c
+index f0b58479534f..8b2d927125c5 100644
+--- a/kernel/fork.c
++++ b/kernel/fork.c
+@@ -103,6 +103,11 @@
+
+ #define CREATE_TRACE_POINTS
+ #include <trace/events/task.h>
++#ifdef CONFIG_USER_NS
++extern int unprivileged_userns_clone;
++#else
++#define unprivileged_userns_clone 0
++#endif
+
+ /*
+ * Minimum number of threads to boot the kernel
+@@ -1649,6 +1654,10 @@ static __latent_entropy struct task_struct *copy_process(
+ if ((clone_flags & (CLONE_NEWUSER|CLONE_FS)) == (CLONE_NEWUSER|CLONE_FS))
+ return ERR_PTR(-EINVAL);
+
++ if ((clone_flags & CLONE_NEWUSER) && !unprivileged_userns_clone)
++ if (!capable(CAP_SYS_ADMIN))
++ return ERR_PTR(-EPERM);
++
+ /*
+ * Thread groups must share signals as well, and detached threads
+ * can only be started up within the thread group.
+@@ -2467,6 +2476,12 @@ int ksys_unshare(unsigned long unshare_flags)
+ if (unshare_flags & CLONE_NEWNS)
+ unshare_flags |= CLONE_FS;
+
++ if ((unshare_flags & CLONE_NEWUSER) && !unprivileged_userns_clone) {
++ err = -EPERM;
++ if (!capable(CAP_SYS_ADMIN))
++ goto bad_unshare_out;
++ }
++
+ err = check_unshare_flags(unshare_flags);
+ if (err)
+ goto bad_unshare_out;
+diff --git a/kernel/sysctl.c b/kernel/sysctl.c
+index cc02050fd0c4..ce2ad2b92897 100644
+--- a/kernel/sysctl.c
++++ b/kernel/sysctl.c
+@@ -105,6 +105,9 @@ extern int core_uses_pid;
+ extern char core_pattern[];
+ extern unsigned int core_pipe_limit;
+ #endif
++#ifdef CONFIG_USER_NS
++extern int unprivileged_userns_clone;
++#endif
+ extern int pid_max;
+ extern int pid_max_min, pid_max_max;
+ extern int percpu_pagelist_fraction;
+@@ -514,6 +517,15 @@ static struct ctl_table kern_table[] = {
+ .proc_handler = proc_dointvec,
+ },
+ #endif
++#ifdef CONFIG_USER_NS
++ {
++ .procname = "unprivileged_userns_clone",
++ .data = &unprivileged_userns_clone,
++ .maxlen = sizeof(int),
++ .mode = 0644,
++ .proc_handler = proc_dointvec,
++ },
++#endif
+ #ifdef CONFIG_PROC_SYSCTL
+ {
+ .procname = "tainted",
+diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c
+index 923414a246e9..6b9dbc257e34 100644
+--- a/kernel/user_namespace.c
++++ b/kernel/user_namespace.c
+@@ -26,6 +26,9 @@
+ #include <linux/bsearch.h>
+ #include <linux/sort.h>
+
++/* sysctl */
++int unprivileged_userns_clone;
++
+ static struct kmem_cache *user_ns_cachep __read_mostly;
+ static DEFINE_MUTEX(userns_state_mutex);
+
+--
+2.19.1
+
diff --git a/90-linux.hook b/90-linux.hook
index be0d886539f4..fca45abe1a62 100644
--- a/90-linux.hook
+++ b/90-linux.hook
@@ -2,7 +2,7 @@
Type = File
Operation = Install
Operation = Upgrade
-Target = boot/vmlinuz-%PKGBASE%
+Target = usr/lib/modules/%KERNVER%/vmlinuz
Target = usr/lib/initcpio/*
[Action]
diff --git a/PKGBUILD b/PKGBUILD
index 676fbd0824c6..d65667535d45 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -25,39 +25,54 @@ fi
pkgbase=linux-xanmod
_srcname=linux
-pkgver=4.19.4
-xanmod=3
+pkgver=4.19.6
+xanmod=4
pkgrel=1
-arch=('x86_64')
+arch=(x86_64)
url="http://www.xanmod.org/"
-license=('GPL2')
-makedepends=('xmlto' 'kmod' 'inetutils' 'bc' 'libelf')
+license=(GPL2)
+makedepends=(xmlto kmod inetutils bc libelf python-sphinx graphviz)
options=('!strip')
-
+_srcname="linux-${pkgver}-xanmod${xanmod}"
# Arch stock configuration files are directly pulled from a specific trunk
-arch_config_trunk=1d6806a0676a04c8dc6b3327204a58996420a15f
+arch_config_trunk=c64696ecf1075e3ad6ab1c0c74e043f8fdf5b3c1
source=(https://github.com/xanmod/linux/archive/${pkgver}-xanmod${xanmod}.tar.gz
60-linux.hook # pacman hook for depmod
90-linux.hook # pacman hook for initramfs regeneration
${pkgbase}.preset # standard config files for mkinitcpio ramdisk
choose-gcc-optimization.sh
- patches-from-archlinux-stable-git.patch
+ 0001-add-sysctl-to-disallow-unprivileged-CLONE_NEWUSER-by.patch
)
source_x86_64=("config_$arch_config_trunk::https://git.archlinux.org/svntogit/packages.git/plain/trunk/config?h=packages/linux&id=${arch_config_trunk}")
-sha256sums=('b4f47c125aff211c4e8b248d1856d01b9c780dfe50ea8348fca6fb353d40cd3d'
+sha256sums=('7c945a49388840a388aafb903e492258d9cf4b287c1292f9adbe05c6ea367a5d'
'ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21'
- '75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919'
+ 'c043f3033bb781e2688794a59f6d1f7ed49ef9b13eb77ff9a425df33a244a636'
'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65'
'9d2623553e79fae8420fff03175614b29dd566e8280b294b53ab318a0eebeb50'
- 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855')
+ '112b16c247dae8ff44066fd0268012f9c623d5da349ebd66896e54257b3404a5')
sha256sums_x86_64=('e7fa30bb2de12d1a2488423e27c00f26d55668e310e69aaf93673c1afd89dbaf')
_kernelname=${pkgbase#linux}
prepare() {
- cd "${srcdir}/linux-${pkgver}-xanmod${xanmod}"
+ cd $_srcname
+
+ msg2 "Setting version..."
+ scripts/setlocalversion --save-scmversion
+ echo "-$pkgrel" > localversion.10-pkgrel
+ echo "$_kernelname" > localversion.20-pkgname
+
+ # Archlinux patches
+ local src
+ for src in "${source[@]}"; do
+ src="${src%%::*}"
+ src="${src##*/}"
+ [[ $src = *.patch ]] || continue
+ msg2 "Applying patch $src..."
+ patch -Np1 < "../$src"
+ done
case $_configuration in
1) true ; answer="Xanmod" ;;
@@ -69,14 +84,6 @@ prepare() {
sleep 2
warning "To change this modify _configuration variable in PKGBUILD"
- # Archlinux patches
- patch -Np1 -i ../patches-from-archlinux-stable-git.patch
-
- 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
-
# CONFIG_STACK_VALIDATION gives better stack traces. Also is enabled in all official kernel packages by Archlinux team
sed -i "s|# CONFIG_STACK_VALIDATION.*|CONFIG_STACK_VALIDATION=y|" ./.config
@@ -86,97 +93,73 @@ prepare() {
# EXPERIMENTAL: let's user choose microarchitecture optimization in GCC
${srcdir}/choose-gcc-optimization.sh $_microarchitecture
- # set extraversion to pkgrel and empty localversion
- sed -e "/^EXTRAVERSION =/s/=.*/= -${pkgrel}/" \
- -e "/^EXTRAVERSION =/aLOCALVERSION =" \
- -i Makefile
+ make olddefconfig
- # don't run depmod on 'make install'. We'll do this ourselves in packaging
- sed -i '2iexit 0' scripts/depmod.sh
-
- # get kernel version
- make prepare
-
- # load configuration
- # Configure the kernel. Replace the line below with one of your choice.
- #make menuconfig # CLI menu for configuration
- #make nconfig # new CLI menu for configuration
- #make xconfig # X-based configuration
- #make oldconfig # using old config from previous kernel version
- # ... or manually edit .config
-
- # rewrite configuration
- yes "" | make config >/dev/null
+ make -s kernelrelease > ../version
+ msg2 "Prepared %s version %s" "$pkgbase" "$(<../version)"
}
build() {
- cd "${srcdir}/linux-${pkgver}-xanmod${xanmod}"
-
+ cd $_srcname
make bzImage modules
}
_package() {
pkgdesc="The Linux kernel and modules with Xanmod patches"
- depends=('coreutils' 'linux-firmware' 'kmod' 'mkinitcpio>=0.7')
+ depends=(coreutils linux-firmware kmod mkinitcpio)
optdepends=('crda: to set the correct wireless channels of your country')
provides=('linux' 'linux-xanmod-git')
replaces=('linux-xanmod-git')
conflicts=('linux-xanmod-git')
- backup=("etc/mkinitcpio.d/${pkgbase}.preset")
+ backup=("etc/mkinitcpio.d/$pkgbase.preset")
install=linux.install
- cd "${srcdir}/linux-${pkgver}-xanmod${xanmod}"
+ local kernver="$(<version)"
+ local modulesdir="$pkgdir/usr/lib/modules/$kernver"
- # get kernel version
- _kernver="$(make kernelrelease)"
- _basekernel=${_kernver%%-*}
- _basekernel=${_basekernel%.*}
-
- mkdir -p "${pkgdir}"/{boot,usr/lib/modules}
- make INSTALL_MOD_PATH="${pkgdir}/usr" modules_install
- cp arch/x86/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgbase}"
-
- # make room for external modules
- local _extramodules="extramodules-${_basekernel}${_kernelname}"
- ln -s "../${_extramodules}" "${pkgdir}/usr/lib/modules/${_kernver}/extramodules"
+ cd $_srcname
+ msg2 "Installing boot image..."
# systemd expects to find the kernel here to allow hibernation
# https://github.com/systemd/systemd/commit/edda44605f06a41fb86b7ab8128dcf99161d2344
- ln -sr "${pkgdir}/boot/vmlinuz-${pkgbase}" "${pkgdir}/usr/lib/modules/${_kernver}/vmlinuz"
+ install -Dm644 "$(make -s image_name)" "$modulesdir/vmlinuz"
+ install -Dm644 "$modulesdir/vmlinuz" "$pkgdir/boot/vmlinuz-$pkgbase"
- # add real version for building modules and running depmod from hook
- echo "${_kernver}" |
- install -Dm644 /dev/stdin "${pkgdir}/usr/lib/modules/${_extramodules}/version"
-
- # remove build and source links
- rm "${pkgdir}"/usr/lib/modules/${_kernver}/{source,build}
+ msg2 "Installing modules..."
+ make INSTALL_MOD_PATH="$pkgdir/usr" modules_install
- # now we call depmod...
- depmod -b "${pkgdir}/usr" -F System.map "${_kernver}"
+ # 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"
- # add vmlinux
- install -Dt "${pkgdir}/usr/lib/modules/${_kernver}/build" -m644 vmlinux
+ # remove build and source links
+ rm "$modulesdir"/{source,build}
+ 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}" ../${pkgbase}.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" "$startdir/$install" > "$startdir/$install.pkg"
+ true && install=$install.pkg
+
+ # fill in mkinitcpio preset and pacman hooks
+ sed "$subst" ../$pkgbase.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 "Fixing permissions..."
+ chmod -Rc u=rwX,go=rX "$pkgdir"
}
_package-headers() {
@@ -185,89 +168,89 @@ _package-headers() {
replaces=('linux-xanmod-git-headers')
conflicts=('linux-xanmod-git-headers')
- cd "${srcdir}/linux-${pkgver}-xanmod${xanmod}"
- local _builddir="${pkgdir}/usr/lib/modules/${_kernver}/build"
+ local builddir="$pkgdir/usr/lib/modules/$(<version)/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)
-}
-
-_package-docs() {
- pkgdesc="Kernel hackers manual - HTML documentation that comes with the Linux kernel"
- provides=('linux-docs')
-
- cd "${srcdir}/linux-${pkgver}-xanmod${xanmod}"
- local _builddir="${pkgdir}/usr/lib/modules/${_kernver}/build"
+ done < <(find "$builddir" -type f -perm -u+x ! -name vmlinux -print0)
- mkdir -p "${_builddir}"
- cp -t "${_builddir}" -a Documentation
+ msg2 "Adding symlink..."
+ mkdir -p "$pkgdir/usr/src"
+ ln -sr "$builddir" "$pkgdir/usr/src/$pkgbase-$pkgver"
- # 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")
+for _p in "${pkgname[@]}"; do
+ eval "package_$_p() {
+ $(declare -f "_package${_p#$pkgbase}")
+ _package${_p#$pkgbase}
}"
done
diff --git a/patches-from-archlinux-stable-git.patch b/patches-from-archlinux-stable-git.patch
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/patches-from-archlinux-stable-git.patch
+++ /dev/null