What about the following:
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index c319fc2..08b5639 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -1013,7 +1013,9 @@ kdump_install_systemd_conf() {
remove_cpu_online_rule() {
local file=${initdir}/usr/lib/udev/rules.d/40-redhat.rules
- sed -i '/SUBSYSTEM=="cpu"/d' "$file"
+ if [[ -f $file ]]; then
+ sed -i '/SUBSYSTEM=="cpu"/d' "$file"
+ fi
}
Thanks
On Thu, Jul 14, 2022 at 10:25 AM Baoquan He <bhe(a)redhat.com> wrote:
On 07/14/22 at 10:08am, Pingfan Liu wrote:
> Hi Baoquan,
>
> Please see the comments inline.
>
> On Thu, Jul 14, 2022 at 9:16 AM Baoquan He <bhe(a)redhat.com> wrote:
> >
> > Resolves: bz2106645
> >
> > This reverts commit 163c02970e4ddcf238b2ac09eadf380744e01ba2.
> >
> > The code of commit 163c02970e4ddc takes effect in rhel firstly, later
> > pulled to Fedora. However, Fedora OS doesn't have 40-redhat.rules
> > in systemd-udev package. With this commit applied, a warning message
>
> Let's say RHEL-10 forked from Fedora, then RHEL-10 will miss this patch.
> So, any better solution?
Commenting out the function invocation works for you? In RHEL0, we just
revert the commenting commit manually.
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index c319fc2db7aa..517882d3ba3c 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -1030,7 +1030,7 @@ install() {
# the cpu online rule in kdump initramfs.
arch=$(uname -m)
if [[ "$arch" = "ppc64le" ]] || [[ "$arch" =
"ppc64" ]]; then
- remove_cpu_online_rule
+ # remove_cpu_online_rule
fi
if is_ssh_dump_target; then
>
> Thanks,
> PIngfan
>
> > can always been seen as below. So reverting commit 163c02970e4ddc
> > to remove the unnecessary warning message.
> >
> > [root@ ~]# kdumpctl restart
> > kdump: kexec: unloaded kdump kernel
> > kdump: Stopping kdump: [OK]
> > kdump: No kdump initial ramdisk found.
> > kdump: Rebuilding /boot/initramfs-5.19.0-rc6+kdump.img
> > sed: can't read
/var/tmp/dracut.NnAV2g/initramfs/usr/lib/udev/rules.d/40-redhat.rules: No such file or
directory
> > kdump: kexec: loaded kdump kernel
> > kdump: Starting kdump: [OK]
> >
> > Signed-off-by: Baoquan He <bhe(a)redhat.com>
> > ---
> > dracut-module-setup.sh | 18 ------------------
> > 1 file changed, 18 deletions(-)
> >
> > diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
> > index c319fc2db7aa..1ea0d9596f9c 100755
> > --- a/dracut-module-setup.sh
> > +++ b/dracut-module-setup.sh
> > @@ -1010,29 +1010,11 @@ 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
> > --
> > 2.34.1
> >
>