summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-11-06 15:43:05 +0000
committerThierry Vignaud <tv@mandriva.org>2007-11-06 15:43:05 +0000
commit0cec176f0607443bf3019af2e9e6fa25f0441b10 (patch)
tree3a36444b75be2fc0d802f3405919d5d1933ee322 /perl-install
parentcac00625d50a54c964a4baf8c5fe223c9a996b82 (diff)
downloaddrakx-0cec176f0607443bf3019af2e9e6fa25f0441b10.tar
drakx-0cec176f0607443bf3019af2e9e6fa25f0441b10.tar.gz
drakx-0cec176f0607443bf3019af2e9e6fa25f0441b10.tar.bz2
drakx-0cec176f0607443bf3019af2e9e6fa25f0441b10.tar.xz
drakx-0cec176f0607443bf3019af2e9e6fa25f0441b10.zip
add support for ext4
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/NEWS2
-rw-r--r--perl-install/diskdrake/hd_gtk.pm4
-rw-r--r--perl-install/diskdrake/interactive.pm10
-rw-r--r--perl-install/fs/format.pm12
-rw-r--r--perl-install/fs/mount.pm6
-rw-r--r--perl-install/fs/mount_options.pm6
-rw-r--r--perl-install/fs/type.pm3
7 files changed, 26 insertions, 17 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS
index 8f52cf322..a24ba70e1 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -1,3 +1,5 @@
+- diskdrake:
+ o add support for ext4
- drakbug:
o keep buggy process around so that we can run gdb on it (if perl segfaulted)
- harddrake: detect storage and various controllers before anything else
diff --git a/perl-install/diskdrake/hd_gtk.pm b/perl-install/diskdrake/hd_gtk.pm
index b05731967..b6c1d7565 100644
--- a/perl-install/diskdrake/hd_gtk.pm
+++ b/perl-install/diskdrake/hd_gtk.pm
@@ -314,7 +314,7 @@ sub create_buttons4partitions {
last;
}
});
- my @colorized_fs_types = qw(ext3 xfs swap vfat ntfs ntfs-3g);
+ my @colorized_fs_types = qw(ext3 ext4dev xfs swap vfat ntfs ntfs-3g);
$w->set_name("PART_" . (isEmpty($entry) ? 'empty' :
$entry->{fs_type} && member($entry->{fs_type}, @colorized_fs_types) ? $entry->{fs_type} :
'other'));
@@ -353,7 +353,7 @@ sub hd2kind {
sub filesystems_button_box() {
my @types = (N_("Ext3"), N_("XFS"), N_("Swap"), arch() =~ /sparc/ ? N_("SunOS") : arch() eq "ppc" ? N_("HFS") : N_("Windows"),
N_("Other"), N_("Empty"));
- my %name2fs_type = (Ext3 => 'ext3', 'XFS' => 'xfs', Swap => 'swap', Other => 'other', "Windows" => 'vfat', HFS => 'hfs');
+ my %name2fs_type = (Ext3 => 'ext3', Ext4 => 'ext4dev', 'XFS' => 'xfs', Swap => 'swap', Other => 'other', "Windows" => 'vfat', HFS => 'hfs');
gtkpack(Gtk2::HBox->new(0,0),
N("Filesystem types:"),
diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm
index 2b513dd4b..a96b9e0e0 100644
--- a/perl-install/diskdrake/interactive.pm
+++ b/perl-install/diskdrake/interactive.pm
@@ -443,7 +443,7 @@ sub part_possible_actions {
my %macros = (
readonly => '$hd->{readonly}',
hasMntpoint => '$part->{mntpoint}',
- LVM_resizable => '$part->{fs_type} eq "reiserfs" || (isMounted ? $part->{fs_type} eq "xfs" : $part->{fs_type} eq "ext3")',
+ LVM_resizable => '$part->{fs_type} eq "reiserfs" || (isMounted ? $part->{fs_type} eq "xfs" : member($part->{fs_type}, qw(ext3 ext4dev)))',
canModifyRAID => 'isPartOfRAID($part) && !isMounted(fs::get::device2part($part->{raid}, $all_hds->{raids}))',
);
if (isEmpty($part)) {
@@ -590,7 +590,7 @@ sub Type {
my @types = fs::type::type_names($::expert, $hd);
#- when readonly, Type() is allowed only when changing {fs_type} but not {pt_type}
- #- eg: switching between ext2, ext3, reiserfs...
+ #- eg: switching between ext2, ext3, ext4dev, reiserfs...
@types = grep { fs::type::type_name2pt_type($_) == $part->{pt_type} } @types if $hd->{readonly};
my $type_name = fs::type::part2type_name($part);
@@ -602,8 +602,8 @@ sub Type {
my $type = $type_name && fs::type::type_name2subpart($type_name);
- if (member($type->{fs_type}, 'ext2', 'ext3')) {
- my $_w = $in->wait_message(N("Please wait"), N("Switching from ext2 to ext3"));
+ if (member($type->{fs_type}, qw(ext2 ext3 ext4dev))) {
+ my $_w = $in->wait_message(N("Please wait"), N("Switching from %s to %s", 'ext2', $type->{fs_type}));
if (run_program::run("tune2fs", "-j", devices::make($part->{device}))) {
put_in_hash($part, $type);
set_isFormatted($part, 1); #- assume that if tune2fs works, partition is formatted
@@ -713,7 +713,7 @@ sub Resize {
$nice_resize{fat} = resize_fat::main->new($part->{device}, devices::make($part->{device}));
$min = max($min, $nice_resize{fat}->min_size);
$max = min($max, $nice_resize{fat}->max_size);
- } elsif (member($part->{fs_type}, 'ext2', 'ext3')) {
+ } elsif (member($part->{fs_type}, qw(ext2 ext3 ext4dev))) {
write_partitions($in, $hd) or return;
require diskdrake::resize_ext2;
if ($nice_resize{ext2} = diskdrake::resize_ext2->new($part->{device}, devices::make($part->{device}))) {
diff --git a/perl-install/fs/format.pm b/perl-install/fs/format.pm
index 4e711a217..4b68f6cc3 100644
--- a/perl-install/fs/format.pm
+++ b/perl-install/fs/format.pm
@@ -13,6 +13,7 @@ use log;
my %cmds = (
ext2 => [ 'e2fsprogs', 'mkfs.ext2', '-F' ],
ext3 => [ 'e2fsprogs', 'mkfs.ext3', '-F' ],
+ ext4dev => [ 'e2fsprogs', 'mkfs.ext3', '-F', '-I', '256' ], # FIXME: enable more options once we've better mkfs support
reiserfs => [ 'reiserfsprogs', 'mkfs.reiserfs', '-ff' ],
reiser4 => [ 'reiser4progs', 'mkfs.reiser4', '-f', '-y' ],
xfs => [ 'xfsprogs', 'mkfs.xfs', '-f', '-q' ],
@@ -27,6 +28,7 @@ my %cmds = (
my %LABELs = ( #- option, length, handled_by_mount
ext2 => [ '-L', 16, 1 ],
ext3 => [ '-L', 16, 1 ],
+ ext4dev => [ '-L', 16, 1 ],
reiserfs => [ '-l', 16, 1 ],
xfs => [ '-L', 12, 1 ],
jfs => [ '-L', 16, 1 ],
@@ -85,7 +87,7 @@ sub part_raw {
my $fs_type = $part->{fs_type};
- if (member($fs_type, qw(ext2 ext3))) {
+ if (member($fs_type, qw(ext2 ext3 ext4dev))) {
push @options, "-m", "0" if $part->{mntpoint} =~ m|^/home|;
} elsif (isDos($part)) {
$fs_type = 'dos';
@@ -104,7 +106,7 @@ sub part_raw {
$part->{device_LABEL} = $short;
}
delete $part->{prefer_device_LABEL}
- if !$handled_by_mount || $part->{mntpoint} eq '/' && !member($fs_type, 'ext2', 'ext3');
+ if !$handled_by_mount || $part->{mntpoint} eq '/' && !member($fs_type, qw(ext2 ext3 ext4dev));
push @options, $option, $part->{device_LABEL};
} else {
@@ -119,12 +121,12 @@ sub part_raw {
my @args = ($cmd, @first_options, @options, devices::make($dev));
if ($cmd eq 'mkfs.ext3' && $wait_message) {
- mkfs_ext3($wait_message, @args) or die N("%s formatting of %s failed", $fs_type, $dev);
+ #DEBUG: mkfs_ext3($wait_message, @args) or die N("%s formatting of %s failed", $fs_type, $dev);
} else {
run_program::raw({ timeout => 'never' }, @args) or die N("%s formatting of %s failed", $fs_type, $dev);
}
- if ($fs_type eq 'ext3') {
+ if (member($fs_type, qw(ext3 ext4dev))) {
disable_forced_fsck($dev);
}
@@ -169,7 +171,7 @@ sub formatMount_part {
}
#- setting user_xattr on /home (or "/" if no /home)
- if (!$part->{isMounted} && $part->{fs_type} eq 'ext3'
+ if (!$part->{isMounted} && member($part->{fs_type}, qw(ext3 ext4dev))
&& ($part->{mntpoint} eq '/home' ||
!fs::get::has_mntpoint('/home', $all_hds) && $part->{mntpoint} eq '/')) {
run_program::run('tune2fs', '-o', 'user_xattr', devices::make($part->{real_device} || $part->{device}));
diff --git a/perl-install/fs/mount.pm b/perl-install/fs/mount.pm
index 950eb1715..571aee09f 100644
--- a/perl-install/fs/mount.pm
+++ b/perl-install/fs/mount.pm
@@ -35,7 +35,7 @@ sub mount {
$fs or log::l("not mounting $dev partition"), return;
{
- my @fs_modules = qw(ext3 hfs jfs nfs ntfs romfs reiserfs ufs xfs vfat);
+ my @fs_modules = qw(ext3 ext4dev hfs jfs nfs ntfs romfs reiserfs ufs xfs vfat);
my @types = (qw(ext2 proc sysfs usbfs usbdevfs iso9660 devfs devpts), @fs_modules);
push @types, 'smb', 'smbfs', 'davfs2' if !$::isInstall;
@@ -170,10 +170,10 @@ sub part {
}
mount($dev, $mntpoint, $fs_type, $b_rdonly, $options, $o_wait_message);
- if ($options =~ /usrquota|grpquota/ && $part->{fs_type} eq 'ext3') {
+ if ($options =~ /usrquota|grpquota/ && member($part->{fs_type}, qw(ext3 ext4dev))) {
if (! find { -e "$mntpoint/$_" } qw(aquota.user aquota.group quota.user quota.group)) {
#- quotacheck will create aquota.user and/or aquota.group,
- #- needed for quotas on ext3.
+ #- needed for quotas on ext[34].
run_program::run('quotacheck', $mntpoint);
}
}
diff --git a/perl-install/fs/mount_options.pm b/perl-install/fs/mount_options.pm
index b1dea9b42..57ec4d47f 100644
--- a/perl-install/fs/mount_options.pm
+++ b/perl-install/fs/mount_options.pm
@@ -32,9 +32,10 @@ sub unpack {
nfs => [ qw(rsize=8192 wsize=8192) ],
smbfs => [ qw(username= password=) ],
davfs2 => [ qw(username= password= uid= gid=) ],
+ ext4dev => [ qw(extents) ],
reiserfs => [ 'notail' ],
);
- push @{$per_fs{$_}}, 'usrquota', 'grpquota' foreach 'ext2', 'ext3', 'xfs';
+ push @{$per_fs{$_}}, 'usrquota', 'grpquota' foreach 'ext2', 'ext3', 'ext4dev', 'xfs';
while (my ($fs, $l) = each %per_fs) {
$part->{fs_type} eq $fs || $part->{fs_type} eq 'auto' && member($fs, @auto_fs) or next;
@@ -229,6 +230,9 @@ sub set_default {
'iocharset=' => $opts{iocharset}, 'codepage=' => $opts{codepage},
});
}
+ if ($part->{fs_type} eq 'ext4dev') {
+ put_in_hash($options, { extents => 1 });
+ }
if ($part->{fs_type} eq 'ntfs') {
put_in_hash($options, { ro => 1, 'nls=' => $opts{iocharset},
'umask=0' => $opts{security} < 3, 'umask=0022' => $opts{security} < 4,
diff --git a/perl-install/fs/type.pm b/perl-install/fs/type.pm
index 610802ac8..220966c38 100644
--- a/perl-install/fs/type.pm
+++ b/perl-install/fs/type.pm
@@ -22,6 +22,7 @@ my (%type_name2pt_type, %type_name2fs_type, %fs_type2pt_type, %pt_type2fs_type,
0x82 => 'swap', 'Linux swap',
0x83 => 'ext2', 'Linux native',
0x83 => 'ext3', 'Journalised FS: ext3',
+ 0x83 => 'ext4dev', 'Journalised FS: ext4',
0x83 => 'reiserfs', 'Journalised FS: ReiserFS',
if_(arch() =~ /ppc|i.86|ia64|x86_64/,
0x83 => 'xfs', 'Journalised FS: XFS',
@@ -301,7 +302,7 @@ sub type_subpart_from_magic {
$p;
}
-sub true_local_fs_types() { qw(ext3 ext2 reiserfs reiser4 xfs jfs) }
+sub true_local_fs_types() { qw(ext3 ext2 ext4dev reiserfs reiser4 xfs jfs) }
sub isEmpty { !$_[0]{fs_type} && $_[0]{pt_type} == 0 }
sub isEfi { arch() =~ /ia64/ && $_[0]{pt_type} == 0xef }