Skip to content

Commit

Permalink
virt-make-fs: Add --label option for setting filesystem label.
Browse files Browse the repository at this point in the history
$ ./run ./tools/virt-make-fs /tmp/supermin-4.1.4.tar.gz /tmp/test.img
$ ./run ./cat/virt-filesystems -a /tmp/test.img --all --long -h
Name      Type        VFS   Label  MBR  Size  Parent
/dev/sda  filesystem  ext2  -      -    3.7M  -
/dev/sda  device      -     -      -    3.7M  -

$ ./run ./tools/virt-make-fs /tmp/supermin-4.1.4.tar.gz /tmp/test.img --label=BOOT
$ ./run ./cat/virt-filesystems -a /tmp/test.img --all --long -h
Name      Type        VFS   Label  MBR  Size  Parent
/dev/sda  filesystem  ext2  BOOT   -    3.7M  -
/dev/sda  device      -     -      -    3.7M  -

Thanks: Gerd Hoffmann (kraxel)
  • Loading branch information
rwmjones committed Aug 29, 2013
1 parent c46e41c commit e17cd73
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tools/virt-make-fs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,14 @@ here.
=cut

my $label;

=item B<--label=E<lt>LABELE<gt>>
Set the filesystem label.
=cut

my $partition;

=item B<--partition>
Expand Down Expand Up @@ -292,6 +300,7 @@ GetOptions ("help|?" => \$help,
"s|size=s" => \$size,
"F|format=s" => \$format,
"t|type=s" => \$type,
"label=s" => \$label,
"partition:s" => \$partition,
) or pod2usage (2);
pod2usage (1) if $help;
Expand Down Expand Up @@ -509,6 +518,11 @@ eval {
$g->mkfs_btrfs ([$dev], datatype => "single", metadata => "single");
}

# Set label.
if (defined $label) {
$g->set_label ($dev, $label);
}

# Mount it.

# For vfat, add the utf8 mount option because we want to be able
Expand Down

0 comments on commit e17cd73

Please sign in to comment.