summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorJerry2020-06-13 15:45:55 +0800
committerJerry2020-06-13 15:45:55 +0800
commit67c4b6759a23baa2cec83bd500c64e296459c152 (patch)
tree823d3e3795c73bcec3bbd019509b826f0f7c6b6d /PKGBUILD
downloadaur-linux-usermode-nokmod.tar.gz
linux-usermode-nokmod 5.7.2
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD73
1 files changed, 73 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..fee76140206
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,73 @@
+# Maintainer: Jerry Xiao <aur@mail.jerryxiao.cc>
+# Contributor: Piotr Gorski <lucjan.lucjanov@gmail.com>
+# Contributor: Haruue Icymoon <haruue@caoyue.com.cn>
+
+pkgname=linux-usermode-nokmod
+_kernelname=-usermodelinux
+_major=5.7
+_minor=2
+pkgver=${_major}.${_minor}
+_srcname=linux-${pkgver}
+pkgrel=1
+pkgdesc="User mode Linux kernel, without modules"
+arch=('x86_64')
+license=('GPL2')
+url="http://user-mode-linux.sourceforge.net/"
+depends=('coreutils')
+makedepends=('bc' 'inetutils')
+source=("https://www.kernel.org/pub/linux/kernel/v5.x/linux-${pkgver}.tar.xz"
+ "https://www.kernel.org/pub/linux/kernel/v5.x/linux-${pkgver}.tar.sign"
+ 'config'
+ '70-uml.hook')
+
+sha256sums=('6065ae820e2d52a77a549ef97444c36adf7ab2969b294460256f028b4eed7909'
+ 'SKIP'
+ 'bd6a8cbbc6ea207c0dcc979e2bb0cc431ae5c9172c7c8c513e2e49601bfbc5a7'
+ '05ea4e00d1e99bf8140a21c94e3c42acf17b9debad9c6f5decbe1dd1fe04332c')
+
+validpgpkeys=(
+ 'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds
+ '647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman
+ )
+
+prepare() {
+ cd ${_srcname}
+
+ echo "Setting version..."
+ sed -e "/^EXTRAVERSION =/s/=.*/=/" -i Makefile
+ scripts/setlocalversion --save-scmversion
+ echo "-$pkgrel" > localversion.10-pkgrel
+ echo "$_kernelname" > localversion.20-pkgname
+
+ local src
+ for src in "${source[@]}"; do
+ src="${src%%::*}"
+ src="${src##*/}"
+ [[ $src = *.patch ]] || continue
+ echo "Applying patch $src..."
+ patch -Np1 < "../$src"
+ done
+
+ echo "Setting config..."
+ cp ../config .config
+ yes "" | make ARCH=um config >/dev/null
+
+ make ARCH=um kernelrelease > version
+ echo "Prepared $pkgname version $(<version)"
+
+ echo "Save configuration for later reuse"
+ cat .config > "${startdir}/config.last"
+}
+
+build() {
+ cd ${_srcname}
+ unset LDFLAGS CFLAGS
+ make ARCH=um vmlinux
+}
+
+package() {
+ cd ${_srcname}
+ mkdir -p "$pkgdir/usr/bin" "$pkgdir/usr/share/kernel-usermode"
+ install -m 644 System.map ${pkgdir}/usr/share/kernel-usermode/System.map
+ install -m 755 vmlinux ${pkgdir}/usr/bin/
+}