summaryrefslogtreecommitdiffstats
path: root/perl-install/fs
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/fs
parentcac00625d50a54c964a4baf8c5fe223c9a996b82 (diff)
downloaddrakx-backup-do-not-use-0cec176f0607443bf3019af2e9e6fa25f0441b10.tar
drakx-backup-do-not-use-0cec176f0607443bf3019af2e9e6fa25f0441b10.tar.gz
drakx-backup-do-not-use-0cec176f0607443bf3019af2e9e6fa25f0441b10.tar.bz2
drakx-backup-do-not-use-0cec176f0607443bf3019af2e9e6fa25f0441b10.tar.xz
drakx-backup-do-not-use-0cec176f0607443bf3019af2e9e6fa25f0441b10.zip
add support for ext4
Diffstat (limited to 'perl-install/fs')
-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
4 files changed, 17 insertions, 10 deletions
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 }