Skip to content

Commit

Permalink
do not record install media as directly formatted
Browse files Browse the repository at this point in the history
instead prefer to record the partition as such (as casper does)
  • Loading branch information
mwhudson committed Jul 19, 2023
1 parent a8d680e commit 37a4a76
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions subiquity/models/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -1274,6 +1274,23 @@ def process_probe_data(self):
o._is_in_use = True
work.extend(reverse_dependencies(o))

# This is a special hack for the install media. When written to a USB
# stick or similar, both the block device for the whole drive and for
# the partition will show up as having a filesystem. Casper should
# preferentially mount it as a partition though and if it looks like
# that has happened, we ignore the filesystem on the drive itself.
for disk in self._all(type='disk'):
if disk._fs is None:
continue
if not disk._partitions:
continue
p1 = disk._partitions[0]
if p1._fs is None:
continue
if disk._fs.fstype == p1._fs.fstype == 'iso9660':
if p1._is_in_use and not disk._is_in_use:
self.remove_filesystem(disk._fs)

for o in self._actions:
if o.type == "partition" and o.flag == "swap":
if o._fs is None:
Expand Down

0 comments on commit 37a4a76

Please sign in to comment.