diff options
Diffstat (limited to '~emulatorman/linux-libre/PKGBUILD')
-rw-r--r-- | ~emulatorman/linux-libre/PKGBUILD | 75 |
1 files changed, 29 insertions, 46 deletions
diff --git a/~emulatorman/linux-libre/PKGBUILD b/~emulatorman/linux-libre/PKGBUILD index 8a82ade79..45fbafcdb 100644 --- a/~emulatorman/linux-libre/PKGBUILD +++ b/~emulatorman/linux-libre/PKGBUILD @@ -14,20 +14,20 @@ _pkgbasever=4.1-gnu _pkgver=4.1.6-gnu _replacesarchkernel=('linux%') # '%' gets replaced with _kernelname -_replacesoldkernels=('kernel26%' 'kernel26-libre%') # '%' gets replaced with _kernelname -_replacesoldmodules=('linux-libre%-kmod-alx') # '%' gets replaced with _kernelname +_replacesoldkernels=() # '%' gets replaced with _kernelname +_replacesoldmodules=() # '%' gets replaced with _kernelname _srcname=linux-${_pkgbasever%-*} _archpkgver=${_pkgver%-*} pkgver=${_pkgver//-/_} -pkgrel=1 +pkgrel=2 rcnrel=armv7-x2 arch=('i686' 'x86_64' 'armv7h') url="http://linux-libre.fsfla.org/" license=('GPL2') makedepends=('xmlto' 'docbook-xsl' 'kmod' 'inetutils' 'bc') -if [ "$CARCH" = "armv7h" ]; then - makedepends+=('git' 'uboot-tools') +if [ "${CARCH}" = "armv7h" ]; then + makedepends+=('git') fi options=('!strip') source=("http://linux-libre.fsfla.org/pub/linux-libre/releases/${_pkgbasever}/linux-libre-${_pkgbasever}.tar.xz" @@ -94,7 +94,7 @@ _replacesarchkernel=("${_replacesarchkernel[@]/\%/${_kernelname}}") _replacesoldkernels=("${_replacesoldkernels[@]/\%/${_kernelname}}") _replacesoldmodules=("${_replacesoldmodules[@]/\%/${_kernelname}}") -case "$CARCH" in +case "${CARCH}" in i686|x86_64) KARCH=x86;; armv7h) KARCH=arm;; esac @@ -108,7 +108,6 @@ prepare() { fi if [ "${CARCH}" = "armv7h" ]; then - # RCN patch (CM3 firmware deblobbed) git apply -v "${srcdir}/rcn-libre-${_pkgver%-*}-${rcnrel}.patch" @@ -137,8 +136,8 @@ prepare() { # Make the radeon driver load without the firmwares # http://www.fsfla.org/pipermail/linux-libre/2015-August/003098.html - if [ "${CARCH}" != "armv7h" ]; then ## This patch is only needed for x86 computers, so we disable it for others - patch -Np1 -i ../0001-drm-radeon-Make-the-driver-load-without-the-firmwares.patch + if [ "${CARCH}" = "x86_64" ] || [ "${CARCH}" = "i686" ]; then ## This patch is only needed for x86 computers, so we disable it for others + patch -p1 -i "${srcdir}/0001-drm-radeon-Make-the-driver-load-without-the-firmwares.patch" fi cat "${srcdir}/config.${CARCH}" > ./.config @@ -167,29 +166,23 @@ prepare() { build() { cd "${srcdir}/${_srcname}" - if [ "${CARCH}" != "armv7h" ]; then + if [ "${CARCH}" = "armv7h" ]; then + make ${MAKEFLAGS} LOCALVERSION= zImage modules dtbs + elif [ "${CARCH}" = "x86_64" ] || [ "${CARCH}" = "i686" ]; then make ${MAKEFLAGS} LOCALVERSION= bzImage modules - else - make ${MAKEFLAGS} LOCALVERSION= zImage modules fi } _package() { pkgdesc="The ${pkgbase^} kernel and modules" [ "${pkgbase}" = "linux-libre" ] && groups=('base') - depends=('coreutils' 'linux-libre-firmware' 'kmod') - if [ "${CARCH}" != "armv7h" ]; then - depends+=('mkinitcpio>=0.7') - else - depends+=("linux-libre-dtb=${pkgver}") - fi + depends=('coreutils' 'linux-libre-firmware' 'kmod' 'mkinitcpio>=0.7') optdepends=('crda: to set the correct wireless channels of your country') provides=("${_replacesarchkernel[@]/%/=${_archpkgver}}") conflicts=("${_replacesarchkernel[@]}" "${_replacesoldkernels[@]}" "${_replacesoldmodules[@]}") replaces=("${_replacesarchkernel[@]}" "${_replacesoldkernels[@]}" "${_replacesoldmodules[@]}") - if [ "$CARCH" != "armv7h" ]; then - backup=("etc/mkinitcpio.d/${pkgbase}.preset") - fi + [ "${CARCH}" = "armv7h" ] && conflicts+=("${_replacesarchkernel}-uimage") && replaces+=("${_replacesarchkernel}-uimage") + backup=("etc/mkinitcpio.d/${pkgbase}.preset") install=linux.install cd "${srcdir}/${_srcname}" @@ -201,18 +194,14 @@ _package() { mkdir -p "${pkgdir}"/{lib/modules,lib/firmware,boot} if [ "${CARCH}" = "armv7h" ]; then - mkdir -p "${pkgdir}"/boot/dtbs + mkdir -p "${pkgdir}/usr/lib/dtbs/${_kernver}" fi make LOCALVERSION= INSTALL_MOD_PATH="${pkgdir}" modules_install - if [ "${CARCH}" != "armv7h" ]; then - cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgbase}" - else + if [ "${CARCH}" = "armv7h" ]; then cp arch/$KARCH/boot/zImage "${pkgdir}/boot/vmlinuz-${pkgbase}" - - for _arm in armada-{370-smileplug,370-mirabox,xp-openblocks-ax3-4} dove-{d3plug,cubox}; do - cat arch/$KARCH/boot/zImage /boot/dtbs/${_arm}.dtb > myimage-${_arm} - mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n "${pkgname}" -d myimage-${_arm} "${pkgdir}/boot/uImage-${pkgbase}-${_arm}" - done + cp arch/$KARCH/boot/dts/*.dtb "${pkgdir}/usr/lib/dtbs/${_kernver}" + elif [ "${CARCH}" = "x86_64" ] || [ "${CARCH}" = "i686" ]; then + cp arch/$KARCH/boot/bzImage "${pkgdir}/boot/vmlinuz-${pkgbase}" fi # set correct depmod command for install @@ -223,25 +212,19 @@ _package() { -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/" \ -i "${startdir}/${install}" - if [ "$CARCH" != "armv7h" ]; then - # install mkinitcpio preset file for kernel - install -D -m644 "${srcdir}/linux.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset" - sed \ - -e "1s|'linux.*'|'${pkgbase}'|" \ - -e "s|ALL_kver=.*|ALL_kver=\"/boot/vmlinuz-${pkgbase}\"|" \ - -e "s|default_image=.*|default_image=\"/boot/initramfs-${pkgbase}.img\"|" \ - -e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-${pkgbase}-fallback.img\"|" \ - -i "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset" - fi + # install mkinitcpio preset file for kernel + install -D -m644 "${srcdir}/linux.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset" + sed \ + -e "1s|'linux.*'|'${pkgbase}'|" \ + -e "s|ALL_kver=.*|ALL_kver=\"/boot/vmlinuz-${pkgbase}\"|" \ + -e "s|default_image=.*|default_image=\"/boot/initramfs-${pkgbase}.img\"|" \ + -e "s|fallback_image=.*|fallback_image=\"/boot/initramfs-${pkgbase}-fallback.img\"|" \ + -i "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset" # remove build and source links rm -f "${pkgdir}"/lib/modules/${_kernver}/{source,build} # remove the firmware rm -rf "${pkgdir}/lib/firmware" - if [ "$CARCH" = "armv7h" ]; then - # gzip -9 all modules to save 100MB of space - find "${pkgdir}" -name '*.ko' |xargs -P 2 -n 1 gzip -9 - fi # make room for external modules ln -s "../extramodules-${_basekernel}${_kernelname}" "${pkgdir}/lib/modules/${_kernver}/extramodules" # add real version for building modules and running depmod from post_install/upgrade @@ -255,7 +238,7 @@ _package() { mkdir -p "${pkgdir}/usr" mv "${pkgdir}/lib" "${pkgdir}/usr/" - if [ "$CARCH" != "armv7h" ]; then + if [ "${CARCH}" = "x86_64" ] || [ "${CARCH}" = "i686" ]; then # add vmlinux install -D -m644 vmlinux "${pkgdir}/usr/lib/modules/${_kernver}/build/vmlinux" fi @@ -287,7 +270,7 @@ _package-headers() { # copy arch includes for external modules mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}" cp -a arch/${KARCH}/include "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/" - if [ "$CARCH" = "armv7h" ]; then + if [ "${CARCH}" = "armv7h" ]; then mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/mach-omap2" cp -a arch/${KARCH}/mach-omap2/include "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/mach-omap2/" mkdir -p "${pkgdir}/usr/lib/modules/${_kernver}/build/arch/${KARCH}/mach-mvebu" |