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

DONTMERGE: Unmerged code required for the c-storage integration in the anaconda-webui (multiple PRs) #5403

Closed

Conversation

KKoukiou
Copy link
Contributor

No description provided.

@pep8speaks
Copy link

pep8speaks commented Jan 15, 2024

Hello @KKoukiou! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2024-02-07 14:42:41 UTC

@github-actions github-actions bot added the f40 label Jan 15, 2024
and root.format.exists
and root.format.mountable
and root.format.mountpoint == "/"
and (root.format.free != root.format.total)):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure this will work, even newly created filesystems are not "empty", for example ext4 reserves 5 % of free space on the filesystem by default so filesystem free space will always be less than filesystem size. This is a freshly created 1 GiB Ext4 with just 973.14 MiB of free blocks:

# dumpe2fs /dev/sdd2
...
Block count:              262144
Reserved block count:     13107
Overhead clusters:        12949
Free blocks:              249125
Free inodes:              65524
First block:              0
Block size:               4096
...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, yes I just wanted to try it out and pushed a PR instead of building locally.

@KKoukiou KKoukiou changed the title Avoid forcing reformat of the root filesystem if the device is empty DONTMERGE: Avoid forcing reformat of the root filesystem if the device is empty Jan 16, 2024
@KKoukiou KKoukiou closed this Jan 18, 2024
@KKoukiou KKoukiou deleted the check-empty-root-force-reformat branch January 18, 2024 08:59
@KKoukiou KKoukiou restored the check-empty-root-force-reformat branch January 31, 2024 13:32
@KKoukiou KKoukiou reopened this Jan 31, 2024
@KKoukiou KKoukiou force-pushed the check-empty-root-force-reformat branch from e8d614d to 9050f22 Compare January 31, 2024 13:34
@KKoukiou KKoukiou force-pushed the check-empty-root-force-reformat branch from 9050f22 to 41c48a3 Compare January 31, 2024 13:40
@KKoukiou KKoukiou changed the title DONTMERGE: Avoid forcing reformat of the root filesystem if the device is empty DONTMERGE: Unmerged code required for the c-storage integration in the anaconda-webui Jan 31, 2024
@KKoukiou KKoukiou changed the title DONTMERGE: Unmerged code required for the c-storage integration in the anaconda-webui DONTMERGE: Unmerged code required for the c-storage integration in the anaconda-webui (multiple PRs) Jan 31, 2024
…e the world

This will make the integration with cockpit-storage more seemless and
less hacky.
@@ -40,7 +40,7 @@ def connect_signals(self):
"AppliedPartitioning", self.implementation.applied_partitioning_changed
)

def ScanDevicesWithTask(self) -> ObjPath:
def ScanDevicesWithTask(self, deep_scan: bool = True) -> ObjPath:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer a new method for this that can be marked as a temporary workaround and eventually dropped.


self.fsset = FSSet(self.devicetree)

# Clear out attributes that refer to devices that are no longer in the tree.
self.bootloader.reset()

self.roots = []
self.roots = find_existing_installations(self.devicetree)
if deep:
self.roots = find_existing_installations(self.devicetree)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I talked to Vojta and we think this can be removed from the reset method. It can be called directly via the FindExistingSystemsWithTask DBus method. We can call it in the reset_storage function by default to handle GUI, TUI and the rescue mode and Web UI can handle this on its own. What do you think?

@@ -266,15 +273,17 @@ def reset(self, cleanup_only=False):

# Protect devices from teardown.
self._mark_protected_devices()
self.devicetree.teardown_all()
if deep:
self.devicetree.teardown_all()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw. we also call teardown_all during the installation, after we unlock a device and after we discover new devices. If I understand it correctly, Anaconda can never tear down any device if Cockpit Storage was used for the partitioning, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that teardown_all should be disabled globally via a flag or something if it is requested. It will be safer, more predictable and cleaner. You can start with using devicetree.teardown_all = lambda: log.debug("Tear down is disabled.") as a temporary workaround for testing.

@KKoukiou KKoukiou closed this Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

4 participants