Skip to content

Commit

Permalink
Merge branch 'topic/hd008085/add-device-mapper-names-to-fstab' into '…
Browse files Browse the repository at this point in the history
…master'

installer: write device mapper path for lvm devices in /etc/fstab

See merge request core-build/photon-os-installer!107
  • Loading branch information
Oliver Kurth committed Nov 26, 2024
2 parents 989a44e + 3c04afd commit 0fc8449
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion photon_installer/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1081,13 +1081,16 @@ def _create_fstab(self, fstab_path=None):
else:
mountpoint = partition['mountpoint']

# If LVM use device mapper path
# Use PARTUUID/UUID instead of bare path.
# Prefer PARTUUID over UUID as it is supported by kernel
# and UUID only by initrd.
path = partition['path']
mnt_src = None
partuuid = self._get_partuuid(path)
if partuuid != '':
if ptype == PartitionType.LVM:
mnt_src = partition['path']
elif partuuid != '':
mnt_src = f"PARTUUID={partuuid}"
else:
uuid = self._get_uuid(path)
Expand Down

0 comments on commit 0fc8449

Please sign in to comment.