]> git.ipfire.org Git - thirdparty/dracut.git/commit
fix(dracut-functions.sh): suppress findmnt error msg if /etc/fstab not exist
authorTao Liu <ltao@redhat.com>
Thu, 3 Nov 2022 09:21:25 +0000 (17:21 +0800)
committerAntonio Álvarez Feijoo <antonio.feijoo@suse.com>
Fri, 4 Nov 2022 07:09:30 +0000 (08:09 +0100)
commite9ed44c8864445d85018e31064cd888c358f1daf
tree46320da031beacbeea4c9f95bb9c1eea52fca48d
parent6b592f581c1a5ec489acee95779867e0485770fd
fix(dracut-functions.sh): suppress findmnt error msg if /etc/fstab not exist

When the rootfs of a virtual machine is virtiofs shared folder,
the /etc/fstab file may not exist. As a result, the "findmnt --fstab"
will complain "findmnt: can't read (null): No such file or directory"
when trying to rebuild kdump initramfs within the vm.

This patch checks if /etc/fstab exist before calling "findmnt --fstab"
to suppress the error message.

Before:
$ kdumpctl rebuild
kdump: Rebuilding /boot/initramfs-5.14.0-182.el9.x86_64kdump.img
findmnt: can't read (null): No such file or directory
findmnt: can't read (null): No such file or directory
findmnt: can't read (null): No such file or directory

After:
$ kdumpctl rebuild
kdump: Rebuilding /boot/initramfs-5.14.0-182.el9.x86_64kdump.img

Signed-off-by: Tao Liu <ltao@redhat.com>
dracut-functions.sh