summaryrefslogtreecommitdiffstats
Commit message (Expand)AuthorAgeFilesLines
* meloJosé Jorge2005-06-071-334/+140
* (mount) use 'soft' & 'intr' options for nfs mountsThierry Vignaud2005-06-071-1/+1
* (media_browser): handle nfsPascal Rigaux2005-06-071-31/+73
* allow inspecting nfsPascal Rigaux2005-06-071-1/+1
* handle nfs mount (since we now use the /bin/mount instead of the syscall, we ...Pascal Rigaux2005-06-071-2/+4
* updated Welsh filePablo Saratxaga2005-06-061-37/+37
* updated French and Vietnamese filesPablo Saratxaga2005-06-062-421/+169
* replace strange "-" with a ascii compliant onePascal Rigaux2005-06-061-1/+1
* *** empty log message ***Pascal Rigaux2005-06-061-1/+983
* install2 functions should be stepsPascal Rigaux2005-06-062-19/+20
* get rid of $clicked and $ent_number (obsolete)Pascal Rigaux2005-06-066-84/+69
* change the default in case of low resources and add the Icewm choicePascal Rigaux2005-06-061-1/+1
* make it more readableOlivier Blin2005-06-061-1/+1
* kill unused variablesOlivier Blin2005-06-061-3/+0
* simplify apply() since sethostname() is done by configure_network()Olivier Blin2005-06-061-5/+2
* set system hostname when writing network configurationOlivier Blin2005-06-061-0/+1
* create adjustments before resolution is set so that they get correct upper va...Olivier Blin2005-06-061-3/+3
* - create update_scales_for_resolution() and update_scale_values_from_conf() o...Olivier Blin2005-06-061-14/+10
* - draw cross in progress barOlivier Blin2005-06-061-11/+17
* nicer errorPascal Rigaux2005-06-061-1/+1
* - put quotes if needed for root=xxx (quotes are needed for LABEL=...)Pascal Rigaux2005-06-062-6/+11
* really consider text box valuesOlivier Blin2005-06-061-1/+1
* rewrite before adding morePascal Rigaux2005-06-061-3/+9
* fix typo instead of trying to be perl_checker compliant ...Olivier Blin2005-06-061-2/+2
* keep read-only, read-write and label as verbatim as possiblePascal Rigaux2005-06-061-5/+4
* handle GATEWAY field again in manage interfaceOlivier Blin2005-06-061-6/+6
* use bootloader->{message_text} instead of bootloader->{message}Pascal Rigaux2005-06-062-11/+19
* use real_main here since exceptions are handledOlivier Blin2005-06-061-1/+1
* update commentsOlivier Blin2005-06-061-2/+2
* add ISP field in eagle-usb.confOlivier Blin2005-06-061-1/+1
* netconnect API change, harddrake::autoconf::network_conf seems unusedOlivier Blin2005-06-061-1/+1
* drop unused variable, this file is modified in network::shorewall nowOlivier Blin2005-06-061-1/+0
* new netconnect APIOlivier Blin2005-06-062-12/+6
* API change (me sux)Olivier Blin2005-06-061-6/+3
* make a special "low resources" choicePascal Rigaux2005-06-063-3/+15
* Translated more stringsPer Øyvind Karlsen2005-06-061-424/+94
* don't add us_intl, lang2keyboards() takes care of everything (bugzilla #12979)Pascal Rigaux2005-06-061-1/+1
* default to "en" keyboard (as requested by pablo)Pascal Rigaux2005-06-061-2/+2
* add pata_pdc2027x SATA driverThierry Vignaud2005-06-031-1/+1
* do not use a loop device to read ISO image IDs, read them directly in the fil...Olivier Blin2005-06-031-8/+4
* introduce network_is_cheap(), use it, and fix a boolean typoOlivier Blin2005-06-031-2/+7
* $o->{net}{type} is already defined in more appropriate placesOlivier Blin2005-06-031-4/+0
* define $o->{net}{type} and $o->{net}{net_interface} for lan installsOlivier Blin2005-06-031-0/+2
* provide backward compatibility for network fields in loadOOlivier Blin2005-06-031-0/+14
* keep NETWORKING_IPV6 and FORWARD_IPV4 variables in /etc/sysconfig/networkOlivier Blin2005-06-031-2/+3
* remove comment, stage1 now writes DOMAINNAME and DHCP_HOSTNAME in the proper ...Olivier Blin2005-06-031-1/+0
* write DHCP_HOSTNAME in /tmp/ifcfg-* file instead of /tmp/networkOlivier Blin2005-06-031-5/+4
* don't rmdir directories in the chrootPascal Rigaux2005-06-031-1/+1
* domain name is already in /etc/resolv.conf (and stage2 reads this file too), ...Olivier Blin2005-06-031-2/+0
* remove unused codePascal Rigaux2005-06-035-9/+2
pan class="hl kwb">@$disks; if (@$disks) { update($md_part); } else { @$raids = grep { $_ != $md_part } @$raids; } } sub updateSize { my ($part) = @_; local $_ = $part->{level}; my @l = map { $_->{size} } @{$part->{disks}}; $part->{size} = do { if (/0|linear/) { sum @l } elsif (/1/) { min @l } elsif (/4|5/) { min(@l) * $#l } }; } sub module { my ($part) = @_; my $mod = $part->{level}; $mod = 5 if $mod eq "4"; $mod = "raid$mod" if $mod =~ /^\d+$/; $mod; } sub update { updateSize($_) foreach @_; } sub make { my ($raids, $part) = @_; return if is_active($part->{device}); inactivate_and_dirty($part); isRAID($_) and make($raids, $_) foreach @{$part->{disks}}; eval { modules::load(module($part)) }; whereis_binary('mdadm') or die 'mdadm not installed'; my $dev = devices::make($part->{device}); my $nb = @{$part->{disks}}; run_program::run_or_die('mdadm', '--create', '--run', $dev, if_($nb == 1, '--force'), '--chunk=' . $part->{'chunk-size'}, "--level=$part->{level}", "--raid-devices=$nb", map { devices::make($_->{device}) } @{$part->{disks}}); if (my $raw_part = get_md_info($dev)) { $part->{UUID} = $raw_part->{UUID}; } write_conf($raids) if $::isStandalone; } sub format_part { my ($raids, $part) = @_; $part->{isFormatted} and return; make($raids, $part); fs::format::part_raw($part, undef); set_isFormatted($_, 1) foreach @{$part->{disks}}; } sub verify { my ($raids) = @_; foreach (@$raids) { @{$_->{disks}} >= ($_->{level} =~ /4|5/ ? 3 : 2) or die N("Not enough partitions for RAID level %d\n", $_->{level}); } } sub inactivate_and_dirty { my ($part) = @_; run_program::run('mdadm', '--stop', devices::make($part->{device})); set_isFormatted($part, 0); } sub active_mds() { map { if_(/^(md\d+)\s*:\s*active/, $1) } cat_("/proc/mdstat"); } sub inactive_mds() { map { if_(/^(md\d+)\s*:\s*inactive/, $1) } cat_("/proc/mdstat"); } sub free_mds { my ($raids) = @_; difference2([ map { "md$_" } 0 .. max_nb() ], [ map { $_->{device} } @$raids ]); } sub detect_during_install { my (@parts) = @_; detect_during_install_once(@parts); detect_during_install_once(@parts) if active_mds(); #- try again to detect RAID 10 foreach (inactive_mds()) { log::l("$_ is an inactive md, we stop it to ensure it doesn't busy devices"); run_program::run('mdadm', '--stop', devices::make($_)); } } sub detect_during_install_once { my (@parts) = @_; devices::make("md$_") foreach 0 .. max_nb(); output('/etc/mdadm.conf', join(' ', 'DEVICE', (map { "/dev/$_" } active_mds()), map { devices::make($_->{device}) } @parts), "\n"); run_program::run('mdadm', '>>', '/etc/mdadm.conf', '--examine', '--scan'); foreach (@{parse_mdadm_conf(scalar cat_('/etc/mdadm.conf'))->{ARRAY}}) { eval { modules::load($_->{level}) }; } run_program::run('mdadm', '--assemble', '--scan'); } sub get_existing { my @parts = @_; my $raids = []; foreach my $md (active_mds()) { my $raw_part = get_md_info(devices::make($md)) or next; $raw_part->{level} =~ s/raid//; #- { linear | raid0 | raid1 | raid5 } -> { linear | 0 | 1 | 5 } my @mdparts = map { if (my $part = fs::get::device2part($_, [ @parts, @$raids ])) { $part; } else { log::l("ERROR: unknown raw raid device $_"); (); } } split(',', $raw_part->{devices}); my $md_part = new($raids, device => $md, UUID => $raw_part->{UUID}, level => $raw_part->{level}, disks => \@mdparts); my $type = fs::type::type_subpart_from_magic($md_part); if ($type) { put_in_hash($md_part, $type); } else { fs::type::set_fs_type($md_part, 'ext3'); } my $fs_type = $type && $type->{fs_type}; fs::type::set_isFormatted($md_part, to_bool($fs_type)); log::l("RAID: found $md (raid $md_part->{level}) type $fs_type with parts $raw_part->{devices}"); } $raids; } sub is_active { my ($dev) = @_; member($dev, active_mds()); } sub write_conf { my ($raids) = @_; @$raids or return; my @devices = uniq(map { devices::make($_->{device}) } map { @{$_->{disks}} } @$raids); output("$::prefix/etc/mdadm.conf", join(' ', 'DEVICE', @devices) . "\n", map { "ARRAY " . devices::make($_->{device}) . " UUID=$_->{UUID} auto=yes\n" } @$raids); } sub get_md_info { my ($dev) = @_; my $conf = parse_mdadm_conf(scalar run_program::get_stdout('mdadm', '--detail', '--brief', '-v', $dev)); @{$conf->{ARRAY}} or return; @{$conf->{ARRAY}} == 1 or internal_error("too many answers"); $conf->{ARRAY}[0]; } sub parse_mdadm_conf { my ($s) = @_; my %conf = (DEVICE => [], ARRAY => []); $s =~ s!^\s*#.*!!gm; #- remove comments $s =~ s!\n(\s)!$1!g; #- join lines starting with a space foreach (split("\n", $s)) { if (/^DEVICE\s+(.*)/) { push @{$conf{DEVICE}}, split(' ', $1); } elsif (my ($md, $md_conf) = /^ARRAY\s+(\S+)\s*(.*)/) { my %md_conf = map { if_(/(.*)=(.*)/, $1 => $2) } split(' ', $md_conf); $md_conf{device} = $md; push @{$conf{ARRAY}}, \%md_conf; } } \%conf; } 1;