blob: b7a552a81a074f4d020738c668768d8d78c8e299 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
# Maintainer: Yardena Cohen <yardenack at gmail dot com>
# tracks: https://projects.archlinux.org/svntogit/packages.git/log/trunk?h=packages/linux
pkgname=linux-linode
_basekernel=3.16
_kernelname=${pkgname#linux}
_srcname=linux-${_basekernel}
pkgver=${_basekernel}.0
pkgrel=1
arch=('i686' 'x86_64')
url="https://github.com/yardenac/linux-linode"
license=(GPL2)
makedepends=(xmlto docbook-xsl kmod inetutils bc 'gcc>=4.9.0')
options=('!strip')
source=("https://www.kernel.org/pub/linux/kernel/v3.x/${_srcname}.tar.xz"
# "https://www.kernel.org/pub/linux/kernel/v3.x/patch-${pkgver}.xz"
'config'
'config.x86_64'
'menu.lst'
"preset")
sha512sums=('64033e741d3f42ed06010e63e69d66e1d3d9414ef20f76834508878d4218b72619541a18ef4fd377204af2859e52198310998109b20ed9b67722586b28c9a231'
'1e55ff7875bfb04c3eb1a0476e786bcd1c42e5dc1f0205a2e9644dd961247ef748aed6a32c52bb278e5d599eb537fa8c74dec5fb96d301e4f7906e5b36303fd5'
'c4599f18e633136076ee0d97009422822347c6797051015516f9a491e0cc8f556ff42c0780966a9eb2337a993f8153e89dcb70613480c57bdc4bd84413a583e5'
'f4191d63f71920a4c366c6c291205a780b7ddca952b4420dfb52b9e6d33c818b431830afe990df3ef3601458959a1b39b88c084b416a814cb7a957187670b733'
'a0a78831075336edef0a8faa34fa550986c3c4d89a89f4f39d798da0211129dc90257d162bec2cdefabef2eb5886a710e70c72074b2f3016788861d05d1e2a1f')
pkgdesc="Kernel for Linode servers"
depends=('coreutils' 'linux-firmware' 'kmod' 'mkinitcpio>=0.7')
provides=(linux)
conflicts=(grub grub-legacy)
backup=(etc/mkinitcpio.d/${pkgname}.preset boot/grub/menu.lst)
install=install
prepare() {
cd "${srcdir}/${_srcname}"
# patch -p1 -i "${srcdir}/patch-${pkgver}"
if [ "${CARCH}" = "x86_64" ]; then
cat "${srcdir}/config.x86_64" > ./.config
else
cat "${srcdir}/config" > ./.config
fi
sed -i '2iexit 0' scripts/depmod.sh
sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
sed -i "s|CONFIG_LOCALVERSION_AUTO=.*|CONFIG_LOCALVERSION_AUTO=n|g" ./.config
sed -ri "s|^(EXTRAVERSION =).*|\1 -${pkgrel}|" Makefile
make prepare
}
build() {
cd "${srcdir}/${_srcname}"
CFLAGS=${CFLAGS}" -march=corei7 -mtune=corei7 -mcpu=corei7 "
CXXFLAGS=${CXXFLAGS}" -march=corei7 -mtune=corei7 -mcpu=corei7 "
[[ "$MAKEFLAGS" =~ -j[0-9]* ]] || MAKEFLAGS+=" -j$(nproc)"
ionice -c 3 nice -n 16 make ${MAKEFLAGS} LOCALVERSION= bzImage modules
}
package_linux-linode() {
KARCH=x86
cd "${srcdir}/${_srcname}"
_kernver="$(make LOCALVERSION= kernelrelease)"
mkdir -p "${pkgdir}"/{lib/{modules,firmware},boot}
make LOCALVERSION= INSTALL_MOD_PATH="${pkgdir}" modules_install
rm -rf "${pkgdir}"/lib/{firmware,modules/${_kernver}/{source,build}}
cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgname}"
install -D -m644 vmlinux "${pkgdir}/lib/modules/${_kernver}/build/vmlinux"
install -D -m644 "${srcdir}/preset" "${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset"
sed \
-e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/" \
-i "${startdir}/install"
sed \
-e "s|ALL_kver=.*|ALL_kver=\"/boot/vmlinuz-${pkgname}\"|" \
-e "s|default_image=.*|default_image=\"/boot/initramfs-${pkgname}.img\"|" \
-e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-${pkgname}-fallback.img\"|" \
-i "${pkgdir}/etc/mkinitcpio.d/${pkgname}.preset"
find "${pkgdir}" -name '*.ko' -exec gzip -9 {} \;
emdir="extramodules-${_basekernel}${_kernelname:--ARCH}"
mkdir -p "${pkgdir}/lib/modules/${emdir}"
ln -s "../${emdir}" "${pkgdir}/lib/modules/${_kernver}/extramodules"
echo "${_kernver}" >| "${pkgdir}/lib/modules/${emdir}/version"
depmod -b "${pkgdir}" -F System.map "${_kernver}"
mkdir -p "${pkgdir}/usr"
mv "${pkgdir}/"{lib,usr/}
mkdir -p ${pkgdir}/boot/grub
sed "s/%VER%/${pkgver}-${pkgrel}/ig" ${srcdir}/menu.lst > ${pkgdir}/boot/grub/menu.lst
}
|