summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Parnell2015-06-15 21:23:51 -0500
committerMatt Parnell2015-06-15 21:23:51 -0500
commit8a98939f11f953e24fee7749472f01126166701f (patch)
tree1f4a8c437b9979d6369c5dba9da1600a46c6801a
downloadaur-8a98939f11f953e24fee7749472f01126166701f.tar.gz
Initial import
-rw-r--r--.SRCINFO29
-rw-r--r--PKGBUILD199
-rw-r--r--linux-zen.conf5
-rw-r--r--linux-zen.install51
-rw-r--r--linux-zen.preset7
5 files changed, 291 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..2e24ad285b8
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,29 @@
+pkgbase = linux-zen
+ pkgdesc = Featureful kernel including various new features, code and optimizations to better suit desktops
+ pkgver = 4.0.0+507377+g7a1a41c
+ pkgrel = 1
+ url = http://www.zen-kernel.org
+ arch = i686
+ arch = x86_64
+ license = GPL2
+ makedepends = git
+ options = !strip
+ source = linux-zen.conf
+ source = linux-zen.preset
+ source = git://github.com/damentz/zen-kernel.git#branch=4.0/master
+ sha256sums = 6373073ad943e068478ef1373be4eb2a7e473da8743d946f1f50cd364685ab87
+ sha256sums = 18fe6b2664a9a740544c4cb990efe5ec933d6e64caf9e5d0a6ced92af0027c2d
+ sha256sums = SKIP
+
+pkgname = linux-zen
+ install = linux-zen.install
+ depends = coreutils
+ depends = linux-firmware
+ depends = kmod
+ depends = mkinitcpio>=0.5.20
+ optdepends = linux-zen-headers: to build third party modules such as NVIDIA drivers or OSSv4
+ optdepends = crda: to set the correct wireless channels of your country
+ backup = etc/mkinitcpio.d/linux-zen.conf
+
+pkgname = linux-zen-headers
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..29fc5306efa
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,199 @@
+# Maintainer: Matt Parnell/ilikenwf <parwok@gmail.com>
+# Original PKGBUILD Contributor: Patrick Bartels <p4ddy.b@gmail.com>
+# Thanks to Bregol
+pkgname="linux-zen"
+pkgver=4.0.0+507377+g7a1a41c
+pkgdesc="Featureful kernel including various new features, code and optimizations to better suit desktops"
+url="http://www.zen-kernel.org"
+license=("GPL2")
+makedepends=("git")
+true && pkgbase="linux-zen"
+true && pkgname=("linux-zen" "linux-zen-headers")
+arch=("i686" "x86_64")
+pkgrel=1
+options=("!strip")
+source=("linux-zen.conf"
+ "linux-zen.preset"
+ 'git://github.com/damentz/zen-kernel.git#branch=4.0/master')
+sha256sums=('6373073ad943e068478ef1373be4eb2a7e473da8743d946f1f50cd364685ab87'
+ '18fe6b2664a9a740544c4cb990efe5ec933d6e64caf9e5d0a6ced92af0027c2d'
+ 'SKIP')
+_CORES=1
+
+# compress the modules or not
+_compress="y"
+
+prepare() {
+ cd "${srcdir}/zen-kernel"
+
+ # Number of CPU Cores
+ _CORES=$(cat /proc/cpuinfo|grep processor|wc -l)
+ if [ $_CORES -lt 1 ]; then
+ _CORES=2
+ fi
+}
+
+pkgver() {
+ cd "${srcdir}/zen-kernel"
+ eval $(grep -o "^\(VERSION\|PATCHLEVEL\|SUBLEVEL\) = [0-9a-zA-Z_-]\+" Makefile | tr -d \ )
+ printf "%s.%s.%s+%s+g%s" $VERSION $PATCHLEVEL $SUBLEVEL "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+build() {
+ cd "${srcdir}/zen-kernel"
+
+ # don't run depmod on 'make install'. We'll do this ourselves in packaging
+ sed -i '2iexit 0' scripts/depmod.sh
+
+ if [ -e "${srcdir}/build/.config" ]; then
+ msg2 "Using existing config found in build environment..."
+ else
+ if [ ! -d "${srcdir}/build" ]; then
+ msg2 "Creating build directory..."
+ mkdir -p "${srcdir}/build"
+ fi
+
+ msg2 "Creating default config..." # also initializes the output directory
+ make -C "${srcdir}/zen-kernel/" O="${srcdir}/build" defconfig > /dev/null
+
+ warning "This package does not ship a kernel config."
+
+ plain ""
+ warning "Thus it is up to you to create a one that fits your needs."
+ warning "Navigate to '${srcdir}/build'"
+ warning "and either run 'make menuconfig' or if you want to use an existing config,"
+ warning "save it as '.config' and run 'make oldconfig' in order to update it."
+ warning "Having done that you can run 'makepkg' again."
+ plain ""
+
+ return 1
+ fi
+
+ msg2 "Updating output directory Makefile..."
+ make -C "${srcdir}/zen-kernel/" O="${srcdir}/build" outputmakefile
+
+ warning "Press ENTER if you want to build the kernel or CTRL+C to abort..."
+ read
+
+ cd "${srcdir}/build"
+ msg2 "Building kernel..."; make -j $_CORES bzImage
+ msg2 "Building modules..."; make -j $_CORES modules
+}
+
+package_linux-zen() {
+ depends=("coreutils" "linux-firmware" "kmod" "mkinitcpio>=0.5.20")
+ optdepends=("linux-zen-headers: to build third party modules such as NVIDIA drivers or OSSv4"
+ "crda: to set the correct wireless channels of your country")
+ backup=(etc/mkinitcpio.d/linux-zen.conf)
+ install=linux-zen.install
+
+ msg2 "Determining kernel name..."
+ cd "${srcdir}/zen-kernel"
+ cp "${srcdir}/build/.config" "./"
+ _kernver="$(make kernelrelease -s)"
+ msg2 "Kernel release name is: $_kernver"
+
+ cd "${srcdir}/build"
+ mkdir -p "$pkgdir/usr/lib"
+
+ cd "${srcdir}/build"
+
+ msg2 "Installing kernel image..."
+ install -D -m644 "arch/x86/boot/bzImage" "$pkgdir/boot/vmlinuz-linux-zen"
+
+ msg2 "Installing modules (and firmware files)..."
+ make INSTALL_MOD_PATH="$pkgdir" modules_install
+
+ if [ -d "$pkgdir/lib/firmware" ]; then
+ msg2 "Removing firmware files..."
+ rm -r "$pkgdir/lib/firmware"
+ fi
+
+ if [ $_compress = "y" ]; then
+ msg2 "Compressing kernel modules with gzip..."
+ find "${pkgdir}" -name '*.ko' -exec gzip -9 {} \;
+ fi
+
+ # make room for external modules
+ if [ -d "${pkgdir}/usr/lib/modules/extramodules-*" ]; then
+ rmdir "${pkgdir}/usr/lib/modules/extramodules-*" &> /dev/null
+ fi
+
+ # add real version for building modules and running depmod from post_install/upgrade
+ mkdir -p "${pkgdir}/usr/lib/modules/extramodules-${_kernver}"
+ echo "${_kernver}" > "${pkgdir}/usr/lib/modules/extramodules-${_kernver}/version"
+
+ msg2 "Removing links to source and build directory..."
+ rm "$pkgdir/lib/modules/$_kernver/"{build,source}
+
+ msg2 "Updating kernel version in install script..."
+ sed -i "s/_kernel_version=.*/_kernel_version=$_kernver/" \
+ "$startdir/linux-zen.install"
+
+ msg2 "Installing files for mkinitcpio..."
+ install -D -m644 "${srcdir}/linux-zen.conf" \
+ "$pkgdir/etc/mkinitcpio.d/linux-zen.conf"
+
+ install -D -m644 "${srcdir}/linux-zen.preset" \
+ "$pkgdir/etc/mkinitcpio.d/linux-zen.preset"
+ sed -i "s/^ALL_kver=.*$/ALL_kver=$_kernver/" \
+ "$pkgdir/etc/mkinitcpio.d/linux-zen.preset"
+
+ # Now we call depmod...
+ depmod -b "$pkgdir" -F System.map "$_kernver"
+
+ # move module tree /lib -> /usr/lib
+ cp -a "$pkgdir/lib" "$pkgdir/usr/"
+
+ rm -rf "$pkgdir/lib"
+ find "$pkgdir" -type d -name .git -exec rm -r '{}' +
+}
+
+package_linux-zen-headers() {
+ # AUR workaround
+ true && pkgdesc="Header files and scripts for building modules for linux-zen"
+ true && depends=("linux-zen")
+ true && provides=("linux-headers")
+
+ _srcdir="/usr/src/linux-$_kernver"
+
+ msg2 "Installing files necessary for 3rd party modules such as NVIDIA drivers or OSSv4..."
+ mkdir -p "${pkgdir}/usr/src/linux-$_kernver/"{arch/x86,include}
+
+ install -D -m644 "${srcdir}/zen-kernel/Makefile" "${pkgdir}/usr/src/linux-$_kernver/Makefile"
+ install -D -m644 "${srcdir}/zen-kernel/kernel/Makefile" "${pkgdir}/usr/src/linux-$_kernver/kernel/Makefile"
+ install -D -m644 "${srcdir}/build/.config" "${pkgdir}/usr/src/linux-$_kernver/.config"
+ install -D -m644 "${srcdir}/build/Module.symvers" "${pkgdir}/usr/src/linux-$_kernver/Module.symvers"
+ install -D -m644 "${srcdir}/build/include/generated/uapi/linux/version.h" "${pkgdir}/usr/src/linux-$_kernver/include/linux/version.h"
+ install -D -m644 "${srcdir}/build/arch/x86/kernel/asm-offsets.s" "${pkgdir}/usr/src/linux-$_kernver/arch/x86/kernel/asm-offsets.s"
+ install -D -m644 "${srcdir}/zen-kernel/arch/x86/Makefile" "${pkgdir}/usr/src/linux-$_kernver/arch/x86/Makefile"
+
+ if [ "$CARCH" = "i686" ]; then
+ install -D -m644 "${srcdir}/zen-kernel/arch/x86/Makefile_32.cpu" "${pkgdir}/usr/src/linux-$_kernver/arch/x86/Makefile_32.cpu"
+ fi
+
+ cp -a "${srcdir}/zen-kernel/scripts" "${pkgdir}/usr/src/linux-$_kernver"
+ cp -a "${srcdir}/build/scripts" "${pkgdir}/usr/src/linux-$_kernver"
+ cp -a "${srcdir}/zen-kernel/include" "${pkgdir}/usr/src/linux-$_kernver"
+ cp -a "${srcdir}/build/include/"{generated,config} "${pkgdir}/usr/src/linux-$_kernver/include"
+ cp -a "${srcdir}/zen-kernel/arch/x86/include" "${pkgdir}/usr/src/linux-$_kernver/arch/x86"
+ cp -a "${srcdir}/build/arch/x86/include" "${pkgdir}/usr/src/linux-$_kernver/arch/x86"
+
+ cd "${srcdir}/zen-kernel"
+ {
+ find drivers -type f -name "*.h";
+ find . -type f -name "Kconfig*";
+ } | while read file; do
+ install -D -m644 "$file" "${pkgdir}/usr/src/linux-$_kernver/$file"
+ done
+
+ msg2 "Fixing permissions on scripts directory..."
+ chmod og-w -R "${pkgdir}/usr/src/linux-$_kernver/scripts"
+
+ msg2 "Creating symlinks..."
+ mkdir -p "${pkgdir}/usr/lib/modules/$_kernver/"
+ ln -s "/usr/src/linux-$_kernver" "${pkgdir}/usr/lib/modules/$_kernver/build"
+ ln -s "/usr/src/linux-$_kernver" "${pkgdir}/usr/lib/modules/$_kernver/source"
+
+ find "$pkgdir" -type d -name .git -exec rm -r '{}' +
+}
diff --git a/linux-zen.conf b/linux-zen.conf
new file mode 100644
index 00000000000..a237c6f4f55
--- /dev/null
+++ b/linux-zen.conf
@@ -0,0 +1,5 @@
+MODULES=""
+BINARIES=""
+FILES=""
+HOOKS="base udev encrypt block autodetect"
+COMPRESSION="gzip"
diff --git a/linux-zen.install b/linux-zen.install
new file mode 100644
index 00000000000..dd66423201e
--- /dev/null
+++ b/linux-zen.install
@@ -0,0 +1,51 @@
+_kernel_version=4.0.0-zen-bfs-g7a1a41c-dirty
+
+_r="\033[00;31m"
+_y="\033[00;33m"
+_g="\033[00;32m"
+_b="\033[00;34m"
+_B="\033[01;34m"
+_W="\033[01;37m"
+_n="\033[00;0m"
+
+post_install() {
+ echo -e ""
+ echo -e "$_B >$_W Kernel version:$_b $_kernel_version$_n"
+
+ echo -e ""
+ echo -e "$_B >$_W Updating module dependencies$_n"
+ /sbin/depmod "$_kernel_version"
+
+ echo -e ""
+ echo -e "$_B >$_W Mkinitcpio setup"
+ echo -e "$_n If you use LVM2, encrypted root or software RAID,"
+ echo -e "$_n ensure you enable support in $_b/etc/mkinitcpio.d/linux-zen.conf"
+ echo -e ""
+ echo -e "$_n More information about mkinitcpio setup can be found here:"
+ echo -e "$_b http://wiki.archlinux.org/index.php/Mkinitcpio"
+
+ echo -e ""
+ echo -e "$_B >$_W Generating initial ramdisks using mkinitcpio$_n"
+ mkinitcpio -p linux-zen
+
+ echo -e ""
+ echo -e "$_B >$_W Contact"
+ echo -e "$_n If you need help with the package or have any suggestions"
+ echo -e "$_n to improve zen-sources, feel free to join"
+ echo -e "$_b #zen-sources$_n on$_b irc.rizon.net$_n"
+ echo -e ""
+}
+
+post_upgrade() {
+ post_install $@
+}
+
+post_remove() {
+ dir="/usr/lib/modules/extramodules-$_kernel_version";
+
+ if [ "$(ls -A $dir)" ]; then
+ echo "Removing $dir - please note this removes any package files or extra modules you may have in there."
+ fi
+ rm -rf "/usr/lib/modules/$_kernel_version"
+ rm -rf "/usr/lib/modules/extramodules-$_kernel_version"
+}
diff --git a/linux-zen.preset b/linux-zen.preset
new file mode 100644
index 00000000000..7bd285b0c47
--- /dev/null
+++ b/linux-zen.preset
@@ -0,0 +1,7 @@
+# DO NOT EDIT THE LINE BELOW
+ALL_kver="to be replaced"
+
+PRESETS=("default")
+
+default_config="/etc/mkinitcpio.d/linux-zen.conf"
+default_image="/boot/initramfs-linux-zen.img"