Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
78 lines (62 sloc) 2.02 KB
# Maintainer: Haruue Icymoon <haruue@caoyue.com.cn>
# Contributor: Lucjan Lucjanov <lucjan.lucjanov@gmail.com>
pkgname=linux-usermode
true && pkgname=(linux-usermode linux-usermode-modules)
pkgbase=linux-usermode
_kernelname=-usermodelinux
_srcname=linux-4.17
pkgver=4.17.9
pkgrel=1
pkgdesc="User mode Linux kernel and modules, with tcp_bbr as default TCP congestion control"
arch=('x86_64')
license=('GPL2')
url="http://user-mode-linux.sourceforge.net/"
depends=('coreutils')
makedepends=('bc' 'inetutils' 'gcc7')
source=("http://www.kernel.org/pub/linux/kernel/v4.x/${_srcname}.tar.xz"
"http://www.kernel.org/pub/linux/kernel/v4.x/patch-${pkgver}.xz"
config
extra_config)
sha256sums=('9faa1dd896eaea961dc6e886697c0b3301277102e5bc976b2758f9a62d3ccd13'
'SKIP'
'SKIP'
'SKIP')
prepare() {
cd "${srcdir}/${_srcname}"
# add upstream patch
patch -p1 -i "${srcdir}/patch-${pkgver}"
cat ../config - >.config <<END
CONFIG_LOCALVERSION="${_kernelname}"
CONFIG_LOCALVERSION_AUTO=n
END
# set extraversion to pkgrel
sed -i "/^EXTRAVERSION =/s/=.*/= -${pkgrel}/" Makefile
# bbr config
cat ../extra_config >> .config
# rewrite configuration
yes "" | make ARCH=um config >/dev/null
}
build() {
cd "${srcdir}/${_srcname}"
unset LDFLAGS CFLAGS
make ARCH=um CC=gcc-7 vmlinux modules
}
package_linux-usermode() {
cd "${srcdir}/${_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/
}
package_linux-usermode-modules() {
install=modules.install
cd "${srcdir}/${_srcname}"
# get kernel version
_kernver="$(make ARCH=um kernelrelease)"
# make ARCH=um INSTALL_MOD_PATH="${pkgdir}/usr" modules_install
make ARCH=um INSTALL_MOD_PATH="${pkgdir}/usr" _modinst_
rm -f $pkgdir/usr/lib/modules/${_kernver}/{source,build}
sed \
-e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
-i "${startdir}/modules.install"
}
# vim:set ts=8 sts=2 sw=2 et:
You can’t perform that action at this time.