diff options
author | Olivier Blin <oblin@mandriva.com> | 2009-06-17 21:42:39 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2009-06-17 21:42:39 +0000 |
commit | 88b99f870f4d7d0019e1593d9545e8bb7c05f0f1 (patch) | |
tree | 387774c77c9d1597404b9b71d59fd896216b09df | |
parent | ae2a09cf9f6899d5526d56ed92b3091c14a6d153 (diff) | |
download | draklive-88b99f870f4d7d0019e1593d9545e8bb7c05f0f1.tar draklive-88b99f870f4d7d0019e1593d9545e8bb7c05f0f1.tar.gz draklive-88b99f870f4d7d0019e1593d9545e8bb7c05f0f1.tar.bz2 draklive-88b99f870f4d7d0019e1593d9545e8bb7c05f0f1.tar.xz draklive-88b99f870f4d7d0019e1593d9545e8bb7c05f0f1.zip |
allow to set inode size in {media}{inode_size} for ext2/ext3 file systems
-rwxr-xr-x | draklive | 10 | ||||
-rw-r--r-- | lib/MDV/Draklive/Utils.pm | 4 |
2 files changed, 7 insertions, 7 deletions
@@ -655,7 +655,7 @@ sub get_disk_master_path { } sub allocate_master { - my ($dest, $size, $fs) = @_; + my ($dest, $size, $fs, $o_inode_size) = @_; mkdir_p(dirname($dest)); my $heads = 16; my $sectors_per_track = 63; @@ -693,7 +693,7 @@ EOF my $loop = devices::find_free_loop(); run_('losetup', '-o', $part_start * $sector_size, '-s', $part_nb_sectors * $sector_size, $loop, $dest) or die "unable to setup loop device"; - MDV::Draklive::Utils::device_mkfs($loop, $fs) or die "unable to format $dest\n"; + MDV::Draklive::Utils::device_mkfs($loop, $fs, $o_inode_size) or die "unable to format $dest\n"; return $loop; } @@ -709,7 +709,7 @@ sub create_disk_master { 70000000) : (directory_usage($live->get_system_root) + 200000000); - my $loop = allocate_master($dest, $disk_size, $live->{media}->get_media_setting('fs')); + my $loop = allocate_master($dest, $disk_size, $live->{media}->get_media_setting('fs'), $live->{media}->get_media_setting('inode_size')); local $opts->{device} = $loop; local $opts->{disk_device} = $dest; record_master($live, $opts); @@ -743,7 +743,7 @@ sub format_usb_device { my ($live, $opts) = @_; my $device = get_media_device($live, $opts); maybe_umount_device($device); - MDV::Draklive::Utils::device_mkfs($device, $live->{media}->get_media_setting('fs')) + MDV::Draklive::Utils::device_mkfs($device, $live->{media}->get_media_setting('fs'), $live->{media}->get_media_setting('inode_size')) or die "unable to format device $device\n"; } @@ -1048,7 +1048,7 @@ sub create_usb_replicator { my $dest = get_disk_replicator_path($live); my %files = get_disk_replicator_files($live); my $size = fold_left { $::a + $::b } map { directory_usage($_, 'apparent') } keys(%files); - my $loop = allocate_master($dest, 5000000 + $size, 'vfat'); + my $loop = allocate_master($dest, 5000000 + $size, 'vfat', $live->{replicator}{media}->get_media_setting('inode_size')); my $opts = { device => $loop, disk_device => $dest, append => $live->{replicator}{append} }; record_usb_replicator($live, $opts); run_('losetup', '-d', $loop); diff --git a/lib/MDV/Draklive/Utils.pm b/lib/MDV/Draklive/Utils.pm index 8e9ed65..906680f 100644 --- a/lib/MDV/Draklive/Utils.pm +++ b/lib/MDV/Draklive/Utils.pm @@ -63,11 +63,11 @@ sub device_allocate_file { #- format $device as type $type sub device_mkfs { - my ($device, $type) = @_; + my ($device, $type, $o_inode_size) = @_; if ($type eq 'vfat') { run_('mkfs.vfat', $device); } elsif (member($type, 'ext2', 'ext3')) { - run_("mkfs.$type", "-m", 0, if_(!-b $device, '-F'), $device); + run_("mkfs.$type", "-m", 0, if_($o_inode_size, '-I', $o_inode_size), if_(!-b $device, '-F'), $device); } else { die "unable to mkfs for unsupported media type $type\n"; } |