Repository navigation
Conversation
When using manual partitioning without wiping the whole disk, deleting an existing partition marks it with ModificationStatus.DELETE while keeping its previous dev_path. Because PartitionModification.exists() only checks for ModificationStatus.EXIST, [p for p in partitions if not p.exists()] also includes deleted partitions. After disk.commit() removes the deleted partition's device node, the signature-wipe loop in DeviceHandler.partition() attempted to run 'wipefs --all' against the removed device node, crashing the installer with a SysCallError. Similarly, FilesystemHandler._encrypt_partitions() and select_partitions_to_encrypt() used 'not p.exists()' instead of 'p.is_create_or_modify()', and _encrypt_partitions() re-initialized enc_mods inside the device_modifications loop. Filter for is_create_or_modify() when wiping signatures, validating/ encrypting partitions, and selecting partitions to encrypt, and preserve enc_mods across device modifications. Fixes archlinux#4849
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Description:
When using manual partitioning without wiping the whole disk (
wipe=False), deleting an existing partition sets its status toModificationStatus.DELETEwhile retaining itsdev_path. BecausePartitionModification.exists()only checksstatus == ModificationStatus.EXIST, filtering with[p for p in modification.partitions if not p.exists()]also includesDELETEentries.After
disk.commit()removes the deleted partition's device node, the signature-wipe loop inDeviceHandler.partition()ranwipefs --allagainst the removed device node, crashing the installation withSysCallError.Similarly,
FilesystemHandler._encrypt_partitions()andselect_partitions_to_encrypt()filtered withnot p.exists()instead ofp.is_create_or_modify(), and_encrypt_partitions()resetenc_mods = {}inside thedevice_modificationsloop.This PR:
part_mod.is_create_or_modify()before runningwipefs --allinDeviceHandler.partition().p.is_create_or_modify()inFilesystemHandler._encrypt_partitions()(matching_format_partitions()) andselect_partitions_to_encrypt().enc_mods = {}reset inside thedevice_modificationsloop in_encrypt_partitions().tests/test_disk_partitioning.py.Fixes #4849
Tests and Checks