Skip to content

Commit

Permalink
Fix _add_efistub_bootloader() partition number with partn (#2084)
Browse files Browse the repository at this point in the history
  • Loading branch information
codefiles authored Sep 21, 2023
1 parent c75ae97 commit 6d908e8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
7 changes: 6 additions & 1 deletion archinstall/lib/disk/device_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ def format(

lsblk_info = self._fetch_part_info(part_mod.safe_dev_path)

part_mod.partn = lsblk_info.partn
part_mod.partuuid = lsblk_info.partuuid
part_mod.uuid = lsblk_info.uuid

Expand Down Expand Up @@ -371,7 +372,7 @@ def _fetch_part_info(self, path: Path) -> LsblkInfo:
time.sleep(attempt_nr + 1)
lsblk_info = get_lsblk_info(path)

if lsblk_info.partuuid and lsblk_info.uuid:
if lsblk_info.partn and lsblk_info.partuuid and lsblk_info.uuid:
break

self.partprobe(path)
Expand All @@ -380,6 +381,10 @@ def _fetch_part_info(self, path: Path) -> LsblkInfo:
debug(f'Unable to get partition information: {path}')
raise DiskError(f'Unable to get partition information: {path}')

if not lsblk_info.partn:
debug(f'Unable to determine new partition number: {path}\n{lsblk_info}')
raise DiskError(f'Unable to determine new partition number: {path}')

if not lsblk_info.partuuid:
debug(f'Unable to determine new partition uuid: {path}\n{lsblk_info}')
raise DiskError(f'Unable to determine new partition uuid: {path}')
Expand Down
3 changes: 3 additions & 0 deletions archinstall/lib/disk/device_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@ class PartitionModification:

# only set if the device was created or exists
dev_path: Optional[Path] = None
partn: Optional[int] = None
partuuid: Optional[str] = None
uuid: Optional[str] = None

Expand Down Expand Up @@ -933,6 +934,7 @@ class LsblkInfo:
ptuuid: str = ''
rota: bool = False
tran: Optional[str] = None
partn: Optional[int] = None
partuuid: Optional[str] = None
parttype :Optional[str] = None
uuid: Optional[str] = None
Expand All @@ -957,6 +959,7 @@ def json(self) -> Dict[str, Any]:
'ptuuid': self.ptuuid,
'rota': self.rota,
'tran': self.tran,
'partn': self.partn,
'partuuid': self.partuuid,
'parttype' : self.parttype,
'uuid': self.uuid,
Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,7 @@ def _add_efistub_bootloader(

cmd = f'efibootmgr ' \
f'--disk {parent_dev_path} ' \
f'--part {boot_partition.safe_dev_path} ' \
f'--part {boot_partition.partn} ' \
f'--create ' \
f'--label "{label}" ' \
f'--loader {loader} ' \
Expand Down

0 comments on commit 6d908e8

Please sign in to comment.