Skip to content

Commit

Permalink
Special handling of uuids and labels during installation
Browse files Browse the repository at this point in the history
  • Loading branch information
mchf committed Oct 13, 2021
1 parent da69349 commit 002036d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/lib/bootloader/device_path.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,31 @@ def exists?
# particular byte sequence is valid or not
return true if Mode.config

# uuids are generated later by mkfs, so not known in time of installation
# so whatever can be true
return true if Mode.installation && (uuid? || label?)

File.exists?(path)
end

alias_method :valid? :exists?
alias_method :valid?, :exists?

private

def dev_by_uuid?(dev)
dev =~ /UUID=".+"/
end

def uuid?
path =~ /by-uuid/
end

def dev_by_label?(dev)
dev =~ /LABEL=".+"/
end

def label?
path =~ /by-label/
end
end
end

0 comments on commit 002036d

Please sign in to comment.