kernel-install: fix BLS-related decision logic
In the commit 63205a4dc4c400f75571869d87682c0cdb475830, there was introduced a change in the decision logic of the 20-zipl-kernel.install script. Specifically, whether the Boot Loader Specification (BLS) is used. Instead of just checking the existence of the /sbin/new-kernel-pkg file, the existence of the /boot/loader/entries directory is also checked. More thorough testing revealed that the above commit covers only the case when a new kernel is added. However, the remaining cases should also be covered. That means the case when a rescue kernel is added and the case when some kernel is removed. Resolves: #1778243 Fixes: #1755899 Signed-off-by: Jan Hlavac <jhlavac@redhat.com>
This commit is contained in:
parent
b3e6ad36b4
commit
e0e6dde32f
@ -74,7 +74,7 @@ case "$COMMAND" in
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -f /sbin/new-kernel-pkg || -d "$BLS_DIR" ]]; then
|
if [[ ! -f /sbin/new-kernel-pkg || -d "${BLS_DIR}" ]]; then
|
||||||
declare -a BOOT_OPTIONS
|
declare -a BOOT_OPTIONS
|
||||||
if [[ -f /etc/kernel/cmdline ]]; then
|
if [[ -f /etc/kernel/cmdline ]]; then
|
||||||
read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
|
read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
|
||||||
@ -146,7 +146,7 @@ case "$COMMAND" in
|
|||||||
exit 77
|
exit 77
|
||||||
;;
|
;;
|
||||||
remove)
|
remove)
|
||||||
if [[ ! -f /sbin/new-kernel-pkg ]]; then
|
if [[ ! -f /sbin/new-kernel-pkg || -d "${BLS_DIR}" ]]; then
|
||||||
ARCH="$(uname -m)"
|
ARCH="$(uname -m)"
|
||||||
BLS_TARGET="${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf"
|
BLS_TARGET="${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf"
|
||||||
BLS_DEBUG="$(echo ${BLS_TARGET} | sed -e "s/${KERNEL_VERSION}/${KERNEL_VERSION}~debug/")"
|
BLS_DEBUG="$(echo ${BLS_TARGET} | sed -e "s/${KERNEL_VERSION}/${KERNEL_VERSION}~debug/")"
|
||||||
|
@ -15,7 +15,7 @@ BLS_DIR="/boot/loader/entries"
|
|||||||
[[ "$KERNEL_VERSION" == *\+* ]] && flavor=-"${KERNEL_VERSION##*+}"
|
[[ "$KERNEL_VERSION" == *\+* ]] && flavor=-"${KERNEL_VERSION##*+}"
|
||||||
case "$COMMAND" in
|
case "$COMMAND" in
|
||||||
add)
|
add)
|
||||||
if [[ ! -f /sbin/new-kernel-pkg ]]; then
|
if [[ ! -f /sbin/new-kernel-pkg || -d "${BLS_DIR}" ]]; then
|
||||||
declare -a BOOT_OPTIONS
|
declare -a BOOT_OPTIONS
|
||||||
if [[ -f /etc/kernel/cmdline ]]; then
|
if [[ -f /etc/kernel/cmdline ]]; then
|
||||||
read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
|
read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
|
||||||
|
Loading…
Reference in New Issue
Block a user