diff options
author | Olivier Blin <oblin@mandriva.com> | 2009-10-23 13:28:38 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2009-10-23 13:28:38 +0000 |
commit | b53b453cbb33ddeb9e7b36af564b476282d4747d (patch) | |
tree | aa87455123a7c00959bd1acdba5b52998d67d42a /lib/MDV/Draklive | |
parent | 6e97019adc3aa592fa7d067dd488052a693d1b58 (diff) | |
download | draklive-b53b453cbb33ddeb9e7b36af564b476282d4747d.tar draklive-b53b453cbb33ddeb9e7b36af564b476282d4747d.tar.gz draklive-b53b453cbb33ddeb9e7b36af564b476282d4747d.tar.bz2 draklive-b53b453cbb33ddeb9e7b36af564b476282d4747d.tar.xz draklive-b53b453cbb33ddeb9e7b36af564b476282d4747d.zip |
set label at mkfs time
Diffstat (limited to 'lib/MDV/Draklive')
-rw-r--r-- | lib/MDV/Draklive/Utils.pm | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/MDV/Draklive/Utils.pm b/lib/MDV/Draklive/Utils.pm index 12ce647..94be289 100644 --- a/lib/MDV/Draklive/Utils.pm +++ b/lib/MDV/Draklive/Utils.pm @@ -64,13 +64,17 @@ sub device_allocate_file { #- format $device as type $type # FIXME: use fs::format sub device_mkfs { - my ($device, $type, $o_inode_size) = @_; + my ($device, $type, $o_label, $o_inode_size) = @_; if ($type eq 'vfat') { - run_('mkfs.vfat', $device); + run_('mkfs.vfat', if_(defined $o_label, '-L', $o_label), $device); } elsif (member($type, 'ext2', 'ext3', 'ext4')) { - run_("mkfs.$type", "-m", 0, if_($o_inode_size, '-I', $o_inode_size), if_(!-b $device, '-F'), $device); + run_("mkfs.$type", "-m", 0, + if_(defined $o_label, '-L', $o_label), + if_($o_inode_size, '-I', $o_inode_size), + if_(!-b $device, '-F'), + $device); } elsif ($type eq 'swap') { - run_('mkswap', $device); + run_('mkswap', if_(defined $o_label, '-L', $o_label), $device); } else { die "unable to mkfs for unsupported media type $type\n"; } |