package any; # $Id$ use diagnostics; use strict; #-###################################################################################### #- misc imports #-###################################################################################### use common; use detect_devices; use partition_table; use fs::type; use lang; use run_program; use devices; use modules; use log; use fs; use c; sub facesdir() { "$::prefix/usr/share/mdk/faces/"; } sub face2png { my ($face) = @_; facesdir() . $face . ".png"; } sub facesnames() { my $dir = facesdir(); my @l = grep { /^[A-Z]/ } all($dir); map { if_(/(.*)\.png/, $1) } (@l ? @l : all($dir)); } sub addKdmIcon { my ($user, $icon) = @_; my $dest = "$::prefix/usr/share/faces/$user.png"; eval { cp_af(facesdir() . $icon . ".png", $dest) } if $icon; } sub alloc_user_faces { my ($users) = @_; my @m = my @l = facesnames(); foreach (grep { !$_->{icon} || $_->{icon} eq "automagic" } @$users) { $_->{auto_icon} = splice(@m, rand(@m), 1); #- known biased (see cookbook for better) log::l("auto_icon is $_->{auto_icon}"); @m = @l unless @m; } } sub create_user { my ($u, $authentication) = @_; my @existing = stat("$::prefix/home/$u->{name}"); if (!getpwnam($u->{name})) { my $uid = $u->{uid} || $existing[4]; if ($uid && getpwuid($uid)) { undef $uid; #- suggested uid already in use } my $gid = $u->{gid} || $existing[5] || int getgrnam($u->{name}); if ($gid) { if (getgrgid($gid)) { undef $gid if getgrgid($gid) ne $u->{name}; } else { run_program::rooted($::prefix, 'groupadd', '-g', $gid, $u->{name}); } } elsif ($u->{rename_from}) { run_program::rooted($::prefix, 'groupmod', '-n', $u->{name}, $u->{rename_from}); } require authentication; my $symlink_home_from = $u->{rename_from} && (getpwnam($u->{rename_from}))[7]; run_program::raw({ root => $::prefix, sensitive_arguments => 1 }, ($u->{rename_from} ? 'usermod' : 'adduser'), '-p', authentication::user_crypted_passwd($u, $authentication), if_($uid, '-u', $uid), if_($gid, '-g', $gid), if_($u->{realname}, '-c', $u->{realname}), if_($u->{home}, '-d', $u->{home}, if_($u->{rename_from}, '-m')), if_($u->{shell}, '-s', $u->{shell}), ($u->{rename_from} ? ('-l', $u->{name}, $u->{rename_from}) : $u->{name})); symlink($u->{home}, $symlink_home_from) if $symlink_home_from; } my (undef, undef, $uid, $gid, undef, undef, undef, $home) = getpwnam($u->{name}); if (@existing && $::isInstall && ($uid != $existing[4] || $gid != $existing[5])) { log::l("chown'ing $home from $existing[4].$existing[5] to $uid.$gid"); eval { common::chown_('recursive', $uid, $gid, "$::prefix$home") }; } } sub add_users { my ($users, $authentication) = @_; alloc_user_faces($users); foreach (@$users) { create_user($_, $authentication); run_program::rooted($::prefix, "usermod", "-G", join(",", @{$_->{groups}}), $_->{name}) if !is_empty_array_ref($_->{groups}); addKdmIcon($_->{name}, delete $_->{auto_icon} || $_->{icon}); } } sub install_bootloader_pkgs { my ($do_pkgs, $b) = @_; bootloader::ensure_pkg_is_installed($do_pkgs, $b); install_acpi_pkgs($do_pkgs, $b); } sub install_acpi_pkgs { my ($do_pkgs, $b) = @_; my $acpi = bootloader::get_append_with_key($b, 'acpi'); my $use_acpi = !member($acpi, 'off', 'ht'); if ($use_acpi) { $do_pkgs->ensure_is_installed('acpi', '/usr/bin/acpi', $::isInstall); $do_pkgs->ensure_is_installed('acpid', '/usr/sbin/acpid', $::isInstall); } require services; services::set_status($_, $use_acpi, $::isInstall) foreach qw(acpi acpid); } sub setupBootloaderBeforeStandalone { my ($do_pkgs, $b, $all_hds, $fstab) = @_; require keyboard; my $keyboard = keyboard::read_or_default(); my $allow_fb = listlength(cat_("/proc/fb")); my $cmdline = cat_('/proc/cmdline'); my $vga_fb = first($cmdline =~ /\bvga=(\S+)/); my $quiet = $cmdline =~ /\bsplash=silent\b/; setupBootloaderBefore($do_pkgs, $b, $all_hds, $fstab, $keyboard, $allow_fb, $vga_fb, $quiet); } sub setupBootloaderBefore { my ($do_pkgs, $bootloader, $all_hds, $fstab, $keyboard, $allow_fb, $vga_fb, $quiet) = @_; require bootloader; #- auto_install backward compatibility #- one should now use {message_text} if ($bootloader->{message} =~ m!^[^/]!) { $bootloader->{message_text} = delete $bootloader->{message}; } #- remove previous ide-scsi lines bootloader::modify_append($bootloader, sub { my ($_simple, $dict) = @_; @$dict = grep { $_->[1] ne 'ide-scsi' } @$dict; }); if (cat_("/proc/cmdline") =~ /mem=nopentium/) { bootloader::set_append_with_key($bootloader, mem => 'nopentium'); } if (cat_("/proc/cmdline") =~ /\b(pci)=(\S+)/) { bootloader::set_append_with_key($bootloader, $1, $2); } if (my ($acpi) = cat_("/proc/cmdline") =~ /\bacpi=(\w+)/) { if ($acpi eq 'ht') { #- the user is using the default, which may not be the best my $year = detect_devices::computer_info()->{BIOS_Year}; if ($year >= 2002) { log::l("forcing ACPI on recent bios ($year)"); $acpi = ''; } } bootloader::set_append_with_key($bootloader, acpi => $acpi); } if (cat_("/proc/cmdline") =~ /\bnoapic/) { bootloader::set_append_simple($bootloader, 'noapic'); } if (cat_("/proc/cmdline") =~ /\bnoresume/) { bootloader::set_append_simple($bootloader, 'noresume'); } elsif (bootloader::get_append_simple($bootloader, 'noresume')) { } else { my ($MemTotal) = cat_("/proc/meminfo") =~ /^MemTotal:\s*(\d+)/m; if (my ($biggest_swap) = sort { $b->{size} <=> $a->{size} } grep { isSwap($_) } @$fstab) { log::l("MemTotal: $MemTotal < ", $biggest_swap->{size} / 2); if ($MemTotal < $biggest_swap->{size} / 2) { bootloader::set_append_with_key($bootloader, resume => fs::wild_device::from_part('', $biggest_swap)); } } } #- check for valid fb mode to enable a default boot with frame buffer. my $vga = $allow_fb && (!detect_devices::matching_desc__regexp('3D Rage LT') && !detect_devices::matching_desc__regexp('Rage Mobility [PL]') && !detect_devices::matching_desc__regexp('i740') && !detect_devices::matching_desc__regexp('Matrox') && !detect_devices::matching_desc__regexp('Tseng.*ET6\d00') && !detect_devices::matching_desc__regexp('SiS.*SG86C2.5') && !detect_devices::matching_desc__regexp('SiS.*559[78]') && !detect_devices::matching_desc__regexp('SiS.*300') && !detect_devices::matching_desc__regexp('SiS.*540') && !detect_devices::matching_desc__regexp('SiS.*6C?326') && !detect_devices::matching_desc__regexp('SiS.*6C?236') && !detect_devices::matching_desc__regexp('Voodoo [35]|Voodoo Banshee') && #- 3d acceleration seems to bug in fb mode !detect_devices::matching_desc__regexp('828[14][05].* CGC') #- i810 & i845 now have FB support during install but we disable it afterwards ); my $force_vga = $allow_fb && (detect_devices::matching_desc__regexp('SiS.*630') || #- SiS 630 need frame buffer. detect_devices::matching_desc__regexp('GeForce.*Integrated') #- needed for fbdev driver (hack). ); #- propose the default fb mode for kernel fb, if bootsplash is installed. my $need_fb = $do_pkgs->are_installed('bootsplash'); bootloader::suggest($bootloader, $all_hds, vga_fb => ($force_vga || $vga && $need_fb) && $vga_fb, quiet => $quiet); $bootloader->{keytable} ||= keyboard::keyboard2kmap($keyboard); } sub setupBootloader { my ($in, $b, $all_hds, $fstab, $security) = @_; require bootloader; general: { local $::Wizard_no_previous = 1 if $::isStandalone; setupBootloader__general($in, $b, $all_hds, $fstab, $security) or return 0; } setupBootloader__boot_bios_drive($in, $b, $all_hds->{hds}) or goto general; { local $::Wizard_finished = 1 if $::isStandalone; setupBootloader__entries($in, $b, $all_hds, $fstab) or goto general; } 1; } sub setupBootloaderUntilInstalled { my ($in, $b, $all_hds, $fstab, $security) = @_; do { my $before = fs::fstab_to_string($all_hds); setupBootloader($in, $b, $all_hds, $fstab, $security) or $in->exit; if ($before ne fs::fstab_to_string($all_hds)) { #- for /tmp using tmpfs when "clean /tmp" is chosen fs::write_fstab($all_hds); } } while !installBootloader($in, $b, $all_hds); } sub installBootloader { my ($in, $b, $all_hds) = @_; retur
diff --git a/perl-install/share/po/zh_CN.po b/perl-install/share/po/zh_CN.po index 889e9998a..ab6cddebd 100644 --- a/perl-install/share/po/zh_CN.po +++ b/perl-install/share/po/zh_CN.po @@ -427,9 +427,9 @@ msgid "%s should be above 500. Accept anyway?" msgstr "%s 应该大于 500。仍然接受吗?" #: any.pm:768 -#, fuzzy, c-format +#, c-format msgid "User management" -msgstr "用户名" +msgstr "用户管理" #: any.pm:775 authentication.pm:182 #, c-format @@ -437,11 +437,9 @@ msgid "Set administrator (root) password" msgstr "设定管理员(root)密码" #: any.pm:780 -#, fuzzy, c-format +#, c-format msgid "Enter a user" -msgstr "" -"输入一个用户名\n" -"%s" +msgstr "输入一个用户" #: any.pm:781 #, c-format @@ -1244,14 +1242,14 @@ msgid "Unknown" msgstr "未知" #: diskdrake/hd_gtk.pm:354 -#, fuzzy, c-format +#, c-format msgid "Ext3" -msgstr "退出" +msgstr "Ext3" #: diskdrake/hd_gtk.pm:354 -#, fuzzy, c-format +#, c-format msgid "XFS" -msgstr "HFS" +msgstr "XFS" #: diskdrake/hd_gtk.pm:354 #, c-format @@ -1477,8 +1475,7 @@ msgid "Add to RAID" msgstr "加入 RAID" #: diskdrake/interactive.pm:430 diskdrake/interactive.pm:859 -#, c-format -msgid "Add to LVM" +#, c-formatXmsgid "Add to LVM" msgstr "加入 LVM" #: diskdrake/interactive.pm:432 @@ -2222,13 +2219,13 @@ msgstr "" "(例如, 为了加速对新闻服务器的新闻池的访问)" #: fs/mount_options.pm:123 -#, fuzzy, c-format +#, c-format msgid "" "Update inode access times on this filesystem in a more efficient way\n" "(e.g, for faster access on the news spool to speed up news servers)." msgstr "" -"不在此文件系统更新 inode 访问次数\n" -"(例如, 为了加速对新闻服务器的新闻池的访问)" +"以更有效的方式更新文件系统中的 inode 访问次数\n" +"(例如, 为了加速对新闻服务器的新闻池的访问)。" #: fs/mount_options.pm:123 #, c-format @@ -2489,7 +2486,7 @@ msgid "Next" msgstr "下一步" #: fs/partitioning_wizard.pm:167 -#, fuzzy, c-format +#, c-format msgid "Partitionning" msgstr "分区" @@ -6585,93 +6582,3 @@ msgstr "" #, c-format msgid "Installation failed" msgstr "安装失败" - -#~ msgid "Ext2" -#~ msgstr "Ext2" - -#~ msgid "Journalised FS" -#~ msgstr "日志文件系统" - -#~ msgid "Starts the X Font Server (this is mandatory for Xorg to run)." -#~ msgstr "启动 X 字体服务器(Xorg 所需)。" - -#~ msgid "Add user" -#~ msgstr "添加用户" - -#~ msgid "Accept user" -#~ msgstr "接受用户" - -#, fuzzy -#~ msgid "" -#~ "Do not update directory inode access times on this filesystem\n" -#~ "(e.g, for faster access on the news spool to speed up news servers)." -#~ msgstr "" -#~ "不在此文件系统更新 inode 访问次数\n" -#~ "(例如, 为了加速对新闻服务器的新闻池的访问)" - -#~ msgid "No supermount" -#~ msgstr "无 supermount" - -#~ msgid "Supermount" -#~ msgstr "Supermount" - -#~ msgid "Supermount except for CDROM drives" -#~ msgstr "除 CDROM 驱动器以外都为 Supermount" - -#~ msgid "Rescue partition table" -#~ msgstr "抢救分区表" - -#~ msgid "Removable media automounting" -#~ msgstr "自动装载可移动介质" - -#~ msgid "Trying to rescue partition table" -#~ msgstr "正在尝试恢复分区表" - -#~ msgid "" -#~ "Use local for all authentication and information user tell in local file" -#~ msgstr "使用本地进行全部身份验证并在本地文件中存储关于用户的信息" - -#~ msgid "Accept/Refuse bogus IPv4 error messages." -#~ msgstr "允许/拒绝 bogus IPv4 错误消息。" - -#~ msgid "Accept/Refuse broadcasted icmp echo." -#~ msgstr "允许/拒绝广播 ICMP 回应。" - -#~ msgid "Accept/Refuse icmp echo." -#~ msgstr "允许/拒绝 ICMP 回应。" - -#~ msgid "Allow/Forbid remote root login." -#~ msgstr "允许/禁止远程 root 登录。" - -#~ msgid "Enable/Disable IP spoofing protection." -#~ msgstr "启用/禁用 IP 欺骗保护。" - -#~ msgid "Enable/Disable libsafe if libsafe is found on the system." -#~ msgstr "启用/禁用 libsafe, 若在系统中发现 libsafe。" - -#~ msgid "Enable/Disable the logging of IPv4 strange packets." -#~ msgstr "启用/禁用 IPv4 异常包日志。" - -#~ msgid "Enable/Disable msec hourly security check." -#~ msgstr "启用/禁用 msec 每小时安全检查。" - -#~ msgid "Icon" -#~ msgstr "图标" - -#~ msgid "Number of capture buffers:" -#~ msgstr "捕获缓冲区数量: " - -#~ msgid "number of capture buffers for mmap'ed capture" -#~ msgstr "用于 mmap 捕获的缓冲区数量" - -#~ msgid "PLL setting:" -#~ msgstr "PLL 设置: " - -#~ msgid "Radio support:" -#~ msgstr "无线电支持: " - -#~ msgid "enable radio support" -#~ msgstr "启用无线电支持" - -#~ msgid " [--skiptest] [--cups] [--lprng] [--lpd] [--pdq]" -#~ msgstr " [--skiptest] [--cups] [--lprng] [--lpd] [--pdq]" |