From d284da9293a9088cfe4dc0aea2baa220eb590254 Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Sun, 27 Sep 2015 19:20:00 -0300 Subject: remove mkinitcpio support for armv7h kernels --- kernels/linux-libre-grsec-knock/PKGBUILD | 25 +++++++++------- kernels/linux-libre-grsec-knock/linux.install | 42 ++++++++++++++++++--------- 2 files changed, 43 insertions(+), 24 deletions(-) (limited to 'kernels/linux-libre-grsec-knock') diff --git a/kernels/linux-libre-grsec-knock/PKGBUILD b/kernels/linux-libre-grsec-knock/PKGBUILD index 0c58a7edf..f783389c1 100644 --- a/kernels/linux-libre-grsec-knock/PKGBUILD +++ b/kernels/linux-libre-grsec-knock/PKGBUILD @@ -196,7 +196,7 @@ build() { _package() { pkgdesc="The ${pkgbase^} kernel and modules with grsecurity/PaX patches and support for stealth TCP sockets" [ "${pkgbase}" = "linux-libre" ] && groups=('base') - depends=('coreutils' 'linux-libre-firmware' 'kmod' 'grsec-common' 'mkinitcpio>=0.7') + depends=('coreutils' 'linux-libre-firmware' 'kmod' 'grsec-common') optdepends=('crda: to set the correct wireless channels of your country' 'gradm: to configure and enable Role Based Access Control (RBAC)' 'paxd-libre: to enable PaX exploit mitigations and apply exceptions automatically' @@ -206,7 +206,10 @@ _package() { conflicts=("${_replacesarchkernel[@]}" "${_replacesoldkernels[@]}" "${_replacesoldmodules[@]}") replaces=("${_replacesarchkernel[@]}" "${_replacesoldkernels[@]}" "${_replacesoldmodules[@]}") [ "${CARCH}" = "armv7h" ] && conflicts+=("${_replacesarchkernel}-uimage") && replaces+=("${_replacesarchkernel}-uimage") - backup=("etc/mkinitcpio.d/${pkgbase}.preset") + if [ "${CARCH}" = "x86_64" ] || [ "${CARCH}" = "i686" ]; then + depends+=('mkinitcpio>=0.7') + backup=("etc/mkinitcpio.d/${pkgbase}.preset") + fi install=linux.install cd "${srcdir}/${_srcname}" @@ -236,14 +239,16 @@ _package() { -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/" \ -i "${startdir}/${install}" - # 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" + if [ "${CARCH}" = "x86_64" ] || [ "${CARCH}" = "i686" ]; 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 # remove build and source links rm -f "${pkgdir}"/lib/modules/${_kernver}/{source,build} diff --git a/kernels/linux-libre-grsec-knock/linux.install b/kernels/linux-libre-grsec-knock/linux.install index 70e177ef2..3ab31da58 100644 --- a/kernels/linux-libre-grsec-knock/linux.install +++ b/kernels/linux-libre-grsec-knock/linux.install @@ -8,30 +8,44 @@ post_install () { # 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 [ "$(uname -m)" = "armv7h" ]; then + echo ">>> NOTE: Using this kernel requires GRUB!" + echo ">>> See the Migration Guide for instructions:" + echo ">>> https://wiki.parabola.nu/Migration_from_Arch_ARM#GRUB" + elif [ "$(uname -m)" = "x86_64" ] || [ "$(uname -m)" = "i686" ]; then + echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..." + mkinitcpio -p linux-libre${KERNEL_NAME} + fi } 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 + if [ "$(uname -m)" = "armv7h" ]; then + # updating module dependencies + echo ">>> Updating module dependencies. Please wait ..." + depmod ${KERNEL_VERSION} + elif [ "$(uname -m)" = "x86_64" ] || [ "$(uname -m)" = "i686" ]; 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 - # 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." + 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 fi } +if [ "$(uname -m)" = "x86_64" ] || [ "$(uname -m)" = "i686" ]; 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 -- cgit v1.2.3-54-g00ecf