Loading 50-mkinitcpio-compat.install 0 → 100644 +22 −0 Original line number Diff line number Diff line #!/bin/bash # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # ex: ts=8 sw=4 sts=4 et filetype=sh COMMAND="$1" KERNEL_VERSION="$2" #BOOT_DIR_ABS="$3" #KERNEL_IMAGE="$4" INITRD="/boot/initramfs-$KERNEL_VERSION.img" INITRD_FALLBACK="/boot/initramfs-$KERNEL_VERSION-fallback.img" case $COMMAND in add) mkinitcpio -g "$INITRD" -k "$KERNEL_VERSION" #mkinitcpio -g "$INITRD_FALLBACK" -k "$KERNEL_VERSION" -S autodetect ;; remove) rm -f "$INITRD" rm -f "$INITRD_FALLBACK" ;; esac exit 0 90-loaderentry-compat.install 0 → 100644 +16 −0 Original line number Diff line number Diff line #!/bin/bash # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # ex: ts=8 sw=4 sts=4 et filetype=sh COMMAND="$1" KERNEL_VERSION="$2" #BOOT_DIR_ABS="$3" KERNEL_IMAGE="$4" KERNEL_DEST="/boot/vmlinuz-$KERNEL_VERSION" case $COMMAND in add) cp "$KERNEL_IMAGE" "$KERNEL_DEST";; remove) rm -f "$KERNEL_DEST";; esac exit 0 95-grub-update.install 0 → 100644 +15 −0 Original line number Diff line number Diff line #!/bin/bash # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # ex: ts=8 sw=4 sts=4 et filetype=sh [[ -d /boot/grub ]] || exit 0 type -P grub-mkconfig >/dev/null || exit 0 case $1 in add|remove) grub-mkconfig -o /boot/grub/grub.cfg ;; esac exit 0 PKGBUILD 0 → 100644 +56 −0 Original line number Diff line number Diff line # Maintainer: Sébastien Luttringer <seblu@seblu.net> pkgname=(kernel-install-hook kernel-install-compat kernel-install-grub) pkgver=2016.02.21 pkgrel=1 arch=('any') url='https://seblu.net' license=('GPL2') source=('hook.sh' 'hook.install' 'hook.remove' '50-mkinitcpio-compat.install' '90-loaderentry-compat.install' '95-grub-update.install') md5sums=('afd25666d74b00fe6ea3901d37f604cd' '8e60d4df3f8386a8972b5a1b25e1b680' '44a72eae076d1c208ffee49a07ce7e09' '78f5fe7e8881ff261466fb074d1e7c79' '1c1b5ad42ad0a6ccae278c57deb92299' 'cc4481b32207b8f4066971ccdaa20174') package_kernel-install-hook() { pkgdesc='kernel-install hook to run when install/remove kernels' depends=('systemd') optdepends=('kernel-install-compat: Install kernel in /boot' 'kernel-install-grub: Regen grub config') install -dm755 "$pkgdir"/usr/share/libalpm/hooks install -m644 hook.install "$pkgdir"/usr/share/libalpm/hooks/90-kernel-install.hook install -m644 hook.remove "$pkgdir"/usr/share/libalpm/hooks/90-kernel-remove.hook install -Dm755 hook.sh "$pkgdir"/usr/bin/kernel-install-hook } package_kernel-install-compat() { pkgdesc='override default kernel-install script to gen arch compatible kernel and initramfs' depends=('kernel-install-hook') # disable arch default install -dm755 $_f "$pkgdir/etc/kernel/install.d" ln -s /dev/null "$pkgdir/etc/kernel/install.d/90-loaderentry.install" ln -s /dev/null "$pkgdir/etc/kernel/install.d/50-mkinitcpio.install" install -Dm755 50-mkinitcpio-compat.install \ "$pkgdir/usr/lib/kernel/install.d/50-mkinitcpio-compat.install" install -Dm755 90-loaderentry-compat.install \ "$pkgdir/usr/lib/kernel/install.d/90-loaderentry-compat.install" } package_kernel-install-grub() { pkgdesc='kernel-install script to regen grub config' depends=('kernel-install-hook') install -Dm755 95-grub-update.install \ "$pkgdir/usr/lib/kernel/install.d/95-grub-update.install" } # vim:set ts=2 sw=2 et: hook.install 0 → 100644 +12 −0 Original line number Diff line number Diff line [Trigger] Operation = Install Operation = Upgrade Type = File Target = usr/lib/kernel/vmlinuz-* [Action] Description = kernel-install add Depends = systemd When = PostTransaction Exec = /usr/bin/kernel-install-hook add NeedsTargets Loading
50-mkinitcpio-compat.install 0 → 100644 +22 −0 Original line number Diff line number Diff line #!/bin/bash # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # ex: ts=8 sw=4 sts=4 et filetype=sh COMMAND="$1" KERNEL_VERSION="$2" #BOOT_DIR_ABS="$3" #KERNEL_IMAGE="$4" INITRD="/boot/initramfs-$KERNEL_VERSION.img" INITRD_FALLBACK="/boot/initramfs-$KERNEL_VERSION-fallback.img" case $COMMAND in add) mkinitcpio -g "$INITRD" -k "$KERNEL_VERSION" #mkinitcpio -g "$INITRD_FALLBACK" -k "$KERNEL_VERSION" -S autodetect ;; remove) rm -f "$INITRD" rm -f "$INITRD_FALLBACK" ;; esac exit 0
90-loaderentry-compat.install 0 → 100644 +16 −0 Original line number Diff line number Diff line #!/bin/bash # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # ex: ts=8 sw=4 sts=4 et filetype=sh COMMAND="$1" KERNEL_VERSION="$2" #BOOT_DIR_ABS="$3" KERNEL_IMAGE="$4" KERNEL_DEST="/boot/vmlinuz-$KERNEL_VERSION" case $COMMAND in add) cp "$KERNEL_IMAGE" "$KERNEL_DEST";; remove) rm -f "$KERNEL_DEST";; esac exit 0
95-grub-update.install 0 → 100644 +15 −0 Original line number Diff line number Diff line #!/bin/bash # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # ex: ts=8 sw=4 sts=4 et filetype=sh [[ -d /boot/grub ]] || exit 0 type -P grub-mkconfig >/dev/null || exit 0 case $1 in add|remove) grub-mkconfig -o /boot/grub/grub.cfg ;; esac exit 0
PKGBUILD 0 → 100644 +56 −0 Original line number Diff line number Diff line # Maintainer: Sébastien Luttringer <seblu@seblu.net> pkgname=(kernel-install-hook kernel-install-compat kernel-install-grub) pkgver=2016.02.21 pkgrel=1 arch=('any') url='https://seblu.net' license=('GPL2') source=('hook.sh' 'hook.install' 'hook.remove' '50-mkinitcpio-compat.install' '90-loaderentry-compat.install' '95-grub-update.install') md5sums=('afd25666d74b00fe6ea3901d37f604cd' '8e60d4df3f8386a8972b5a1b25e1b680' '44a72eae076d1c208ffee49a07ce7e09' '78f5fe7e8881ff261466fb074d1e7c79' '1c1b5ad42ad0a6ccae278c57deb92299' 'cc4481b32207b8f4066971ccdaa20174') package_kernel-install-hook() { pkgdesc='kernel-install hook to run when install/remove kernels' depends=('systemd') optdepends=('kernel-install-compat: Install kernel in /boot' 'kernel-install-grub: Regen grub config') install -dm755 "$pkgdir"/usr/share/libalpm/hooks install -m644 hook.install "$pkgdir"/usr/share/libalpm/hooks/90-kernel-install.hook install -m644 hook.remove "$pkgdir"/usr/share/libalpm/hooks/90-kernel-remove.hook install -Dm755 hook.sh "$pkgdir"/usr/bin/kernel-install-hook } package_kernel-install-compat() { pkgdesc='override default kernel-install script to gen arch compatible kernel and initramfs' depends=('kernel-install-hook') # disable arch default install -dm755 $_f "$pkgdir/etc/kernel/install.d" ln -s /dev/null "$pkgdir/etc/kernel/install.d/90-loaderentry.install" ln -s /dev/null "$pkgdir/etc/kernel/install.d/50-mkinitcpio.install" install -Dm755 50-mkinitcpio-compat.install \ "$pkgdir/usr/lib/kernel/install.d/50-mkinitcpio-compat.install" install -Dm755 90-loaderentry-compat.install \ "$pkgdir/usr/lib/kernel/install.d/90-loaderentry-compat.install" } package_kernel-install-grub() { pkgdesc='kernel-install script to regen grub config' depends=('kernel-install-hook') install -Dm755 95-grub-update.install \ "$pkgdir/usr/lib/kernel/install.d/95-grub-update.install" } # vim:set ts=2 sw=2 et:
hook.install 0 → 100644 +12 −0 Original line number Diff line number Diff line [Trigger] Operation = Install Operation = Upgrade Type = File Target = usr/lib/kernel/vmlinuz-* [Action] Description = kernel-install add Depends = systemd When = PostTransaction Exec = /usr/bin/kernel-install-hook add NeedsTargets