package fs; use diagnostics; use strict; use common; use log; use devices; use fs::type; use fs::get; use fs::format; use fs::mount_options; use fs::loopback; use fs::mount; use run_program; use detect_devices; use modules; use fsedit; sub read_fstab { my ($prefix, $file, @reading_options) = @_; if (member('keep_default', @reading_options)) { push @reading_options, 'freq_passno', 'keep_device_LABEL', 'keep_device_UUID'; } my %comments; my $comment; my @l = grep { if (/^Filename\s*Type\s*Size/) { 0; #- when reading /proc/swaps } elsif (/^\s*#/) { $comment .= chomp_($_) . "\n"; 0; } else { $comments{$_} = $comment if $comment; $comment = ''; 1; } } cat_("$prefix$file"); #- attach comments at the end of fstab to the previous line $comments{$l[-1]} = $comment if $comment; map { my ($dev, $mntpoint, $fs_type, $options, $freq, $passno) = split; my $comment = $comments{$_}; $options = 'defaults' if $options eq 'rw'; # clean-up for mtab read s/\\040/ /g foreach $mntpoint, $dev, $options; if ($fs_type eq 'ext4') { $options = join(",", grep { !/extents/ } split(',', $options)) || 'defaults'; } my $h = { mntpoint => $mntpoint, fs_type => $fs_type, options => $options, comment => $comment, if_(member('keep_freq_passno', @reading_options), freq => $freq, passno => $passno), }; put_in_hash($h, fs::wild_device::to_subpart($dev)); if ($h->{device_LABEL} && !$h->{device_alias} && member('keep_device_LABEL', @reading_options)) { $h->{prefer_device_LABEL} = 1; } elsif ($h->{device_UUID} && !$h->{device_alias} && member('keep_device_UUID', @reading_options)) { $h->{prefer_device_UUID} = 1; } else { $h->{prefer_device} = 1; } if ($h->{options} =~ /credentials=/ && !member('verbatim_credentials', @reading_options)) { require fs::remote::smb; #- remove credentials=file with username=foo,password=bar,domain=zoo #- the other way is done in fstab_to_string my ($options, $unknown) = fs::mount_options::unpack($h); my $file = delete $options->{'credentials='}; my $credentials = fs::remote::smb::read_credentials_raw($file); if ($credentials->{username}) { $options->{"$_="} = $credentials->{$_} foreach qw(username password domain); fs::mount_options::pack($h, $options, $unknown); } } elsif ($h->{fs_type} eq 'davfs2' && !member('verbatim_credentials', @reading_options)) { require fs::remote::davfs; if (my $credentials = fs::remote::davfs::read_credentials($h->{mntpoint})) { my ($options, $unknown) = fs::mount_options::unpack($h); $options->{"$_="} = $credentials->{$_} foreach qw(username password); fs::mount_options::pack($h, $options, $unknown); } } $h; } @l; } sub merge_fstabs { my ($loose, $fstab, @l) = @_; foreach my $p (@$fstab) { my ($l1, $l2) = partition { fs::get::is_same_hd($_, $p) } @l; my ($p2) = @$l1 or next; @l = @$l2; $p->{mntpoint} = $p2->{mntpoint} if delete $p->{unsafeMntpoint}; if (!$loose) { $p->{fs_type} = $p2->{fs_type} if $p2->{fs_type}; $p->{options} = $p2->{options} if $p2->{options}; add2hash_($p, $p2); } else { $p->{isMounted} ||= $p2->{isMounted}; $p->{real_mntpoint} ||= $p2->{real_mntpoint}; } $p->{device_alias} ||= $p2->{device_alias} if $p->{device} ne $p2->{device} && $p2->{device} !~ m|/|; $p->{fs_type} && $p2->{fs_type} && $p->{fs_type} ne $p2->{fs_type} && $p->{fs_type} ne 'auto' && $p2->{fs_type} ne 'auto' and log::l("err, fstab and partition table do not agree for $p->{device} type: $p->{fs_type} vs $p2->{fs_type}"); } @l; } sub add2all_hds { my ($all_hds, @l) = @_; @l = merge_fstabs('', [ fs::get::really_all_fstab($all_hds) ], @l); foreach (@l) { my $s = $_->{fs_type} eq 'nfs' ? 'nfss' : $_->{fs_type} eq 'cifs' ? 'smbs' : $_->{fs_type} eq 'davfs2' ? 'davs' : isTrueLocalFS($_) || isSwap($_) || isOtherAvailableFS($_) ? '' : 'special'; push @{$all_hds->{$s}}, $_ if $s; } } sub get_major_minor { my ($fstab) = @_; foreach (@$fstab) { eval { my (undef, $major, $minor) = devices::entry($_->{device}); ($_->{major}, $_->{minor}) = ($major, $minor); } if !$_->{major}; } } sub merge_info_from_mtab { my ($fstab) = @_; my @l1 = map { my $l = $_; my $h = fs::type::fs_type2subpart('swap'); $h->{$_} = $l->{$_} foreach qw(device major minor); $h; } read_fstab('', '/proc/swaps'); my @l2 = map { read_fstab('', $_) } '/etc/mtab', '/proc/mounts'; foreach (@l1, @l2) { log::l("found mounted partition on $_->{device} with $_->{mntpoint}"); if ($::isInstall && $_->{mntpoint} =~ m!^/tmp/\w*image$!) { $_->{real_mntpoint} = delete $_->{mntpoint}; } $_->{isMounted} = 1; set_isFormatted($_, 1); } merge_fstabs('loose', $fstab, @l1, @l2); } # - when using "$loose", it does not merge in type&options from the fstab sub merge_info_from_fstab { my ($fstab, $prefix, $uniq, $loose) = @_; my @l = grep { if ($uniq) { my $part = fs::get::mntpoint2part($_->{mntpoint}, $fstab); !$part || fs::get::is_same_hd($part, $_); #- keep it only if it is the mount point AND the same device } else { 1; } } read_fstab($prefix, '/etc/fstab', 'keep_default'); merge_fstabs($loose, $fstab, @l); } sub get_info_from_fstab { my ($all_hds) = @_; my @l = read_fstab($::prefix, '/etc/fstab', 'keep_default'); add2all_hds($all_hds, @l); } sub prepare_write_fstab { my ($fstab, $o_prefix, $b_keep_credentials) = @_; $o_prefix ||= ''; my %new; my (@smb_credentials, @davfs_credentials); my @l = map { my $device = isLoopback($_) ? ($_->{mntpoint} eq '/' ? "/initrd/loopfs" : $_->{loopback_device}{mntpoint}) . $_->{loopback_file} : fs::wild_device::from_part($o_prefix, $_); my $comment = $_->{comment}; $comment = '' if $comment =~ m!^Entry for /dev/.* :!; $comment ||= "# Entry for /dev/$_->{device} :\n" if $device =~ /^(UUID|LABEL)=/; my $real_mntpoint = $_->{mntpoint} || ${{ '/tmp/hdimage' => '/mnt/hd' }}{$_->{real_mntpoint}}; if (!member('bind', split(',', $_->{options}))) { mkdir_p("$o_prefix$real_mntpoint") if $real_mntpoint =~ m|^/|; } my $mntpoint = fs::type::carry_root_loopback($_) ? '/initrd/loopfs' : $real_mntpoint; my $needed_to_boot = member($_->{mntpoint}, fs::type::directories_needed_to_boot()); my ($freq, $passno) = exists $_->{freq} ? ($_->{freq}, $_->{passno}) : isTrueLocalFS($_) && !$_->{dmcrypt_name} && $_->{options} !~ /encryption=/ && (!$_->{is_removable} || $needed_to_boot) ? (1, $_->{mntpoint} eq '/' ? 1 : fs::type::carry_root_loopback($_) ? 0 : 2) : (0, 0); if (($device eq 'none' || !$new{$device}) && ($mntpoint eq 'swap' || !$new{$mntpoint})) { #- keep in mind the new line for fstab. $new{$device} = 1; $new{$mntpoint} = 1; my $options = $_->{options} || 'defaults'; if (($_->{is_removable} || member($_->{fs_type}, qw(ntfs ntfs-3g))) && !$needed_to_boot && $_->{options} !~ /nofail/) { $options .= ',nofail'; } if ($_->{fs_type} eq 'cifs' && $options =~ /password=/ && !$b_keep_sync with code
-rw-r--r-- | po/gl.po | 299 |
@@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: drakx-net-gl\n" -"POT-Creation-Date: 2008-01-31 11:33+0100\n" +"POT-Creation-Date: 2008-03-03 18:09+0100\n" "PO-Revision-Date: 2006-09-10 14:02+0100\n" "Last-Translator: Leandro Regueiro <leandro.regueiro@gmail.com>\n" "Language-Team: Galician <<gpul-traduccion@ceu.fi.udc.es>>\n" @@ -2061,12 +2061,7 @@ msgstr "Noraboa" msgid "The wizard successfully added the printer Samba share" msgstr "O asistente engadiu con éxito o recurso de impresora de Samba" -#: ../bin/draksambashare:545 -#, c-format -msgid "Failed to add printers." -msgstr "Erro ó engadir impresoras." - -#: ../bin/draksambashare:560 +#: ../bin/draksambashare:551 #, c-format msgid "Please add or select a Samba printer share to be able to modify it." msgstr "" @@ -2445,12 +2440,7 @@ msgstr "" msgid "The wizard successfully configured your Samba server." msgstr "O asistente engadiu con éxito o recurso de impresora de Samba" -#: ../bin/draksambashare:1213 -#, fuzzy, c-format -msgid "Failed to configure Samba server." -msgstr "Erro ó Modificar o recurso Samba." - -#: ../bin/draksambashare:1263 +#: ../bin/draksambashare:1246 #, c-format msgid "The Samba wizard has unexpectedly failed:" msgstr "" @@ -2515,7 +2505,19 @@ msgstr "Userdrake" msgid "Samba Users" msgstr "Usuarios de Samba" -#: ../bin/draksambashare:1467 +#: ../bin/draksambashare:1449 +#, fuzzy, c-format +msgid "Please configure your Samba server" +msgstr "Erro ó Modificar o recurso Samba." + +#: ../bin/draksambashare:1449 +#, c-format +msgid "" +"It seems this is the first time you run this tool.\n" +"A wizard will appear to configure a basic Samba server" +msgstr "" + +#: ../bin/draksambashare:1457 |