Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partition: Mask DM/LVM rules, don't stop udev #106

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/main/perl/Partition.pm
Original file line number Diff line number Diff line change
Expand Up @@ -625,10 +625,9 @@ sub create_pre_ks
# make sure this never matches on anything else
$extended_txt .= "_no_msdos_label" if ($self->{holding_dev}->{label} ne MSDOS);

# Avoid LVM/mdadm/etc. autodiscovery kicking in after the partition has
# been created
my $pause_udev = $self->{anaconda_version} >= ANACONDA_VERSION_EL_7_0 ? "udevadm control --stop-exec-queue" : "";
my $unpause_udev = $self->{anaconda_version} >= ANACONDA_VERSION_EL_7_0 ? "udevadm control --start-exec-queue" : "";
# Avoid LVM/mdadm/etc. autodiscovery kicking in after the partition has been created
my $mask_udev_rules = $self->{anaconda_version} >= ANACONDA_VERSION_EL_7_0 ? "find /usr/lib/udev/rules.d/ -type f -name \*.rules | grep -E '(dm|lvm)' | xargs basename -a | xargs -I@ touch /etc/udev/rules.d/@" : "";
my $unmask_udev_rules = $self->{anaconda_version} >= ANACONDA_VERSION_EL_7_0 ? "rm -f /etc/udev/rules.d/*.rules" : "";

print <<EOF;
if ! grep -q '$self->{devname}\$' /proc/partitions
Expand Down Expand Up @@ -676,7 +675,7 @@ EOF
}
print <<EOF;
$end_txt
$pause_udev
$mask_udev_rules
parted $disk -s -- u s mkpart $self->{type} \$begin \$end
while true; do
sleep 1
Expand All @@ -692,7 +691,7 @@ EOF
}

print <<EOF;
$unpause_udev
$unmask_udev_rules
udevadm settle
EOF

Expand Down
Loading