Include mdadm configuration in the upgrade initramfs#1095
Include mdadm configuration in the upgrade initramfs#1095matejmatuska wants to merge 2 commits intooamg:mainfrom
Conversation
The scanfilesfortargetuserspace actor is generalized to allow copying directories in addition to regular files. Also fallback files/directories to copy in case the original file doesn't exist can be specified.
Currently, the mdadm configuration (/etc/mdadm.conf and the alternative location and config dirs, see man mdadm.conf#Files) is explicitly set to not be included in upgrade initramfs (via --nomdadmconf dracut option). However, this might cause errors when there are md raid devices on the system. The configuration files should be compatible between RHEL 7, 8, 9. For example, if md array locations are used in fstab instead of UUIDs: $ cat /etc/mdadm.conf ARRAY /dev/md/boot level=raid1 num-devices=2 UUID=531cea9d:bcb23190:ef4a0f87:65bf90d7 ARRAY /dev/md/root level=raid1 num-devices=2 UUID=4d920d36:ac04845a:2f67ffd8:a6f7a521 $ cat /etc/fstab /dev/md/root / xfs defaults 0 0 /dev/md/boot /boot xfs defaults 0 0 In this case /boot and / can't be properly mounted, because their location is specified in mdadm.conf. Inclusion of mdadm.conf in the upgrade initramfs should fix such problems. The file existence check in the target userspace is performed by dracut. Without the --mdadmconf flag the file wouldn't be included at all since the upgrade initramfs is --nohostonly.
Thank you for contributing to the Leapp project!Please note that every PR needs to comply with the Leapp Guidelines and must pass all tests in order to be mergeable.
Packit will automatically schedule regression tests for this PR's build and latest upstream leapp build. If you need a different version of leapp from PR#42, use To launch regression testing public members of oamg organization can leave the following comment:
Please open ticket in case you experience technical problem with the CI. (RH internal only) Note: In case there are problems with tests not being triggered automatically on new PR/commit or pending for a long time, please contact leapp-infra. |
Currently, the mdadm configuration (
/etc/mdadm.confand the alternativelocation and config dirs, see
man mdadm.conf#Files) is explicitly set to notbe included in upgrade initramfs (via
--nomdadmconfdracut option).However, this might cause errors when there are md raid devices on the
system.
The configuration files should be compatible between RHEL 7, 8, 9.
For example, if md array locations are used in fstab instead of UUIDs:
In this case
/bootand/can't be properly mounted, because theirlocation is specified in
mdadm.conf.Inclusion of
mdadm.confin the upgrade initramfs should fix such problems.The file existence check in the target userspace is performed by dracut.
Without the
--mdadmconfflag the file wouldn't be included at all sincethe upgrade initramfs is
--nohostonly.