diff options
author | Francesc Pinyol Margalef <francesc.pinyol.m@gmail.com> | 2013-12-21 13:37:33 +0100 |
---|---|---|
committer | Francesc Pinyol Margalef <francesc.pinyol.m@gmail.com> | 2013-12-21 13:37:33 +0100 |
commit | 095c6b25885ce3d22eedba8cdb98f1fd7e8708a5 (patch) | |
tree | 5bfc768996b3ddec185abeb02b602b48b14d10db /rescue/tree/usr/sbin/diskdrake-resize | |
parent | df60191bdbddfa7c8e5bd11a2578aae6740963c0 (diff) | |
parent | f76dc0931e47338aa9c7db257d28e5015d8a2f47 (diff) | |
download | drakx-095c6b25885ce3d22eedba8cdb98f1fd7e8708a5.tar drakx-095c6b25885ce3d22eedba8cdb98f1fd7e8708a5.tar.gz drakx-095c6b25885ce3d22eedba8cdb98f1fd7e8708a5.tar.bz2 drakx-095c6b25885ce3d22eedba8cdb98f1fd7e8708a5.tar.xz drakx-095c6b25885ce3d22eedba8cdb98f1fd7e8708a5.zip |
Merge branch 'master' of git://git.mageia.org/software/drakx
Diffstat (limited to 'rescue/tree/usr/sbin/diskdrake-resize')
-rwxr-xr-x | rescue/tree/usr/sbin/diskdrake-resize | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/rescue/tree/usr/sbin/diskdrake-resize b/rescue/tree/usr/sbin/diskdrake-resize new file mode 100755 index 000000000..88372aac7 --- /dev/null +++ b/rescue/tree/usr/sbin/diskdrake-resize @@ -0,0 +1,29 @@ +#!/usr/bin/perl + +use lib qw(/usr/lib/libDrakX); + +use devices; +use log; +use resize_fat::main; +use diskdrake::resize_ntfs; +use diskdrake::resize_ext2; + +my ($device, $fs_type, $size) = @ARGV + or die "usage: $0 <device> <fs type> <size>\n"; + +my %fs_pkgs = ( + vfat => 'resize_fat::main', + ntfs => 'diskdrake::resize_ntfs', + ext2 => 'diskdrake::resize_ext2', + ext3 => 'diskdrake::resize_ext2', + ext4 => 'diskdrake::resize_ext2', +); + +my $resize_pkg = $fs_pkgs{$fs_type} + or die "no support for $fs_type type\n"; + +log::l("resizing $device to $size"); + +my $resize = $resize_pkg->new($device, devices::make($device)) + or die "unable to initialize resize\n"; +$resize->resize($size); |