PHP 7.4.33
Preview: 20-grubby.install Size: 2.20 KB
/home/godevadmin/public_html/upload_images/home/000~ROOT~000/lib/kernel/install.d/20-grubby.install

#!/bin/bash

if [[ ! -x /sbin/new-kernel-pkg ]]; then
    exit 0
fi

COMMAND="$1"
KERNEL_VERSION="$2"
BOOT_DIR_ABS="$3"
KERNEL_IMAGE="$4"

KERNEL_DIR="${KERNEL_IMAGE%/*}"
[[ "$KERNEL_VERSION" == *\+* ]] && flavor=-"${KERNEL_VERSION##*+}"
case "$COMMAND" in
    add)
        if [[ "${KERNEL_DIR}" != "/boot" ]]; then
            for i in \
                "$KERNEL_IMAGE" \
                    "$KERNEL_DIR"/System.map \
                    "$KERNEL_DIR"/config \
                    "$KERNEL_DIR"/zImage.stub \
                    "$KERNEL_DIR"/dtb \
                ; do
                [[ -e "$i" ]] || continue
                cp -aT "$i" "/boot/${i##*/}-${KERNEL_VERSION}"
                command -v restorecon &>/dev/null && \
                    restorecon -R "/boot/${i##*/}-${KERNEL_VERSION}"
            done
            # hmac is .vmlinuz-<version>.hmac so needs a special treatment
            i="$KERNEL_DIR/.${KERNEL_IMAGE##*/}.hmac"
            if [[ -e "$i" ]]; then
                cp -a "$i" "/boot/.${KERNEL_IMAGE##*/}-${KERNEL_VERSION}.hmac"
                command -v restorecon &>/dev/null && \
                    restorecon "/boot/.${KERNEL_IMAGE##*/}-${KERNEL_VERSION}.hmac"
            fi
            # symvers is symvers-<version>.gz so needs a special treatment
            i="$KERNEL_DIR/symvers.gz"
            if [[ -e "$i" ]]; then
                cp -a "$i" "/boot/symvers-${KERNEL_VERSION}.gz"
                command -v restorecon &>/dev/null && \
                    restorecon "/boot/symvers-${KERNEL_VERSION}.gz"
            fi
        fi
        /sbin/new-kernel-pkg --package "kernel${flavor}" --install "$KERNEL_VERSION" || exit $?
        /sbin/new-kernel-pkg --package "kernel${flavor}" --mkinitrd --dracut --depmod --update "$KERNEL_VERSION" || exit $?
        /sbin/new-kernel-pkg --package "kernel${flavor}" --rpmposttrans "$KERNEL_VERSION" || exit $?
        ;;
    remove)
        /sbin/new-kernel-pkg --package "kernel${flavor+-$flavor}" --rminitrd --rmmoddep --remove "$KERNEL_VERSION" || exit $?
        ;;
    *)
        ;;
esac

# skip other installation plugins, if we can't find a boot loader spec conforming setup
if ! [[ -d /boot/loader/entries || -L /boot/loader/entries ]]; then
    exit 77
fi

Directory Contents

Dirs: 0 × Files: 9

Name Size Perms Modified Actions
7.28 KB lrwxr-xr-x 2025-06-04 10:39:50
Edit Download
2.20 KB lrwxr-xr-x 2025-04-22 01:58:47
Edit Download
368 B lrwxr-xr-x 2018-06-22 11:11:49
Edit Download
1.62 KB lrwxr-xr-x 2024-04-06 13:22:13
Edit Download
3.26 KB lrwxr-xr-x 2024-04-06 13:22:13
Edit Download
791 B lrwxr-xr-x 2024-09-24 08:36:00
Edit Download
1.93 KB lrwxr-xr-x 2025-04-22 01:57:53
Edit Download
1.37 KB lrwxr-xr-x 2024-02-22 12:23:28
Edit Download
1.03 KB lrwxr-xr-x 2025-06-04 10:39:50
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).