ppc64/ppc64le: drop cpu online rule in 40-redhat.rules in kdump initramfs

Resolves: bz2023165
Upstream: Fedora
Conflict: None

commit a3c1e70fc1c0e4bab4149f617cbd629e89bd5ca0 (HEAD -> main)
Author: Pingfan Liu <piliu@redhat.com>
Date:   Wed Dec 8 10:46:38 2021 +0800

    ppc64/ppc64le: drop cpu online rule in 40-redhat.rules in kdump initramfs

    Onlining secondary cpus breaks kdump completely on KVM on Power hosts
    Though we use maxcpus=1 by default but 40-redhat.rules will bring up all
    possible cpus by default.

    Thus before we get the kernel fix and the systemd rule fix let's remove
    the cpu rule in 40-redhat.rules for ppc64/ppc64le kdump initramfs.

    This is back ported from RHEL, and original credit goes to Dave Young
    <dyoung@redhat.com>

    Signed-off-by: Pingfan Liu <piliu@redhat.com>

Signed-off-by: Pingfan Liu <piliu@redhat.com>
This commit is contained in:
Pingfan Liu 2021-12-29 11:21:42 +08:00
parent 9fd4d2a0c6
commit 5ac720fc20
1 changed files with 18 additions and 0 deletions

View File

@ -1010,11 +1010,29 @@ kdump_install_systemd_conf() {
echo "ForwardToConsole=yes" >> "${initdir}/etc/systemd/journald.conf.d/kdump.conf"
}
remove_cpu_online_rule() {
local file=${initdir}/usr/lib/udev/rules.d/40-redhat.rules
sed -i '/SUBSYSTEM=="cpu"/d' "$file"
}
install() {
local arch
kdump_module_init
kdump_install_conf
remove_sysctl_conf
# Onlining secondary cpus breaks kdump completely on KVM on Power hosts
# Though we use maxcpus=1 by default but 40-redhat.rules will bring up all
# possible cpus by default. (rhbz1270174 rhbz1266322)
# Thus before we get the kernel fix and the systemd rule fix let's remove
# the cpu online rule in kdump initramfs.
arch=$(uname -m)
if [[ "$arch" = "ppc64le" ]] || [[ "$arch" = "ppc64" ]]; then
remove_cpu_online_rule
fi
if is_ssh_dump_target; then
kdump_install_random_seed
fi