Handle legacy swap parts
From the discord, unfortunately no full trace-back or log file.
Steps to reproduce are simple:
- Install a first time with legacy swap partition (not zram)
- Open the installer again (
[SWAP]shows as mountpoint which is fromlsblkinfo methods) - Display bug + mounting should/will fail
Probably we need
- Filter
[SWAP]when parsing lsblk output inLsblkInfo - Handle unmount for swap using
swapoff - Helper for
swapoffsimilar toswapon
I can take a look at this.
Confirmed reproducible on current master: lsblk reports [SWAP] in both mountpoint and mountpoints for an active swap partition, and LsblkInfo parses that straight into a Path. So umount() sees a non-empty mountpoints list, skips its early return, and runs umount -R '[SWAP]' instead of swapoff, which is also how [SWAP] ends up displayed as a mountpoint.
Noting overlap so I'm not duplicating: #4536 adds a private _swapoff_path() in disk/utils.py, but for post-install teardown of the layout archinstall just created rather than pre-existing swap discovered by lsblk, and it doesn't touch the parsing side. If a helper is needed here I'll make it a public one next to swapon() so that PR can reuse it rather than us ending up with two.
I'll work on a scoped fix with regression coverage.
I kind of gave up of on tear-down so feel free to take both (in seperate PRs) :D
As to:
which is also how [SWAP] ends up displayed as a mountpoint.
Believe it could simply be skipped