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

Add udev_sync() #2669

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion archinstall/lib/disk/device_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def devices(self) -> List[BDevice]:
def load_devices(self) -> None:
block_devices = {}

SysCommand('udevadm settle')
self.udev_sync()
all_lsblk_info = get_all_lsblk_info()
devices = getAllDevices()

Expand Down Expand Up @@ -784,6 +784,13 @@ def wipe_dev(self, block_device: BDevice) -> None:

self._wipe(block_device.device_info.path)

@staticmethod
def udev_sync() -> None:
try:
SysCommand('udevadm settle')
except SysCallError as err:
debug(f'Failed to synchronize with udev: {err}')


device_handler = DeviceHandler()

Expand Down
3 changes: 1 addition & 2 deletions archinstall/lib/disk/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from ..luks import Luks2
from ..menu import Menu
from ..output import debug, info
from ..general import SysCommand

if TYPE_CHECKING:
_: Any
Expand Down Expand Up @@ -114,7 +113,7 @@ def _format_partitions(
device_handler.format(part_mod.safe_fs_type, part_mod.safe_dev_path)

# synchronize with udev before using lsblk
SysCommand('udevadm settle')
device_handler.udev_sync()

lsblk_info = device_handler.fetch_part_info(part_mod.safe_dev_path)

Expand Down