aboutsummaryrefslogtreecommitdiffstats
path: root/installer/6/pt_br/content/selectInstallClass.html
blob: 6e9bf9f6307301feb4b624565f9eacbb2d5742e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
    <meta http-equiv="X-UA-Compatible" content="IE=7"/>
    <title>Instalar ou atualizar</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.75.2"/><link rel="home" href="index.html" title="Instalando com DrakX"/><link rel="up" href="index.html" title="Instalando com DrakX"/><link rel="prev" href="setupSCSI.html" title="Detecção de disco rígido"/><link rel="next" href="selectKeyboard.html" title="Teclado"/><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><script type="text/javascript">
      //The id for tree cookie
      var treeCookieId = "treeview-2206";
      var language = "en";
      var w = new Object();
      //Localization
      txt_filesfound = 'Resultados';
      txt_enter_at_least_1_char = "Você deve digitar pelo menos um caractere.";
      txt_browser_not_supported = "Javascript está desativado em seu navegador. Por favor ativar o JavaScript para desfrutar de todas as funcionalidades deste site.";
      txt_please_wait = "Por favor, aguarde. Pesquisa em andamento...";
      txt_results_for = "Resultados para:";
      txt_no_results_for = "";
    </script><style type="text/css">
      input {
      margin-bottom: 5px;
      margin-top: 2px;
      }

      .folder {
      display: block;
      height: 22px;
      padding-left: 20px;
      background: transparent url(../../common/jquery/treeview/images/folder.gif) 0 0px no-repeat;
      }
      
    </style><link rel="shortcut icon" href="favicon.png" type="image/x-icon"/><link rel="stylesheet" type="text/css" href="../../common/css/positioning.css"/><link rel="stylesheet" type="text/css" href="../../common/jquery/theme-redmond/jquery-ui-1.8.2.custom.css"/><link rel="stylesheet" type="text/css" href="../../common/jquery/treeview/jquery.treeview.css"/><link rel="stylesheet" type="text/css" href="webhelp-default.css"/><link rel="stylesheet" type="text/css" href="webhelp-custom.css"/><script type="text/javascript" src="../../common/jquery/jquery-1.4.2.min.js"><!----></script><script type="text/javascript" src="../../common/jquery/jquery-ui-1.8.2.custom.min.js"><!----></script><script type="text/javascript" src="../../common/jquery/jquery.cookie.js"><!----></script><script type="text/javascript" src="../../common/jquery/treeview/jquery.treeview.min.js"><!----></script><script type="text/javascript" src="search/htmlFileList.js"><!----></script><script type="text/javascript" src="search/htmlFileInfoList.js"><!----></script><script type="text/javascript" src="nwSearchFnt.js"><!----></script><script type="text/javascript" src="search/stemmers/en_stemmer.js"><!--//make this scalable to other languages as well.--></script><script type="text/javascript" src="search/index-1.js"><!----></script><script type="text/javascript" src="search/index-2.js"><!----></script><script type="text/javascript" src="search/index-3.js"><!----></script></head><body><div xmlns="" id="header"><div id="navheader"><!----><table><tr><td style="height: 28px; width: 16px;"><a id="showHideButton" onclick="showHideToc();" class="pointLeft" title="Hide TOC tree">.
	    </a></td><td><img src="../../common/images/highlight-blue.gif" alt="H" height="25px" onclick="toggleHighlight()" id="showHideHighlight" style="cursor:pointer" title="Busca alternada para realcar o resultado"/></td><td><a accesskey="p" href="setupSCSI.html">Anterior</a> 
		|
		<a accesskey="n" href="selectKeyboard.html">Próxima</a></td></tr></table></div><div id="headerlogo"><img src="mageia-2013-200p.png" alt="Company Logo"/></div><h1 id="pagetitle">Instalar ou atualizar<br/> </h1></div><div id="content"><!----><div xml:lang="pt_BR" class="section" title="Instalar ou atualizar"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="selectInstallClass"><!----></a>Instalar ou atualizar</h2></div></div></div><div class="mediaobject" align="center"><img src="images/dx2-selectInstallClass.png" align="middle"/></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Instalar</p><p>Utilize esta opção para uma nova instalação
