update
This commit is contained in:
parent
52de21eef9
commit
9dce8d8e48
6 changed files with 358 additions and 8892 deletions
12
linux/60-linux.hook
Normal file
12
linux/60-linux.hook
Normal file
|
@ -0,0 +1,12 @@
|
|||
[Trigger]
|
||||
Type = File
|
||||
Operation = Install
|
||||
Operation = Upgrade
|
||||
Operation = Remove
|
||||
Target = usr/lib/modules/%KERNVER%/*
|
||||
Target = usr/lib/modules/%EXTRAMODULES%/*
|
||||
|
||||
[Action]
|
||||
Description = Updating %PKGBASE% module dependencies...
|
||||
When = PostTransaction
|
||||
Exec = /usr/bin/depmod %KERNVER%
|
|
@ -6,6 +6,6 @@ Target = boot/vmlinuz-%PKGBASE%
|
|||
Target = usr/lib/initcpio/*
|
||||
|
||||
[Action]
|
||||
Description = Updating %PKGBASE% initcpios
|
||||
Description = Updating %PKGBASE% initcpios...
|
||||
When = PostTransaction
|
||||
Exec = /usr/bin/mkinitcpio -p %PKGBASE%
|
||||
|
|
143
linux/PKGBUILD
143
linux/PKGBUILD
|
@ -4,52 +4,47 @@
|
|||
|
||||
pkgbase=linux # Build stock -ARCH kernel
|
||||
#pkgbase=linux-custom # Build kernel with a different name
|
||||
_srcname=linux-4.13
|
||||
pkgver=4.13.10
|
||||
_srcname=linux
|
||||
pkgver=4.15rc5.r0.g464e1d5f23cc
|
||||
pkgrel=1
|
||||
arch=('i686' 'x86_64')
|
||||
arch=('x86_64')
|
||||
url="https://www.kernel.org/"
|
||||
license=('GPL2')
|
||||
makedepends=('xmlto' 'kmod' 'inetutils' 'bc' 'libelf')
|
||||
options=('!strip')
|
||||
source=("https://www.kernel.org/pub/linux/kernel/v4.x/${_srcname}.tar.xz"
|
||||
"https://www.kernel.org/pub/linux/kernel/v4.x/${_srcname}.tar.sign"
|
||||
"https://www.kernel.org/pub/linux/kernel/v4.x/patch-${pkgver}.xz"
|
||||
"https://www.kernel.org/pub/linux/kernel/v4.x/patch-${pkgver}.sign"
|
||||
# the main kernel config files
|
||||
'config.i686' 'config.x86_64'
|
||||
# pacman hook for initramfs regeneration
|
||||
'90-linux.hook'
|
||||
# standard config files for mkinitcpio ramdisk
|
||||
'linux.preset')
|
||||
|
||||
sha256sums=('2db3d6066c3ad93eb25b973a3d2951e022a7e975ee2fa7cbe5bddf84d9a49a2c'
|
||||
'SKIP'
|
||||
'b9efa9c6375f79f6a041a5f0666d4ced1a49bfe8c4662d26517a6b4cfd9bf2f6'
|
||||
'SKIP'
|
||||
'9b1d9fcb55782e6149aca4dc2d3b250dd4cedf1bf4bd8c6f0968acab0e2e0ee4'
|
||||
'9c6c4d27d59638d0569ea09a97138bfcfb219f17cdf1138be141380e6654f302'
|
||||
'834bd254b56ab71d73f59b3221f056c72f559553c04718e350ab2a3e2991afe0'
|
||||
source=(
|
||||
'git+https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git'
|
||||
'config' # the main kernel config file
|
||||
'60-linux.hook' # pacman hook for depmod
|
||||
'90-linux.hook' # pacman hook for initramfs regeneration
|
||||
'linux.preset' # standard config files for mkinitcpio ramdisk
|
||||
)
|
||||
sha256sums=('SKIP'
|
||||
'bfde21c325d39013463c38e9fa23d6d6481238b8509eea4ae38906127017e47d'
|
||||
'ae2e95db94ef7176207c690224169594d49445e04249d2499e9d2fbc117a0b21'
|
||||
'75f99f5239e03238f88d1a834c50043ec32b1dc568f2cc291b07d04718483919'
|
||||
'ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65')
|
||||
validpgpkeys=(
|
||||
'ABAF11C65A2970B130ABE3C479BE3E4300411886' # Linus Torvalds
|
||||
'647F28654894E3BD457199BE38DBBDC86092693E' # Greg Kroah-Hartman
|
||||
)
|
||||
|
||||
_kernelname=${pkgbase#linux}
|
||||
|
||||
pkgver() {
|
||||
cd "${_srcname}"
|
||||
|
||||
git describe --long | sed -E 's/^v//;s/([^-]*-g)/r\1/;s/-/./g;s/\.rc/rc/'
|
||||
}
|
||||
|
||||
prepare() {
|
||||
cd ${_srcname}
|
||||
|
||||
# add upstream patch
|
||||
patch -p1 -i ../patch-${pkgver}
|
||||
#patch -p1 -i ../patch-${pkgver}
|
||||
|
||||
# security patches
|
||||
|
||||
# add latest fixes from stable queue, if needed
|
||||
# http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git
|
||||
|
||||
cp -Tf ../config.${CARCH} .config
|
||||
cp -Tf ../config .config
|
||||
|
||||
if [ "${_kernelname}" != "" ]; then
|
||||
sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"${_kernelname}\"|g" ./.config
|
||||
|
@ -62,6 +57,9 @@ prepare() {
|
|||
# don't run depmod on 'make install'. We'll do this ourselves in packaging
|
||||
sed -i '2iexit 0' scripts/depmod.sh
|
||||
|
||||
# old config
|
||||
make olddefconfig
|
||||
|
||||
# get kernel version
|
||||
make prepare
|
||||
|
||||
|
@ -93,29 +91,22 @@ _package() {
|
|||
|
||||
cd ${_srcname}
|
||||
|
||||
KARCH=x86
|
||||
|
||||
# get kernel version
|
||||
_kernver="$(make LOCALVERSION= kernelrelease)"
|
||||
_basekernel=${_kernver%%-*}
|
||||
_basekernel=${_basekernel%.*}
|
||||
|
||||
mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot}
|
||||
mkdir -p "${pkgdir}"/{boot,lib/{modules,firmware},usr}
|
||||
make LOCALVERSION= INSTALL_MOD_PATH="${pkgdir}" modules_install
|
||||
cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgbase}"
|
||||
cp arch/x86/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgbase}"
|
||||
|
||||
# set correct depmod command for install
|
||||
sed -e "s|%PKGBASE%|${pkgbase}|g;s|%KERNVER%|${_kernver}|g" \
|
||||
"${startdir}/${install}" > "${startdir}/${install}.pkg"
|
||||
true && install=${install}.pkg
|
||||
# make room for external modules
|
||||
local _extramodules="extramodules-${_basekernel}${_kernelname:--ARCH}"
|
||||
ln -s "../${_extramodules}" "${pkgdir}/lib/modules/${_kernver}/extramodules"
|
||||
|
||||
# install mkinitcpio preset file for kernel
|
||||
sed "s|%PKGBASE%|${pkgbase}|g" ../linux.preset |
|
||||
install -Dm644 /dev/stdin "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"
|
||||
|
||||
# install pacman hook for initramfs regeneration
|
||||
sed "s|%PKGBASE%|${pkgbase}|g" ../90-linux.hook |
|
||||
install -Dm644 /dev/stdin "${pkgdir}/usr/share/libalpm/hooks/90-${pkgbase}.hook"
|
||||
# add real version for building modules and running depmod from hook
|
||||
echo "${_kernver}" |
|
||||
install -Dm644 /dev/stdin "${pkgdir}/lib/modules/${_extramodules}/version"
|
||||
|
||||
# remove build and source links
|
||||
rm "${pkgdir}"/lib/modules/${_kernver}/{source,build}
|
||||
|
@ -123,21 +114,35 @@ _package() {
|
|||
# remove the firmware
|
||||
rm -r "${pkgdir}/lib/firmware"
|
||||
|
||||
# make room for external modules
|
||||
ln -s "../extramodules-${_basekernel}${_kernelname:--ARCH}" "${pkgdir}/lib/modules/${_kernver}/extramodules"
|
||||
|
||||
# add real version for building modules and running depmod from post_install/upgrade
|
||||
echo "${_kernver}" |
|
||||
install -Dm644 /dev/stdin "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}/version"
|
||||
|
||||
# Now we call depmod...
|
||||
# now we call depmod...
|
||||
depmod -b "${pkgdir}" -F System.map "${_kernver}"
|
||||
|
||||
# add vmlinux
|
||||
install -Dt "${pkgdir}/lib/modules/${_kernver}/build" -m644 vmlinux
|
||||
|
||||
# move module tree /lib -> /usr/lib
|
||||
mv -t "${pkgdir}/usr" "${pkgdir}/lib"
|
||||
|
||||
# add vmlinux
|
||||
install -Dm644 vmlinux "${pkgdir}/usr/lib/modules/${_kernver}/build/vmlinux"
|
||||
# sed expression for following substitutions
|
||||
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}" ../linux.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"
|
||||
}
|
||||
|
||||
_package-headers() {
|
||||
|
@ -153,14 +158,10 @@ _package-headers() {
|
|||
|
||||
cp -t "${_builddir}" -a include scripts
|
||||
|
||||
install -Dt "${_builddir}/arch/${KARCH}" -m644 arch/${KARCH}/Makefile
|
||||
install -Dt "${_builddir}/arch/${KARCH}/kernel" -m644 arch/${KARCH}/kernel/asm-offsets.s
|
||||
install -Dt "${_builddir}/arch/x86" -m644 arch/x86/Makefile
|
||||
install -Dt "${_builddir}/arch/x86/kernel" -m644 arch/x86/kernel/asm-offsets.s
|
||||
|
||||
if [[ ${CARCH} = i686 ]]; then
|
||||
install -t "${_builddir}/arch/${KARCH}" -m644 arch/${KARCH}/Makefile_32.cpu
|
||||
fi
|
||||
|
||||
cp -t "${_builddir}/arch/${KARCH}" -a arch/${KARCH}/include
|
||||
cp -t "${_builddir}/arch/x86" -a arch/x86/include
|
||||
|
||||
install -Dt "${_builddir}/drivers/md" -m644 drivers/md/*.h
|
||||
install -Dt "${_builddir}/net/mac80211" -m644 net/mac80211/*.h
|
||||
|
@ -184,16 +185,13 @@ _package-headers() {
|
|||
find . -name Kconfig\* -exec install -Dm644 {} "${_builddir}/{}" \;
|
||||
|
||||
# add objtool for external module building and enabled VALIDATION_STACK option
|
||||
if [[ -e tools/objtool/objtool ]]; then
|
||||
install -Dt "${_builddir}/tools/objtool" tools/objtool/objtool
|
||||
fi
|
||||
install -Dt "${_builddir}/tools/objtool" tools/objtool/objtool
|
||||
|
||||
# remove unneeded architectures
|
||||
local _arch
|
||||
for _arch in "${_builddir}"/arch/*/; do
|
||||
if [[ ${_arch} != */${KARCH}/ ]]; then
|
||||
rm -r "${_arch}"
|
||||
fi
|
||||
[[ ${_arch} == */x86/ ]] && continue
|
||||
rm -r "${_arch}"
|
||||
done
|
||||
|
||||
# remove files already in linux-docs package
|
||||
|
@ -215,20 +213,7 @@ _package-headers() {
|
|||
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 ${pkgbase/linux/Linux} kernel"
|
||||
|
||||
cd ${_srcname}
|
||||
local _builddir="${pkgdir}/usr/lib/modules/${_kernver}/build"
|
||||
|
||||
mkdir -p "${_builddir}"
|
||||
cp -t "${_builddir}" -a Documentation
|
||||
|
||||
# Fix permissions
|
||||
chmod -R u=rwX,go=rX "${_builddir}"
|
||||
}
|
||||
|
||||
pkgname=("${pkgbase}" "${pkgbase}-headers")#"${pkgbase}-docs")
|
||||
pkgname=("${pkgbase}" "${pkgbase}-headers")
|
||||
for _p in ${pkgname[@]}; do
|
||||
eval "package_${_p}() {
|
||||
$(declare -f "_package${_p#${pkgbase}}")
|
||||
|
|
File diff suppressed because it is too large
Load diff
8636
linux/config.i686
8636
linux/config.i686
File diff suppressed because it is too large
Load diff
|
@ -1,27 +1,10 @@
|
|||
post_install () {
|
||||
# updating module dependencies
|
||||
echo ">>> Updating module dependencies. Please wait ..."
|
||||
depmod %KERNVER%
|
||||
}
|
||||
|
||||
post_upgrade() {
|
||||
if findmnt --fstab -uno SOURCE /boot &>/dev/null && ! mountpoint -q /boot; then
|
||||
echo "WARNING: /boot appears to be a separate partition but is not mounted."
|
||||
fi
|
||||
|
||||
# updating module dependencies
|
||||
echo ">>> Updating module dependencies. Please wait ..."
|
||||
depmod %KERNVER%
|
||||
|
||||
if [ $(vercmp $2 3.13) -lt 0 ]; then
|
||||
echo ">>> WARNING: AT keyboard support is no longer built into the kernel."
|
||||
echo ">>> In order to use your keyboard during early init, you MUST"
|
||||
echo ">>> include the 'keyboard' hook in your mkinitcpio.conf."
|
||||
fi
|
||||
}
|
||||
|
||||
post_remove() {
|
||||
# also remove the compat symlinks
|
||||
rm -f boot/initramfs-%PKGBASE%.img
|
||||
rm -f boot/initramfs-%PKGBASE%-fallback.img
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue