diff options
Diffstat (limited to '~emulatorman/linux-libre')
-rw-r--r-- | ~emulatorman/linux-libre/PKGBUILD | 75 | ||||
-rwxr-xr-x | ~emulatorman/linux-libre/linux-libre_kernels_aur_version.sh | 2 | ||||
-rw-r--r-- | ~emulatorman/linux-libre/linux.install | 42 |
3 files changed, 45 insertions, 74 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" diff --git a/~emulatorman/linux-libre/linux-libre_kernels_aur_version.sh b/~emulatorman/linux-libre/linux-libre_kernels_aur_version.sh index a4db1583e..2888b1b20 100755 --- a/~emulatorman/linux-libre/linux-libre_kernels_aur_version.sh +++ b/~emulatorman/linux-libre/linux-libre_kernels_aur_version.sh @@ -20,7 +20,7 @@ # You should have received a copy of the GNU General Public License # along with Parabola. If not, see <http://www.gnu.org/licenses/>. -for kernel in libre/linux-libre{,-lts{,-grsec},-grsec,-pck} kernels/linux-libre-{knock,grsec-knock,rt,pae,xen,lts-{knock,grsec-knock}}; do +for kernel in libre/linux-libre{,-lts,-grsec,-pck} kernels/linux-libre-{knock,grsec-knock,rt,pae,xen,lts-knock}; do cd ~/packages/abslibre/$kernel sed -i '\|conflicts=| s|"${_replacesarchkernel\[@][/%a-z-]*}" ||' $(grep -rlI 'conflicts') cd ~/packages/abslibre diff --git a/~emulatorman/linux-libre/linux.install b/~emulatorman/linux-libre/linux.install index 2f90d8bf6..70e177ef2 100644 --- a/~emulatorman/linux-libre/linux.install +++ b/~emulatorman/linux-libre/linux.install @@ -8,42 +8,30 @@ post_install () { # updating module dependencies echo ">>> Updating module dependencies. Please wait ..." depmod ${KERNEL_VERSION} - if [ $(uname -m) != armv7h ]; then - echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..." - mkinitcpio -p linux-libre${KERNEL_NAME} - else - echo "NOTE: Using this kernel requires an updated U-Boot!" - fi + echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..." + mkinitcpio -p linux-libre${KERNEL_NAME} } post_upgrade() { - if [ $(uname -m) != armv7h ]; then - 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 + 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 ${KERNEL_VERSION} - echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..." - mkinitcpio -p linux-libre${KERNEL_NAME} + # updating module dependencies + echo ">>> Updating module dependencies. Please wait ..." + depmod ${KERNEL_VERSION} + echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..." + mkinitcpio -p linux-libre${KERNEL_NAME} - 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 - else - # updating module dependencies - echo ">>> Updating module dependencies. Please wait ..." - depmod ${KERNEL_VERSION} - fi + 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 } -if [ $(uname -m) != armv7h ]; then post_remove() { # also remove the compat symlinks rm -f boot/initramfs-linux-libre${KERNEL_NAME}.img rm -f boot/initramfs-linux-libre${KERNEL_NAME}-fallback.img } -fi |