<span class="application">Mageia</span>.  .</p></li><li class="listitem"><p>Atualizar</p><p>Se você tiver um ou mais <span class="application">Mageia</span> instalações em
seu sistema, o instalador irá permitir que você atualize um deles para a
versão mais recente.</p><div class="warning" title="Atenção" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Atenção</h3><p>Só atualizando a partir de uma versão anterior que Mageia<span class="emphasis"><em>ainda
suportado</em></span> quando a versão deste instalador foi lançado, foi
exaustivamente testado. Se você deseja atualizar uma versão Mageia que já
tinha chegado ao fim	of da  vida quando este foi lançado, então é melhor
fazer uma instalação limpa, preservando o sua partição
<code class="literal">/home</code>.</p></div></li></ul></div><div class="note" title="Nota" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Nota</h3><p>Se durante a instalação você decidir interromper a instalação, é possível
reiniciar, mas por favor, pense duas vezes antes de fazer isso. Uma vez que
a partição tenha sido formatada ou atualizações começaram a ser instaladas,
o computador não estará mais no mesmo estado e reiniciar ele poderia muito
bem deixá-lo com um sistema inutilizável. Se, apesar isso, você está muito
certo de você quer reiniciar, vá para um terminal de texto, pressione as
três teclas <span class="guilabel">Alt Ctrl F2</span>, ao mesmo tempo. Depois disso,
pressione <span class="guilabel">Alt Ctrl Delete</span> simultaneamente para
reiniciar.</p></div><div class="tip" title="Dica" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Dica</h3><p>Se você descobriu que você esqueceu de selecionar um idioma adicional, você
pode retornar a partir da tela "Instalar ou Atualizar" para a tela de
escolha de idioma pressionando <span class="guilabel">Alt Ctrl
Home</span>. <span class="emphasis"><em>Não</em></span> faça isso mais tarde na
instalação.</p></div></div><script xmlns="" type="text/javascript" src="main.js"><!----></script><hr xmlns=""/><div xmlns="" class="copyright">© Mageia</div><div xmlns="" class="license"><a href="index.html#CC_BY-SA">CC BY-SA 3.0</a></div><div id="upload_date">Uploaded on 14/07/2017</div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="setupSCSI.html">Anterior</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="selectKeyboard.html">Próxima</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Principal</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></div><div><div id="leftnavigation"><div id="tabs"><ul><li><a href="#treeDiv"><em>conteúdo</em></a></li><li><a href="#searchDiv"><em>Pesquisa</em></a></li></ul><div id="treeDiv"><img src="../../common/images/loading.gif" alt="loading table of contents..." id="tocLoading" style="display:block;"/><div id="ulTreeDiv" style="display:none"><ul id="tree" class="filetree"><li><span class="file section"><a href="Select-and-use-ISOs.html">Selecionar e usar ISOs</a></span><ul><li><span class="file section"><a href="Select-and-use-ISOs.html#d4e18">Introdução</a></span></li><li><span class="file section"><a href="Select-and-use-ISOs.html#d4e28">Mídia</a></span><ul><li><span class="file section"><a href="Select-and-use-ISOs.html#d4e30">Definição</a></span></li><li><span class="file section"><a href="Select-and-use-ISOs.html#d4e35">Classical installation media</a></span><ul><li><span class="file section"><a href="Select-and-use-ISOs.html#d4e37">características comuns</a></span></li></ul></li><li><span class="file section"><a href="Select-and-use-ISOs.html#d4e52">Mídia Live</a></span><ul><li><span class="file section"><a href="Select-and-use-ISOs.html#d4e54">características comuns</a></span></li><li><span class="file section"><a href="Select-and-use-ISOs.html#d4e68">Live DVD Plasma</a></span></li><li><span class="file section"><a href="Select-and-use-ISOs.html#d4e77">Live DVD GNOME</a></span></li><li><span class="file section"><a href="Select-and-use-ISOs.html#d4e86">Live DVD Xfce</a></span></li></ul></li><li><span class="file section"><a href="Select-and-use-ISOs.html#d4e95">Mídia de CD somente de Inicialização</a></span><ul><li><span class="file section"><a href="Select-and-use-ISOs.html#d4e97">características comuns</a></span></li><li><span class="file section"><a href="Select-and-use-ISOs.html#d4e108">netinstall.iso</a></span></li><li><span class="file section"><a href="Select-and-use-ISOs.html#d4e113">netinstall-nonfree.iso</a></span></li></ul></li></ul></li><li><span class="file section"><a href="Select-and-use-ISOs.html#d4e118">Baixando e checando Mídia</a></span><ul><li><span class="file section"><a href="Select-and-use-ISOs.html#d4e120">Baixando</a></span></li><li><span class="file section"><a href="Select-and-use-ISOs.html#d4e132">Verificar a integridade da mídia baixada</a></span></li></ul></li><li><span class="file section"><a href="Select-and-use-ISOs.html#d4e145">Queimar ou despejar a ISO</a></span><ul><li><span class="file section"><a href="Select-and-use-ISOs.html#d4e148">Gravando a ISO para o CD/DVD</a></span></li><li><span class="file section"><a href="Select-and-use-ISOs.html#d4e153">Despejar a ISO para um pendrive USB </a></span><ul><li><span class="file section"><a href="Select-and-use-ISOs.html#d4e159">Usando uma ferramenta gráfica do Mageia</a></span></li><li><span class="file section"><a href="Select-and-use-ISOs.html#d4e163">Usando uma ferramenta gráfica do Windows</a></span></li><li><span class="file section"><a href="Select-and-use-ISOs.html#d4e170">Usando linha de comando dentro de um sistema GNU/Linux</a></span></li></ul></li></ul></li></ul></li><li><span class="file section"><a href="installer.html">DrakX, o Instalador da Mageia</a></span><ul><li><span class="file section"><a href="installer.html#d4e217">Primeira Tela da Instalação</a></span><ul><li><span class="file section"><a href="installer.html#d4e219">Usando um DVD Mageia</a></span></li><li><span class="file section"><a href="installer.html#d4e283">Usando uma Rede Cabeada</a></span></li></ul></li><li><span class="file section"><a href="installer.html#d4e293">As etapas de instalação</a></span></li><li><span class="file section"><a href="installer.html#d4e304">Problemas de Instalação e Possíveis Soluções</a></span><ul><li><span class="file section"><a href="installer.html#d4e306">Sem Interface Gráfica</a></span></li><li><span class="file section"><a href="installer.html#d4e314">A Instalação Congela</a></span></li><li><span class="file section"><a href="installer.html#d4e318">problema RAM</a></span></li><li><span class="file section"><a href="installer.html#d4e323">partições dinâmicas</a></span></li></ul></li><li><span class="file section"><a href="installer.html#d4e327"/></span></li></ul></li><li><span class="file section"><a href="selectLanguage.html">Por favor, escolha um idioma para usar</a></span></li><li><span class="file section"><a href="acceptLicense.html">Licenças e Notas de Lançamento</a></span><ul><li><span class="file section"><a href="acceptLicense.html#license">Acordo de Licença</a></span></li><li><span class="file section"><a href="acceptLicense.html#releaseNotes">Notas de Lançamento</a></span></li></ul></li><li><span class="file section"><a href="setupSCSI.html">Detecção de disco rígido</a></span></li><li id="webhelp-currentid"><span class="file section"><a href="selectInstallClass.html">Instalar ou atualizar</a></span></li><li><span class="file section"><a href="selectKeyboard.html">Teclado</a></span></li><li><span class="file section"><a href="doPartitionDisks.html">Particionamento</a></span></li><li><span class="file section"><a href="ask_mntpoint_s.html">Escolha os pontos de montagem</a></span></li><li><span class="file section"><a href="takeOverHdConfirm.html">Confirme o disco rígido para ser formatado</a></span></li><li><span class="file section"><a href="diskdrake.html">Personalização do particionamento de disco com DiskDrake</a></span></li><li><span class="file section"><a href="formatPartitions.html">Formatação</a></span></li><li><span class="file section"><a href="add_supplemental_media.html">Seleção de Mídia (Configurar a Instalação de Mídias Suplementares )</a></span></li><li><span class="file section"><a href="media_selection.html">Seleção de Mídia (Nonfree)</a></span></li><li><span class="file section"><a href="chooseDesktop.html">Seleção de Área de Trabalho</a></span></li><li><span class="file section"><a href="choosePackageGroups.html">Seleção de Grupo de Pacotes</a></span></li><li><span class="file section"><a href="minimal-install.html">Instalação Mínima</a></span></li><li><span class="file section"><a href="choosePackagesTree.html">Escolha Pacotes Individuais</a></span></li><li><span class="file section"><a href="addUser.html">Gerenciador de Usuário e Superusuário</a></span><ul><li><span class="file section"><a href="addUser.html#root-password">Definir senha do administrador (root):</a></span></li><li><span class="file section"><a href="addUser.html#enterUser">Digite um usuário</a></span></li><li><span class="file section"><a href="addUser.html#addUserAdvanced">Gerenciamento Avançado de Usuários</a></span></li></ul></li><li><span class="file section"><a href="configureX_chooser.html">Configuração da placa de vídeo e monitor</a></span></li><li><span class="file section"><a href="configureX_card_list.html">Escolha um Servidor X (Configure sua Placa de Vídeo)</a></span></li><li><span class="file section"><a href="configureX_monitor.html">Escolhendo seu Monitor</a></span></li><li><span class="file section"><a href="setupBootloader.html">Principais Opções do Gerenciador de Inicialização</a></span><ul><li><span class="file section"><a href="setupBootloader.html#d4e844">Interface do Bootloader</a></span><ul><li><span class="file section"><a href="setupBootloader.html#d4e854">Grub2 em sistemas Legacy / MBR e Legacy / GPT</a></span></li><li><span class="file section"><a href="setupBootloader.html#d4e860">Grub2-efi nos sistemas UEFI</a></span></li></ul></li><li><span class="file section"><a href="setupBootloader.html#d4e868">Usando o Gerenciador de Inicialização da Mageia</a></span></li><li><span class="file section"><a href="setupBootloader.html#d4e882">Usando um Gerenciador de Inicialização existente</a></span></li><li><span class="file section"><a href="setupBootloader.html#d4e885">Usando o carregamento de corrente</a></span></li><li><span class="file section"><a href="setupBootloader.html#d4e899">Opções</a></span><ul><li><span class="file section"><a href="setupBootloader.html#d4e901">Primeira pagina</a></span></li><li><span class="file section"><a href="setupBootloader.html#d4e933">Próxima Pagina</a></span></li></ul></li></ul></li><li><span class="file section"><a href="setupBootloaderAddEntry.html">Adicionando ou Modificando uma Entrada do Menu de Inicialização</a></span></li><li><span class="file section"><a href="misc-params.html">Resumo de diversos parâmetros</a></span><ul><li><span class="file section"><a href="misc-params.html#misc-params-system">Parâmetros do Sistema</a></span></li><li><span class="file section"><a href="misc-params.html#misc-params-hardware">Parâmetro de Hardware</a></span></li><li><span class="file section"><a href="misc-params.html#misc-params-network">Parâmetros de rede e internet</a></span></li><li><span class="file section"><a href="misc-params.html#misc-params-security">Segurança</a></span></li></ul></li><li><span class="file section"><a href="configureTimezoneUTC.html">Configure o seu fuso horário</a></span></li><li><span class="file section"><a href="selectCountry.html">Selecione seu país / região</a></span><ul><li><span class="file section"><a href="selectCountry.html#inputMethod">Método de entrada</a></span></li></ul></li><li><span class="file section"><a href="configureServices.html">Configurar os seus serviços</a></span></li><li><span class="file section"><a href="selectMouse.html">Selecione o mouse</a></span></li><li><span class="file section"><a href="soundConfig.html">Configuração de Som</a></span><ul><li><span class="file section"><a href="soundConfig.html#soundConfig-Advanced">Avançado</a></span></li></ul></li><li><span class="file section"><a href="securityLevel.html">Nível de Segurança</a></span></li><li><span class="file section"><a href="firewall.html">Firewall</a></span></li><li><span class="file section"><a href="installUpdates.html">Atualizações</a></span></li><li><span class="file section"><a href="exitInstall.html">Parabéns</a></span></li><li><span class="file section"><a href="uninstall-Mageia.html">Desinstalando o Mageia</a></span><ul><li><span class="file section"><a href="uninstall-Mageia.html#d4e1212">Como</a></span></li></ul></li></ul></div></div><div id="searchDiv"><div id="search"><form onsubmit="Verifie(ditaSearch_Form);return false" name="ditaSearch_Form" class="searchForm"><fieldset class="searchFieldSet"><legend>Pesquisa</legend><center><input id="textToSearch" name="textToSearch" type="text" class="searchText"/> &nbsp; <input onclick="Verifie(ditaSearch_Form)" type="button" class="searchButton" value="Go" id="doSearch"/></center></fieldset></form></div><div id="searchResults"><center/></div></div></div></div></div></body></html>
"hl slc">#- avoid inserting it twice as another entry already exists ! $_->{label} = "old${freeold}_$_->{label}"; } } push @$entries, $v; } sub add_kernel { my ($prefix, $lilo, $version, $ext, $root, $v) = @_; #- new versions of yaboot don't handle symlinks my $ppcext = $ext; if (arch() =~ /ppc/) { $ext = "-$version"; } log::l("adding vmlinuz$ext as vmlinuz-$version"); -e "$prefix/boot/vmlinuz-$version" or log::l("unable to find kernel image $prefix/boot/vmlinuz-$version"), return; my $image = "/boot/vmlinuz" . ($ext ne "-$version" && symlinkf("vmlinuz-$version", "$prefix/boot/vmlinuz$ext") ? $ext : "-$version"); my $initrd = "/boot/initrd-$version.img"; mkinitrd($prefix, $version, $initrd) or undef $initrd; if ($initrd && $ext ne "-$version") { $initrd = "/boot/initrd$ext.img"; symlinkf("initrd-$version.img", "$prefix$initrd") or cp_af("$prefix/boot/initrd-$version.img", "$prefix$initrd"); } my $label = $ext =~ /-(default)/ ? $1 : "linux$ext"; #- more yaboot concessions - PPC if (arch() =~ /ppc/) { $label = $ppcext =~ /-(default)/ ? $1 : "linux$ppcext"; } add2hash($v, { type => 'image', root => "/dev/$root", label => $label, kernel_or_dev => $image, initrd => $initrd, append => $lilo->{perImageAppend}, }); add_entry($lilo->{entries}, $v); $v; } sub unpack_append { my ($s) = @_; my @l = split(' ', $s); [ grep { !/=/ } @l ], [ map { if_(/(.*?)=(.*)/, [$1, $2]) } @l ]; } sub pack_append { my ($simple, $dict) = @_; join(' ', @$simple, map { "$_->[0]=$_->[1]" } @$dict); } sub append__mem_is_memsize { $_[0] =~ /^\d+[kM]?$/i } sub get_append { my ($b, $key) = @_; my (undef, $dict) = unpack_append($b->{perImageAppend}); my @l = map { $_->[1] } grep { $_->[0] eq $key } @$dict; #- suppose we want the memsize @l = grep { append__mem_is_memsize($_) } @l if $key eq 'mem'; log::l("more than one $key in $b->{perImageAppend}") if @l > 1; $l[0]; } sub add_append { my ($b, $key, $val) = @_; foreach (\$b->{perImageAppend}, map { \$_->{append} } grep { $_->{type} eq 'image' } @{$b->{entries}}) { my ($simple, $dict) = unpack_append($$_); @$dict = grep { $_->[0] ne $key || $key eq 'mem' && append__mem_is_memsize($_->[1]) != append__mem_is_memsize($val) } @$dict; push @$dict, [ $key, $val ] if $val; $$_ = pack_append($simple, $dict); log::l("add_append: $$_"); } } sub may_append { my ($b, $key, $val) = @_; add_append($b, $key, $val) if !get_append($b, $key); } sub configure_entry($$) { my ($prefix, $entry) = @_; if ($entry->{type} eq 'image') { my $specific_version; $entry->{kernel_or_dev} =~ /vmlinu.-(.*)/ and $specific_version = $1; readlink("$prefix/$entry->{kernel_or_dev}") =~ /vmlinu.-(.*)/ and $specific_version = $1; if ($specific_version) { $entry->{initrd} or $entry->{initrd} = "/boot/initrd-$specific_version.img"; mkinitrd($prefix, $specific_version, $entry->{initrd}) or undef $entry->{initrd}; } } $entry; } sub dev2prompath { #- SPARC only my ($dev) = @_; my ($wd, $num) = $dev =~ /^(.*\D)(\d*)$/; require c; $dev = c::disk2PromPath($wd) and $dev = $dev =~ /^sd\(/ ? "$dev$num" : "$dev;$num"; $dev; } sub get_kernels_and_labels { my ($prefix) = @_; my $dir = "$prefix/boot"; my @l = grep { /^vmlinuz-/ } all($dir); my @kernels = grep { ! -l "$dir/$_" } @l; my @preferred = ('', 'secure', 'enterprise', 'smp'); my %weights = map_index { $_ => $::i } @preferred; require pkgs; @kernels = sort { c::rpmvercmp($b->[1], $a->[1]) || $weights{$a->[2]} <=> $weights{$b->[2]} } map { if (my ($version, $ext) = /vmlinuz-((?:[\-.\d]*(?:mdk)?)*)(.*)/) { [ "$version$ext", $version, $ext ]; } else { log::l("non recognised kernel name $_"); (); } } @kernels; my %majors; foreach (@kernels) { push @{$majors{$1}}, $_ if $_->[1] =~ /^(2\.\d+)/ } while (my ($major, $l) = each %majors) { $l->[0][1] = $major if @$l == 1; } my %labels; foreach (@kernels) { my ($complete_version, $version, $ext) = @$_; my $label = ''; if (exists $labels{$label}) { $label = "-$ext"; if (!$ext || $labels{$label}) { $label = "-$version$ext"; } } $labels{$label} = $complete_version; } %labels; } sub suggest { my ($prefix, $lilo, $hds, $fstab, $vga_fb, $quiet) = @_; my $root_part = fsedit::get_root($fstab); my $root = isLoopback($root_part) ? "loop7" : $root_part->{device}; my $boot = fsedit::get_root($fstab, 'boot')->{device}; my $partition = first($boot =~ /\D*(\d*)/); #- PPC xfs module requires enlarged initrd my $xfsroot = isThisFs("xfs", $root_part); require c; c::initSilo() if arch() =~ /sparc/; my ($onmbr, $unsafe) = $lilo->{crushMbr} ? (1, 0) : suggest_onmbr($hds); add2hash_($lilo, arch() =~ /sparc/ ? { entries => [], timeout => 10, use_partition => 0, #- we should almost always have a whole disk partition. root => "/dev/$root", partition => $partition || 1, boot => $root eq $boot && "/boot", #- this helps for getting default partition for silo. } : arch() =~ /ppc/ ? { defaultos => "linux", entries => [], 'init-message' => "Welcome to Mandrake Linux!", delay => 30, #- OpenFirmware delay timeout => 50, enableofboot => 1, enablecdboot => 1, useboot => $boot, xfsroot => $xfsroot, } : { bootUnsafe => $unsafe, entries => [], timeout => $onmbr && 10, nowarn => 1, if_(arch() !~ /ia64/, lba32 => 1, boot => "/dev/" . ($onmbr ? $hds->[0]{device} : fsedit::get_root($fstab, 'boot')->{device}), map => "/boot/map", ), }); if (!$lilo->{message} || $lilo->{message} eq "1") { $lilo->{message} = join('', cat_("$prefix/boot/message")); if (!$lilo->{message}) { my $msg_en = #-PO: these messages will be displayed at boot time in the BIOS, use only ASCII (7bit) __("Welcome to %s the operating system chooser! Choose an operating system in the list above or wait %d seconds for default boot. "); my $msg = translate($msg_en); #- use the english version if more than 20% of 8bits chars $msg = $msg_en if int(grep { $_ & 0x80 } unpack "c*", $msg) / length($msg) > 0.2; $lilo->{message} = sprintf $msg, arch() =~ /sparc/ ? "SILO" : "LILO", $lilo->{timeout}; } } add2hash_($lilo, { memsize => $1 }) if cat_("/proc/cmdline") =~ /\bmem=(\d+[KkMm]?)(?:\s.*)?$/; if (my ($s, $port, $speed) = cat_("/proc/cmdline") =~ /console=(ttyS(\d),(\d+)\S*)/) { log::l("serial console $s $port $speed"); add_append($lilo, 'console' => $s); any::set_login_serial_console($prefix, $port, $speed); } my %labels = get_kernels_and_labels($prefix); $labels{''} or die "no kernel installed"; while (my ($ext, $version) = each %labels) { my $entry = add_kernel($prefix, $lilo, $version, $ext, $root, { if_($vga_fb && $ext eq '', vga => $vga_fb), #- using framebuffer }); $entry->{append} .= " quiet" if $vga_fb && $version !~ /smp|enterprise/ && $quiet; if ($vga_fb && $ext eq '') { add_kernel($prefix, $lilo, $version, $ext, $root, { label => 'linux-nonfb' }); } } my $failsafe = add_kernel($prefix, $lilo, $labels{''}, '', $root, { label => 'failsafe' }); $failsafe->{append} =~ s/devfs=mount/devfs=nomount/; $failsafe->{append} .= " failsafe"; if (arch() =~ /sparc/) { #- search for SunOS, it could be a really better approach to take into account #- partition type for mounting point. my $sunos = 0; foreach (@$hds) { foreach (@{$_->{primary}{normal}}) { my $path = $_->{device} =~ m|^/| && $_->{device} !~ m|^/dev/| ? $_->{device} : dev2prompath($_->{device}); add_entry($lilo->{entries}, { type => 'other', kernel_or_dev => $path, label => "sunos" . ($sunos++ ? $sunos : ''), }) if $path && isSunOS($_) && type2name($_->{type}) =~ /root/i; } } } elsif (arch() =~ /ppc/) { #- if we identified a MacOS partition earlier - add it if (defined $partition_table::mac::macos_part) { add_entry($lilo->{entries}, { label => "macos", kernel_or_dev => $partition_table::mac::macos_part }); } } elsif (arch() !~ /ia64/) { #- search for dos (or windows) boot partition. Don't look in extended partitions! my %nbs; foreach (@$hds) { foreach (@{$_->{primary}{normal}}) { my $label = isNT($_) ? 'NT' : isDos($_) ? 'dos' : 'windows'; add_entry($lilo->{entries}, { type => 'other', kernel_or_dev => "/dev/$_->{device}", label => $label . ($nbs{$label}++ ? $nbs{$label} : ''), if_($_->{device} =~ /[1-4]$/, table => "/dev/$_->{rootDevice}" ), unsafe => 1 }) if isNT($_) || isFat($_) && isFat({ type => fsedit::typeOfPart($_->{device}) }); } } } foreach ('secure', 'enterprise', 'smp') { if (get_label("linux-$_", $lilo)) { $lilo->{default} ||= "linux-$_"; last; } } $lilo->{default} ||= "linux"; my %l = ( yaboot => to_bool(arch() =~ /ppc/), silo => to_bool(arch() =~ /sparc/), lilo => to_bool(arch() !~ /sparc|ppc/) && !isLoopback(fsedit::get_root($fstab)), grub => to_bool(arch() !~ /sparc|ppc/ && !isRAID(fsedit::get_root($fstab))), loadlin => to_bool(arch() !~ /sparc|ppc/) && -e "/initrd/loopfs/lnx4win", ); unless ($lilo->{methods}) { $lilo->{methods} ||= { map { $_ => 1 } grep { $l{$_} } keys %l }; if ($lilo->{methods}{lilo} && -e "$prefix/boot/message-graphic") { $lilo->{methods}{lilo} = "lilo-graphic"; exists $lilo->{methods}{grub} and $lilo->{methods}{grub} = undef; } } } sub suggest_floppy { my ($bootloader) = @_; my $floppy = detect_devices::floppy() or return; $floppy eq 'fd0' or log::l("suggest_floppy: not adding $floppy"), return; add_entry($bootloader->{entries}, { type => 'other', kernel_or_dev => '/dev/fd0', label => 'floppy', unsafe => 1 }); } sub keytable($$) { my ($prefix, $f) = @_; local $_ = $f; if ($_ && !/\.klt$/) { $f = "/boot/$_.klt"; run_program::rooted($prefix, "keytab-lilo.pl", ">", $f, $_) or undef $f; } $f && -r "$prefix/$f" && $f; } sub has_profiles { to_bool(get_label("office", $b)) } sub set_profiles { my ($b, $want_profiles) = @_; my $office = get_label("office", $b); if ($want_profiles xor $office) { my $e = get_label("linux", $b); if ($want_profiles) { push @{$b->{entries}}, { %$e, label => "office", append => "$e->{append} prof=Office" }; $e->{append} .= " prof=Home"; } else { # remove profiles $e->{append} =~ s/\s*prof=\w+//; @{$b->{entries}} = grep { $_ != $office } @{$b->{entries}}; } } } sub get_of_dev($$) { my ($prefix, $unix_dev) = @_; #- don't care much for this - need to run ofpath rooted, and I need the result #- In test mode, just run on "/", otherwise you can't get to the /proc files if ($::testing) { $prefix = ""; } run_program::rooted_or_die($prefix, "/usr/local/sbin/ofpath $unix_dev", ">", "/tmp/ofpath"); open(FILE, "$prefix/tmp/ofpath") || die "Can't open $prefix/tmp/ofpath"; my $of_dev = ""; local $_ = ""; while (<FILE>){ $of_dev = $_; } chop($of_dev); my @del_file = ($prefix . "/tmp/ofpath"); unlink (@del_file); log::l("OF Device: $of_dev"); $of_dev; } sub install_yaboot($$$) { my ($prefix, $lilo, $fstab, $hds) = @_; $lilo->{prompt} = $lilo->{timeout}; if ($lilo->{message}) { local *F; open F, ">$prefix/boot/message" and print F $lilo->{message} or $lilo->{message} = 0; } { local *F; local $\ = "\n"; my $f = "$prefix/etc/yaboot.conf"; open F, ">$f" or die "cannot create yaboot config file: $f"; log::l("writing yaboot config to $f"); print F "#yaboot.conf - generated by DrakX"; print F "init-message=\"\\n$lilo->{'init-message'}\\n\"" if $lilo->{'init-message'}; if ($lilo->{boot}) { print F "boot=$lilo->{boot}"; my $of_dev = get_of_dev($prefix, $lilo->{boot}); print F "ofboot=$of_dev"; } else { die "no bootstrap partition defined." } $lilo->{$_} and print F "$_=$lilo->{$_}" foreach qw(delay timeout); print F "install=/usr/local/lib/yaboot/yaboot"; print F "magicboot=/usr/local/lib/yaboot/ofboot"; $lilo->{$_} and print F $_ foreach qw(enablecdboot enableofboot); $lilo->{$_} and print F "$_=$lilo->{$_}" foreach qw(defaultos default); #- print F "nonvram"; my $boot = "/dev/" . $lilo->{useboot} if $lilo->{useboot}; foreach (@{$lilo->{entries}}) { if ($_->{type} eq "image") { my $of_dev = ''; if (($boot !~ /$_->{root}/) && $boot) { $of_dev = get_of_dev($prefix, $boot); print F "$_->{type}=$of_dev," . substr($_->{kernel_or_dev}, 5); } else { $of_dev = get_of_dev($prefix, $_->{root}); print F "$_->{type}=$of_dev,$_->{kernel_or_dev}"; } print F "\tlabel=", substr($_->{label}, 0, 15); #- lilo doesn't handle more than 15 char long labels print F "\troot=$_->{root}"; if (($boot !~ /$_->{root}/) && $boot) { print F "\tinitrd=$of_dev," . substr($_->{initrd}, 5) if $_->{initrd}; } else { print F "\tinitrd=$of_dev,$_->{initrd}" if $_->{initrd}; } #- xfs module on PPC requires larger initrd - say 6MB? print F "\tinitrd-size=6144" if $lilo->{xfsroot}; print F "\tappend=\" $_->{append}\"" if $_->{append}; print F "\tread-write" if $_->{'read-write'}; print F "\tread-only" if !$_->{'read-write'}; } else { my $of_dev = get_of_dev($prefix, $_->{kernel_or_dev}); print F "$_->{label}=$of_dev"; } } } log::l("Installing boot loader..."); my $f = "$prefix/tmp/of_boot_dev"; my $of_dev = get_of_dev($prefix, $lilo->{boot}); output($f, "$of_dev\n"); $::testing and return; if (defined $install_steps_interactive::new_bootstrap) { run_program::run("hformat", "$lilo->{boot}") or die "hformat failed"; } run_program::rooted_or_die($prefix, "/sbin/ybin", "2>", "/tmp/.error"); unlink "$prefix/tmp/.error"; } sub install_silo($$$) { my ($prefix, $silo, $fstab) = @_; my $boot = fsedit::get_root($fstab, 'boot')->{device}; my ($wd, $num) = $boot =~ /^(.*\D)(\d*)$/; #- setup boot promvars for. require c; if ($boot =~ /^md/) { #- get all mbr devices according to /boot are listed, #- then join all zero based partition translated to prom with ';'. #- keep bootdev with the first of above. log::l("/boot is present on raid partition which is not currently supported for promvars"); } else { if (!$silo->{use_partition}) { foreach (@$fstab) { if (!$_->{start} && $_->{device} =~ /$wd/) { $boot = $_->{device}; log::l("found a zero based partition in $wd as $boot"); last; } } } $silo->{bootalias} = c::disk2PromPath($boot); $silo->{bootdev} = $silo->{bootalias}; log::l("preparing promvars for device=$boot"); } c::hasAliases() or log::l("clearing promvars alias as non supported"), $silo->{bootalias} = ''; if ($silo->{message}) { local *F; open F, ">$prefix/boot/message" and print F $silo->{message} or $silo->{message} = 0; } { local *F; local $\ = "\n"; my $f = "$prefix/boot/silo.conf"; #- always write the silo.conf file in /boot ... symlinkf "../boot/silo.conf", "$prefix/etc/silo.conf"; #- ... and make a symlink from /etc. open F, ">$f" or die "cannot create silo config file: $f"; log::l("writing silo config to $f"); $silo->{$_} and print F "$_=$silo->{$_}" foreach qw(partition root default append); $silo->{$_} and print F $_ foreach qw(restricted); print F "password=", $silo->{password} if $silo->{restricted} && $silo->{password}; #- also done by msec print F "timeout=", round(10 * $silo->{timeout}) if $silo->{timeout}; print F "message=$silo->{boot}/message" if $silo->{message}; foreach (@{$silo->{entries}}) { #-my ($v, $e) = each %{$silo->{entries}}) { my $type = "$_->{type}=$_->{kernel_or_dev}"; $type =~ s|/boot|$silo->{boot}|; print F $type; print F "\tlabel=$_->{label}"; if ($_->{type} eq "image") { my $initrd = $_->{initrd}; $initrd =~ s|/boot|$silo->{boot}|; print F "\tpartition=$_->{partition}" if $_->{partition}; print F "\troot=$_->{root}" if $_->{root}; print F "\tinitrd=$initrd" if $_->{initrd}; print F "\tappend=\"$1\"" if $_->{append} =~ /^\s*"?(.*?)"?\s*$/; print F "\tread-write" if $_->{'read-write'}; print F "\tread-only" if !$_->{'read-write'}; } } } log::l("Installing boot loader..."); $::testing and return; run_program::rooted($prefix, "silo", "2>", "/tmp/.error", $silo->{use_partition} ? ("-t") : ()) or run_program::rooted_or_die($prefix, "silo", "2>", "/tmp/.error", "-p", "2", $silo->{use_partition} ? ("-t") : ()); unlink "$prefix/tmp/.error"; #- try writing in the prom. log::l("setting promvars alias=$silo->{bootalias} bootdev=$silo->{bootdev}"); require c; c::setPromVars($silo->{bootalias}, $silo->{bootdev}); } sub make_label_lilo_compatible { my ($label) = @_; $label = substr($label, 0, 15); #- lilo doesn't handle more than 15 char long labels $label =~ s/\s/_/g; #- lilo doesn't like spaces $label; } sub write_lilo_conf { my ($prefix, $lilo, $fstab, $hds) = @_; $lilo->{prompt} = $lilo->{timeout}; delete $lilo->{linear} if $lilo->{lba32}; my $file2fullname = sub { my ($file) = @_; if (arch() =~ /ia64/) { (my $part, $file) = fsedit::file2part($prefix, $fstab, $file); my %hds = map_index { $_ => "hd$::i" } map { $_->{device} } sort { isFat($b) <=> isFat($a) || $a->{device} cmp $b->{device} } fsedit::get_fstab(@$hds); $hds->{$part->{device}} . ":" . $file; } else { $file } }; my %bios2dev = map_index { $::i => $_ } dev2bios($hds, $lilo->{first_hd_device} || $lilo->{boot}); my %dev2bios = reverse %bios2dev; if (is_empty_hash_ref($lilo->{bios} ||= {})) { my $dev = $hds->[0]{device}; if ($dev2bios{$dev}) { log::l("Since we're booting on $bios2dev{0}, make it bios=0x80, whereas $dev is now " . (0x80 + $dev2bios{$dev})); $lilo->{bios}{"/dev/$bios2dev{0}"} = '0x80'; $lilo->{bios}{"/dev/$dev"} = sprintf("0x%x", 0x80 + $dev2bios{$dev}); } foreach (0 .. 3) { my ($letter) = $bios2dev{$_} =~ /hd([^ac])/; #- at least hda and hdc are handled correctly :-/ next if $lilo->{bios}{"/dev/$bios2dev{$_}"} || !$letter; next if $_ > 0 #- always print if first disk is hdb, hdd, hde... && $bios2dev{$_ - 1} eq "hd" . chr(ord($letter) - 1); #- no need to help lilo with hdb (resp. hdd, hdf...) log::l("Helping lilo: $bios2dev{$_} must be " . (0x80 + $_)); $lilo->{bios}{"/dev/$bios2dev{$_}"} = sprintf("0x%x", 0x80 + $_); } } { local *F; local $\ = "\n"; my $f = arch() =~ /ia64/ ? "$prefix/boot/efi/elilo.conf" : "$prefix/etc/lilo.conf"; open F, ">$f" or die "cannot create lilo config file: $f"; log::l("writing lilo config to $f"); chmod 0600, $f if $lilo->{password}; #- normalize: RESTRICTED is only valid if PASSWORD is set delete $lilo->{restricted} if !$lilo->{password}; local $lilo->{default} = make_label_lilo_compatible($lilo->{default}); $lilo->{$_} and print F "$_=$lilo->{$_}" foreach qw(boot map install vga default keytable); $lilo->{$_} and print F $_ foreach qw(linear lba32 compact prompt nowarn restricted); print F "append=\"$lilo->{append}\"" if $lilo->{append}; print F "password=", $lilo->{password} if $lilo->{password}; #- also done by msec print F "timeout=", round(10 * $lilo->{timeout}) if $lilo->{timeout}; print F "serial=", $1 if get_append($lilo, 'console') =~ /ttyS(.*)/; print F "message=/boot/message" if (arch() !~ /ia64/); print F "menu-scheme=wb:bw:wb:bw" if (arch() !~ /ia64/); print F "ignore-table" if grep { $_->{unsafe} && $_->{table} } @{$lilo->{entries}}; while (my ($dev, $bios) = each %{$lilo->{bios}}) { print F "disk=$dev bios=$bios"; } foreach (@{$lilo->{entries}}) { print F "$_->{type}=", $file2fullname->($_->{kernel_or_dev}); print F "\tlabel=", make_label_lilo_compatible($_->{label}); if ($_->{type} eq "image") { print F "\troot=$_->{root}" if $_->{root}; print F "\tinitrd=", $file2fullname->($_->{initrd}) if $_->{initrd}; print F "\tappend=\"$_->{append}\"" if $_->{append}; print F "\tvga=$_->{vga}" if $_->{vga}; print F "\tread-write" if $_->{'read-write'}; print F "\tread-only" if !$_->{'read-write'}; } else { print F "\ttable=$_->{table}" if $_->{table}; print F "\tunsafe" if $_->{unsafe} && !$_->{table}; if (my ($dev) = $_->{table} =~ m|/dev/(.*)|) { if ($dev2bios{$dev}) { #- boot off the nth drive, so reverse the BIOS maps my $nb = sprintf("0x%x", 0x80 + $dev2bios{$dev}); $_->{mapdrive} ||= { '0x80' => $nb, $nb => '0x80' }; } } while (my ($from, $to) = each %{$_->{mapdrive} || {}}) { print F "\tmap-drive=$from"; print F "\t to=$to"; } } } } } sub install_lilo { my ($prefix, $lilo, $fstab, $hds) = @_; $lilo->{install} = 'text' if $lilo->{methods}{lilo} eq 'lilo-text'; output("$prefix/boot/message-text", $lilo->{message}) if $lilo->{message}; symlinkf "message-" . ($lilo->{methods}{lilo} eq 'lilo-graphic' ? 'graphic' : 'text'), "$prefix/boot/message"; write_lilo_conf($prefix, $lilo, $fstab, $hds); log::l("Installing boot loader..."); $::testing and return; run_program::rooted_or_die($prefix, "lilo", "2>", "/tmp/.error") if (arch() !~ /ia64/); unlink "$prefix/tmp/.error"; } sub dev2bios { my ($hds, $where) = @_; $where =~ s|/dev/||; my @dev = map { $_->{device} } @$hds; member($where, @dev) or ($where) = @dev; #- if not on mbr, s/h(d[e-g])/x$1/ foreach $where, @dev; #- emulates ultra66 as xd_ my $start = substr($where, 0, 2); my $translate = sub { $_ eq $where ? "aaa" : #- if exact match, value it first /^$start(.*)/ ? "ad$1" : #- if same class (ide/scsi/ultra66), value it before other classes $_; }; @dev = map { $_->[0] } sort { $a->[1] cmp $b->[1] } map { [ $_, &$translate ] } @dev; s/x(d.)/h$1/ foreach @dev; #- switch back; @dev; } sub dev2grub { my ($dev, $dev2bios) = @_; $dev =~ m|^(/dev/)?(...)(.*)$| or die "dev2grub (bad device $dev), caller is " . join(":", caller()); my $grub = $dev2bios->{$2} or die "dev2grub ($2)"; "($grub" . ($3 && "," . ($3 - 1)) . ")"; } sub write_grub_config { my ($prefix, $lilo, $fstab, $hds) = @_; my %dev2bios = (