← Back to team overview

curtin-dev team mailing list archive

[Merge] ~mwhudson/curtin:quick_zero-wipefs into curtin:master

 

Michael Hudson-Doyle has proposed merging ~mwhudson/curtin:quick_zero-wipefs into curtin:master.

Commit message:
call wipefs -a -f in addition to zeroing in quick_zero

LP: #1997920



Requested reviews:
  curtin developers (curtin-dev)
Related bugs:
  Bug #1997920 in curtin: "block.quick_zero not always sufficient to remove luks headers"
  https://bugs.launchpad.net/curtin/+bug/1997920

For more details, see:
https://code.launchpad.net/~mwhudson/curtin/+git/curtin/+merge/433621
-- 
Your team curtin developers is requested to review the proposed merge of ~mwhudson/curtin:quick_zero-wipefs into curtin:master.
diff --git a/curtin/block/__init__.py b/curtin/block/__init__.py
index a46c8ec..1f9bb60 100644
--- a/curtin/block/__init__.py
+++ b/curtin/block/__init__.py
@@ -1207,10 +1207,11 @@ def wipe_file(path, reader=None, buflen=4 * 1024 * 1024, exclusive=True):
 
 def quick_zero(path, partitions=True, exclusive=True):
     """
-    zero 1M at front, 1M at end, and 1M at front
+    call wipefs -a -f on path, then zero 1M at front, 1M at end
     if this is a block device and partitions is true, then
     zero 1M at front and end of each partition.
     """
+    util.subp(['wipefs', '--all', '--force', path])
     buflen = 1024
     count = 1024
     zero_size = buflen * count

Follow ups