-
Notifications
You must be signed in to change notification settings - Fork 159
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
When changing format of a new partition, don't require wipe #2148
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Olivier Gayot <[email protected]>
if data.partition.format is not None: | ||
if data.partition.format != partition.original_fstype(): | ||
if data.partition.wipe is None: | ||
raise ValueError("changing partition format requires a wipe value") | ||
if data.partition.wipe is None and partition.preserve: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we check the value of preserve
at the FS level (which may or may not exist) ? This is what we do to label "to be reformatted as ...." and "to be formatted as ....".
subiquity/subiquity/common/filesystem/labels.py
Lines 228 to 235 in ad2dd0a
fs = device.fs() | |
if fs is not None: | |
if fs.preserve: | |
format_desc = _("already formatted as {fstype}") | |
elif device.original_fstype() is not None: | |
format_desc = _("to be reformatted as {fstype}") | |
else: | |
format_desc = _("to be formatted as {fstype}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dbungert do you know? i.e., the difference between partition.preserve and partition.fs.preserve?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will defer to the curtin documentation on this one. https://curtin.readthedocs.io/en/latest/topics/storage.html
From a label standpoint this is a very subtle difference.
When dealing with a new partition, changing the format from e.g. ext4 to unformatted should not require a wipe value. There is nothing yet to wipe. OTOH it is still necessary for existing partitions. Signed-off-by: Olivier Gayot <[email protected]>
646207f
to
60693ec
Compare
LP:#2097621