d4d36e6a87
2018-03-06 23:21:31,835 INFO pylorax.dnfhelper: Performing post-installation setup tasks 2018-03-06 23:22:41,901 WARNING pylorax.dnfhelper: Non-fatal POSTTRANS scriptlet failure in rpm package kernel-core warning: %posttrans(kernel-core-4.16.0-0.rc4.git0.1.fc29.x86_6 scriptlet failed, exit status 1 Please specify the kernel command line in /etc/kernel/cmdline! Could not determine the kernel command line parameters /usr/lib/kernel/install.d/90-loaderentry.install: line 53: /proc/cmdline: No such file or directory
52 lines
1.9 KiB
Bash
Executable File
52 lines
1.9 KiB
Bash
Executable File
#!/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
|
|
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
|