curtin-dev team mailing list archive
-
curtin-dev team
-
Mailing list archive
-
Message #02144
[Merge] ~mwhudson/curtin:v2-partprobe-argh into curtin:master
Michael Hudson-Doyle has proposed merging ~mwhudson/curtin:v2-partprobe-argh into curtin:master.
Commit message:
block_meta_v2: change how we invoke sfdisk again, restore partprobe call
It's a bit disappointingly empirical but some multipath vmtests fail
with the current sfdisk arguments with "device busy" type errors. I
think this points to a bug somewhere else but the current partition code
works in this situation so massage things so that the new code does too.
Now we pass --no-tell-kernel to sfdisk, we do need to tell the kernel
about the changes so put back a call to partprobe to do this. This is
actually needed independent of the above change, because it seems sfdisk
with default arguments does not cause the kernel to remove the device
node for a deleted partition!
Requested reviews:
curtin developers (curtin-dev)
For more details, see:
https://code.launchpad.net/~mwhudson/curtin/+git/curtin/+merge/415998
--
Your team curtin developers is requested to review the proposed merge of ~mwhudson/curtin:v2-partprobe-argh into curtin:master.
diff --git a/curtin/commands/block_meta_v2.py b/curtin/commands/block_meta_v2.py
index c29f98d..7fd2e25 100644
--- a/curtin/commands/block_meta_v2.py
+++ b/curtin/commands/block_meta_v2.py
@@ -70,15 +70,19 @@ class SFDiskPartTable:
def apply(self, device):
sfdisk_script = self.render()
LOG.debug("sfdisk input:\n---\n%s\n---\n", sfdisk_script)
- util.subp(['sfdisk', device], data=sfdisk_script.encode('ascii'))
- # sfdisk (as invoked here) uses ioctls to inform the kernel that the
- # partition table has changed so it can add and remove device nodes for
- # the partitions as needed. Unfortunately this is asynchronous: sfdisk
- # can exit before the nodes are present in /dev (or /sys for that
- # matter). Calling "udevadm settle" is slightly incoherent as udev has
- # nothing to do with creating these nodes, but at the same time, udev
- # won't finish processing the events triggered by the sfdisk until
- # after the nodes for the partitions have been updated by the kernel.
+ util.subp(
+ ['sfdisk', '--no-tell-kernel', '--no-reread', device],
+ data=sfdisk_script.encode('ascii'))
+ util.subp(['partprobe', device])
+ # sfdisk and partprobe (as invoked here) use ioctls to inform the
+ # kernel that the partition table has changed so it can add and remove
+ # device nodes for the partitions as needed. Unfortunately this is
+ # asynchronous: we can return before the nodes are present in /dev (or
+ # /sys for that matter). Calling "udevadm settle" is slightly
+ # incoherent as udev has nothing to do with creating these nodes, but
+ # at the same time, udev won't finish processing the events triggered
+ # by the sfdisk until after the nodes for the partitions have been
+ # updated by the kernel.
udevadm_settle()
Follow ups