Skip to content

Commit

Permalink
executed blkid only if needed
Browse files Browse the repository at this point in the history
we always need uuid of the file system
partuuid could also be obtained always, even for msdos disk labels
  • Loading branch information
Mrfai committed Jun 27, 2021
1 parent 4c8a2a4 commit 93caec7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/setup-storage/Fstab.pm
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,15 @@ sub get_fstab_key {
# get the label -- this is likely empty; exit code 3 if no label, but that is
# ok here
my @label = ();
&FAI::execute_ro_command(
($key_type eq "label") && &FAI::execute_ro_command(
"/sbin/blkid -c /dev/null -s LABEL -o value $device_name", \@label, 0);

my @ptlabel = ();
&FAI::execute_ro_command(
($key_type eq "partlabel") && &FAI::execute_ro_command(
"/sbin/blkid -c /dev/null -s PARTLABEL -o value $device_name", \@ptlabel, 0);

my @ptuuid = ();
&FAI::execute_ro_command(
($key_type eq "partuuid") && &FAI::execute_ro_command(
"/sbin/blkid -c /dev/null -s PARTUUID -o value $device_name", \@ptuuid, 0);

# print uuid and label to console
Expand Down

0 comments on commit 93caec7

Please sign in to comment.