diff options
author | Yurii Kolesnykov | 2018-03-16 14:15:37 +0200 |
---|---|---|
committer | Yurii Kolesnykov | 2018-03-16 16:43:21 +0300 |
commit | 5308a34b7a804ae564cde4f4b04a22e7fa10d344 (patch) | |
tree | 49ef5279c4a6384ff1abdfa520893c1cf9a9cbad | |
parent | 2675ee0c675e9fa6d17ab1efe9b3d211e44a51f9 (diff) | |
download | aur-5308a34b7a804ae564cde4f4b04a22e7fa10d344.tar.gz |
port changes from linux-git package
-rw-r--r-- | .SRCINFO | 10 | ||||
-rw-r--r-- | PKGBUILD | 112 | ||||
-rw-r--r-- | linux-amd-staging-drm-next-git.preset (renamed from linux.preset) | 0 | ||||
-rw-r--r-- | linux.install | 8 |
4 files changed, 57 insertions, 73 deletions
@@ -10,20 +10,20 @@ pkgbase = linux-amd-staging-drm-next-git makedepends = kmod makedepends = inetutils makedepends = bc - makedepends = libelf makedepends = git + makedepends = libelf options = !strip source = linux-amd-staging-drm-next-git::git://people.freedesktop.org/~agd5f/linux#branch=amd-staging-drm-next source = config.x86_64 source = 90-linux.hook - source = linux.preset + source = linux-amd-staging-drm-next-git.preset sha256sums = SKIP sha256sums = 3910a14756c3ac24e2358bb1b28a355918dd07c102dbf0a31f961ba5810098a9 sha256sums = 834bd254b56ab71d73f59b3221f056c72f559553c04718e350ab2a3e2991afe0 sha256sums = ad6344badc91ad0630caacde83f7f9b97276f80d26a20619a87952be65492c65 pkgname = linux-amd-staging-drm-next-git - pkgdesc = The Linux kernel and modules with AMDGPU DC patches + pkgdesc = The Linux kernel and modules (git version) with patches from AMD install = linux.install depends = coreutils depends = linux-firmware @@ -34,10 +34,10 @@ pkgname = linux-amd-staging-drm-next-git backup = etc/mkinitcpio.d/linux-amd-staging-drm-next-git.preset pkgname = linux-amd-staging-drm-next-git-headers - pkgdesc = Header files and scripts for building modules for Linux kernel with AMDGPU DC patches + pkgdesc = Header files and scripts for building modules for Linux kernel (git version) with patches from AMD provides = linux-headers pkgname = linux-amd-staging-drm-next-git-docs - pkgdesc = Kernel hackers manual - HTML documentation that comes with the Linux kernel with AMDGPU DC patches + pkgdesc = Kernel hackers manual - HTML documentation that comes with the Linux kernel (git version) with patches from AMD provides = linux-docs @@ -14,16 +14,15 @@ pkgrel=1 arch=('x86_64') url='https://cgit.freedesktop.org/~agd5f/linux/' license=('GPL2') -makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc' 'libelf' 'git') +makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc' 'git' 'libelf') options=('!strip') -source=( - "${pkgbase}::git://people.freedesktop.org/~agd5f/linux#branch=${_branch}" +source=("${pkgbase}::git://people.freedesktop.org/~agd5f/linux#branch=${_branch}" # The main kernel config files 'config.x86_64' # Pacman hook for initramfs regeneration '90-linux.hook' # Standard config files for mkinitcpio ramdisk - 'linux.preset') + "${pkgbase}.preset") sha256sums=('SKIP' '3910a14756c3ac24e2358bb1b28a355918dd07c102dbf0a31f961ba5810098a9' '834bd254b56ab71d73f59b3221f056c72f559553c04718e350ab2a3e2991afe0' @@ -36,21 +35,21 @@ pkgver() { } prepare() { - cd "${_srcname}" || exit + cd "${_srcname}" cat "${srcdir}/config.x86_64" > ./.config - # Set localversion to git commit + # set localversion to git commit sed -i "s|CONFIG_LOCALVERSION=.*|CONFIG_LOCALVERSION=\"-${pkgver##*.}\"|g" ./.config sed -i "s|CONFIG_LOCALVERSION_AUTO=.*|CONFIG_LOCALVERSION_AUTO=n|" ./.config - # Don't run depmod on 'make install'. We'll do this ourselves in packaging + # don't run depmod on 'make install'. We'll do this ourselves in packaging sed -i '2iexit 0' scripts/depmod.sh - # Get kernel version + # get kernel version make prepare - # Load configuration + # load configuration # Configure the kernel. Replace the line below with one of your choice. #make menuconfig # CLI menu for configuration #make nconfig # new CLI menu for configuration @@ -61,45 +60,42 @@ prepare() { } build() { - cd "${_srcname}" || exit + cd "${_srcname}" + make ${MAKEFLAGS} LOCALVERSION= bzImage modules } _package() { - pkgdesc="The Linux kernel and modules with AMDGPU DC patches" + pkgdesc="The Linux kernel and modules (git version) with patches from AMD" depends=('coreutils' 'linux-firmware' 'kmod' 'mkinitcpio>=0.7') optdepends=('crda: to set the correct wireless channels of your country') provides=('linux') backup=("etc/mkinitcpio.d/${pkgbase}.preset") install=linux.install - cd "${_srcname}" || exit + cd "${_srcname}" KARCH=x86 - # TODO figure out why the resulting built kernel doesn't show 4.15.xx as per the AMD's branch name - # The branch is called drm-next-4.15 but the built kernel shows 4.13.xx - # The actual release is drm-next-4.15 (see https://cgit.freedesktop.org/~agd5f/linux/tree/Makefile?h=drm-next-4.15) - # It's confusing. It's likely that the code is intended to be merged into 4.15 but if that's the case, - # I would expect that 4.15 code is in this branch and therefore the makefile should be up to date.... - - # Get kernel version + # get kernel version _kernver="$(make LOCALVERSION= kernelrelease)" _basekernel=${_kernver%%-*} _basekernel=${_basekernel%.*} mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot} make LOCALVERSION= INSTALL_MOD_PATH="${pkgdir}" modules_install - cp arch/${KARCH}/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgbase}" + cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgbase}" - # Set correct depmod command for install - sed "s|KERNEL_NAME=.*|KERNEL_NAME=${pkgbase}|g;s|KERNEL_VERSION=.*|KERNEL_VERSION=${_kernver}|g" \ - "${startdir}/${install}" > "${startdir}/${install}.pkg" + # set correct depmod command for install + cp -f "${startdir}/${install}" "${startdir}/${install}.pkg" true && install=${install}.pkg + sed \ + -e "s/KERNEL_NAME=.*/KERNEL_NAME=${_kernelname}/" \ + -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/" \ + -i "${startdir}/${install}" - # Copy the local linux.preset to a preset matching our custom kernel name and update the contents - # Install mkinitcpio preset file for kernel - install -D -m644 "${srcdir}/linux.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset" + # install mkinitcpio preset file for kernel + install -D -m644 "${srcdir}/${pkgbase}.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset" sed \ -e "1s|'linux.*'|'${pkgbase}'|" \ -e "s|ALL_kver=.*|ALL_kver=\"/boot/vmlinuz-${pkgbase}\"|" \ @@ -107,40 +103,37 @@ _package() { -e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-${pkgbase}-fallback.img\"|" \ -i "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset" - # Remove build and source links + # remove build and source links rm -f "${pkgdir}"/lib/modules/${_kernver}/{source,build} - - # Remove the firmware + # remove the firmware rm -rf "${pkgdir}/lib/firmware" - - # Make room for external modules + # 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 + # add real version for building modules and running depmod from post_install/upgrade mkdir -p "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}" echo "${_kernver}" > "${pkgdir}/lib/modules/extramodules-${_basekernel}${_kernelname:--ARCH}/version" # Now we call depmod... depmod -b "${pkgdir}" -F System.map "${_kernver}" - # Move module tree /lib -> /usr/lib + # move module tree /lib -> /usr/lib mkdir -p "${pkgdir}/usr" mv "${pkgdir}/lib" "${pkgdir}/usr/" - # Add vmlinux - install -D -m644 vmlinux "${pkgdir}/usr/lib/modules/${_kernver}/build/vmlinux" + # add vmlinux + install -D -m644 vmlinux "${pkgdir}/usr/lib/modules/${_kernver}/build/vmlinux" - # Add System.map + # add System.map install -D -m644 System.map "${pkgdir}/boot/System.map-${_kernver}" } _package-headers() { - pkgdesc="Header files and scripts for building modules for Linux kernel with AMDGPU DC patches" + pkgdesc="Header files and scripts for building modules for Linux kernel (git version) with patches from AMD" provides=('linux-headers') install -dm755 "${pkgdir}/usr/lib/modules/${_kernver}" - cd "${_srcname}" || exit + cd "${_srcname}" install -D -m644 Makefile \ "${pkgdir}/usr/lib/modules/${_kernver}/build/Makefile" install -D -m644 kernel/Makefile \ @@ -155,15 +148,15 @@ _package-headers() { cp -a include/${i} "${pkgdir}/usr/lib/modules/${_kernver}/build/include/" done - # Copy arch includes for external modules + # copy arch includes for external modules mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/x86" cp -a arch/x86/include "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/x86/" - # Copy files necessary for later builds, like nvidia and vmware + # copy files necessary for later builds, like nvidia and vmware cp Module.symvers "${pkgdir}/usr/lib/modules/${_kernver}/build" cp -a scripts "${pkgdir}/usr/lib/modules/${_kernver}/build" - # Fix permissions on scripts dir + # fix permissions on scripts dir chmod og-w -R "${pkgdir}/usr/lib/modules/${_kernver}/build/scripts" mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/.tmp_versions" @@ -171,35 +164,26 @@ _package-headers() { cp arch/${KARCH}/Makefile "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/" - if [ "${CARCH}" = "i686" ]; then - cp arch/${KARCH}/Makefile_32.cpu "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/" - fi - cp arch/${KARCH}/kernel/asm-offsets.s "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/kernel/" - # Add dm headers + # add dm headers mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/md" cp drivers/md/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/md" - # Add inotify.h + # add inotify.h mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include/linux" cp include/linux/inotify.h "${pkgdir}/usr/lib/modules/${_kernver}/build/include/linux/" - # Add wireless headers + # add wireless headers mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/net/mac80211/" cp net/mac80211/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/net/mac80211/" - # Add dvb headers for external modules - # in reference to: - # http://bugs.archlinux.org/task/9912 - mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-core" - cp drivers/media/dvb-core/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-core/" - # and... + # add dvb headers for external modules # http://bugs.archlinux.org/task/11194 mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/include/config/dvb/" cp include/config/dvb/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/include/config/dvb/" - # Add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new + # add dvb headers for http://mcentral.de/hg/~mrec/em28xx-new # in reference to: # http://bugs.archlinux.org/task/13146 mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/dvb-frontends/" @@ -207,7 +191,7 @@ _package-headers() { mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/i2c/" cp drivers/media/i2c/msp3400-driver.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/i2c/" - # Add dvb headers + # add dvb headers # in reference to: # http://bugs.archlinux.org/task/20402 mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/usb/dvb-usb" @@ -217,13 +201,13 @@ _package-headers() { mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/tuners" cp drivers/media/tuners/*.h "${pkgdir}/usr/lib/modules/${_kernver}/build/drivers/media/tuners/" - # Add xfs and shmem for aufs building + # add xfs and shmem for aufs building mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/fs/xfs" mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/mm" # removed in 3.17 series # cp fs/xfs/xfs_sb.h "${pkgdir}/usr/lib/modules/${_kernver}/build/fs/xfs/xfs_sb.h" - # Copy in Kconfig files + # copy in Kconfig files for i in $(find . -name "Kconfig*"); do mkdir -p "${pkgdir}"/usr/lib/modules/${_kernver}/build/`echo ${i} | sed 's|/Kconfig.*||'` cp ${i} "${pkgdir}/usr/lib/modules/${_kernver}/build/${i}" @@ -239,7 +223,7 @@ _package-headers() { chown -R root.root "${pkgdir}/usr/lib/modules/${_kernver}/build" find "${pkgdir}/usr/lib/modules/${_kernver}/build" -type d -exec chmod 755 {} \; - # Strip scripts directory + # strip scripts directory find "${pkgdir}/usr/lib/modules/${_kernver}/build/scripts" -type f -perm -u+w 2>/dev/null | while read binary ; do case "$(file -bi "${binary}")" in *application/x-sharedlib*) # Libraries (.so) @@ -251,15 +235,15 @@ _package-headers() { esac done - # Remove unneeded architectures + # remove unneeded architectures rm -rf "${pkgdir}"/usr/lib/modules/${_kernver}/build/arch/{alpha,arc,arm,arm26,arm64,avr32,blackfin,c6x,cris,frv,h8300,hexagon,ia64,m32r,m68k,m68knommu,metag,mips,microblaze,mn10300,openrisc,parisc,powerpc,ppc,s390,score,sh,sh64,sparc,sparc64,tile,unicore32,um,v850,xtensa} } _package-docs() { - pkgdesc="Kernel hackers manual - HTML documentation that comes with the Linux kernel with AMDGPU DC patches" + pkgdesc="Kernel hackers manual - HTML documentation that comes with the Linux kernel (git version) with patches from AMD" provides=('linux-docs') - cd "${_srcname}" || exit + cd "${_srcname}" mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build" cp -al Documentation "${pkgdir}/usr/lib/modules/${_kernver}/build" @@ -271,7 +255,7 @@ _package-docs() { } pkgname=("${pkgbase}" "${pkgbase}-headers" "${pkgbase}-docs") -for _p in "${pkgname[@]}"; do +for _p in ${pkgname[@]}; do eval "package_${_p}() { $(declare -f "_package${_p#${pkgbase}}") _package${_p#${pkgbase}} diff --git a/linux.preset b/linux-amd-staging-drm-next-git.preset index 66709a8c1537..66709a8c1537 100644 --- a/linux.preset +++ b/linux-amd-staging-drm-next-git.preset diff --git a/linux.install b/linux.install index 9d80af98d590..ef42413835ac 100644 --- a/linux.install +++ b/linux.install @@ -9,7 +9,7 @@ post_install () { echo ">>> Updating module dependencies. Please wait ..." depmod ${KERNEL_VERSION} echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..." - mkinitcpio -p ${KERNEL_NAME} + mkinitcpio -p linux${KERNEL_NAME} } post_upgrade() { @@ -21,7 +21,7 @@ post_upgrade() { echo ">>> Updating module dependencies. Please wait ..." depmod ${KERNEL_VERSION} echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..." - mkinitcpio -p ${KERNEL_NAME} + mkinitcpio -p linux${KERNEL_NAME} if [ $(vercmp $2 3.13) -lt 0 ]; then echo ">>> WARNING: AT keyboard support is no longer built into the kernel." @@ -32,6 +32,6 @@ post_upgrade() { post_remove() { # also remove the compat symlinks - rm -f boot/initramfs-${KERNEL_NAME}.img - rm -f boot/initramfs-${KERNEL_NAME}-fallback.img + rm -f boot/initramfs-linux${KERNEL_NAME}.img + rm -f boot/initramfs-linux${KERNEL_NAME}-fallback.img } |