#!/usr/bin/perl
#
# Guillaume Cottenceau (gc@mandrakesoft.com)
#
# Copyright 2002 Mandrakesoft
#
# This software may be freely redistributed under the terms of the GNU
# public license.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#

sub arch() {
    my $t = `uname -m`;
    chomp $t;
    $t;
}
sub if_($@) {
    my $b = shift;
    $b or return ();
    wantarray || @_ <= 1 or die("if_ called in scalar context with more than one argument " . join(":", caller()));
    wantarray ? @_ : $_[0];
}
sub cat_ { local *F; open F, $_[0] or $_[1] ? die "cat of file $_[0] failed: $!\n" : return; my @l = <F>; wantarray ? @l : join '', @l }
sub member { my $e = shift; foreach (@_) { $e eq $_ and return 1 } 0 }

@known_boot_loaders = qw(lilo grub yaboot);

# keep this in sync with DrakX
@MBR_signatures = (
    [ 'empty', 0, "\0\0\0\0" ],
    [ 'grub', 0x6,  "GRUB" ],
    [ 'grub', 0, "\xEBG", 0x17d, "stage1 \0" ],
    [ 'grub', 0, "\xEBH", 0x17e, "stage1 \0" ],
    [ 'grub', 0, "\xEBH", 0x18a, "stage1 \0" ],
    [ 'grub', 0, "\xEBH", 0x181, "GRUB \0" ],
    [ 'lilo', 0x2,  "LILO" ],
    [ 'lilo', 0x6,  "LILO" ],
if_(arch() =~ /ppc/,
    map { [ 'yaboot', 0, "PM", 0x200 * $_ + 0x10, "bootstrap\0" ] } 0 .. 61
),
);

sub typeFromMagic {
    my $f = shift;
    local *F; sysopen F, $f, 0 or return;

    my $tmp;
  M: foreach (@MBR_signatures) {
	my ($name, @l) = @$_;
	while (@l) {
	    my ($offset, $signature) = splice(@l, 0, 2);
	    sysseek(F, $offset, 0) or next M;
	    sysread(F, $tmp, length $signature);
	    $tmp eq $signature or next M;
	}
	return $name;
    }
    return 0;
}


my (undef, undef, @parts) = cat_('/proc/partitions');

my @possibilities;

P: foreach (@parts) {
    my (undef, undef, $blocks, $dev) = split or next;
    next if $blocks <= 1;
    my $type = typeFromMagic("/dev/$dev");
    $type && member($type, @known_boot_loaders) and push @possibilities, [ $dev, $type ];
}

my $choice;

if (!@possibilities) {
    print "No known Linux bootloader has been found, nothing to do.\n";
} elsif (@possibilities == 1) {
    print "I've found a Linux bootloader only on </dev/$possibilities[0]->[0]>.\n\n";
    $choice = $possibilities[0];
} else {
    print "I've found the following Linux bootloaders:\n";
    my $i;
    print "\t", ++$i, ": <$_->[1]> \ton <$_->[0]>\n" foreach @possibilities;
    print "\n";
    print "Which disk/partition do you want to overwrite with the Windows bootloader?\n";
    print "\t<enter the number or press 'n' and Enter to cancel> ";
    <STDIN> !~ /^(\d+)$/i && $1 >= 1 and $choice = $possibilities[$1-1];
}

if ($choice) {
    print "I'm going to overwrite bootloader on </dev/$choice->[0]> with
Windows bootloader.

Ok? <press Enter to continue, 'n' and Enter to cancel> ";
    <STDIN> =~ /^n/i and exit 0;
    
    system("/bin/dd if=/usr/lib/extipl/aldebaran.bin of=/dev/$choice->[0]\n") and print "\tFailed!\n";
}

#-------------------------------------------------
#- $Log$
#- Revision 1.2  2004/07/20 02:42:12  prigaux
#- MandrakeSoft -> Mandrakesoft
#-
#- Revision 1.1  2002/02/27 13:31:30  gc
#- add "restore Windows Boot Loader" to rescue
#-
#-
tion value='topic/mlcd4'>topic/mlcd4</option>
<option value='topic/ppp'>topic/ppp</option>
<option value='topic/rp-pppoe'>topic/rp-pppoe</option>
<option value='topic/switching_to_dnf'>topic/switching_to_dnf</option>
<option value='topic/switching_to_urpmi'>topic/switching_to_urpmi</option>
<option value='topic/unlabeled-1.1.1'>topic/unlabeled-1.1.1</option>
<option value='topic/v_webmin_0_87'>topic/v_webmin_0_87</option>
<option value='topic/x86_64-branch'>topic/x86_64-branch</option>
<option value='user/animtim/designWork'>user/animtim/designWork</option>
<option value='user/colin/rescue-systemd'>user/colin/rescue-systemd</option>
<option value='user/ennael/mga6'>user/ennael/mga6</option>
<option value='user/erwan/bug-13680'>user/erwan/bug-13680</option>
<option value='user/jibz/aarch64'>user/jibz/aarch64</option>
<option value='user/martinw/mga6'>user/martinw/mga6</option>
<option value='user/pterjan/arm64'>user/pterjan/arm64</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>Mageia Installer and base platform for many utilities</td><td class='sub right'>Thierry Vignaud [tv]</td></tr></table>
<table class='tabs'><tr><td>
<a href='/software/drakx/?h=17.72'>summary</a><a href='/software/drakx/refs/?h=17.72&amp;id=28c1654615d322517d21f3e894c26be3ce9abbf9'>refs</a><a href='/software/drakx/log/tools/hd_grub.cgi?h=17.72'>log</a><a class='active' href='/software/drakx/tree/tools/hd_grub.cgi?h=17.72&amp;id=28c1654615d322517d21f3e894c26be3ce9abbf9'>tree</a><a href='/software/drakx/commit/tools/hd_grub.cgi?h=17.72&amp;id=28c1654615d322517d21f3e894c26be3ce9abbf9'>commit</a><a href='/software/drakx/diff/tools/hd_grub.cgi?h=17.72&amp;id=28c1654615d322517d21f3e894c26be3ce9abbf9'>diff</a><a href='/software/drakx/stats/tools/hd_grub.cgi?h=17.72'>stats</a></td><td class='form'><form class='right' method='get' action='/software/drakx/log/tools/hd_grub.cgi'>
<input type='hidden' name='h' value='17.72'/><input type='hidden' name='id' value='28c1654615d322517d21f3e894c26be3ce9abbf9'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/software/drakx/tree/?h=17.72&amp;id=28c1654615d322517d21f3e894c26be3ce9abbf9'>root</a>/<a href='/software/drakx/tree/tools?h=17.72&amp;id=28c1654615d322517d21f3e894c26be3ce9abbf9'>tools</a>/<a href='/software/drakx/tree/tools/hd_grub.cgi?h=17.72&amp;id=28c1654615d322517d21f3e894c26be3ce9abbf9'>hd_grub.cgi</a></div><div class='content'>blob: a160d4c57177287bf0a2ce5dbd39b7e4b21dab40 (<a href='/software/drakx/plain/tools/hd_grub.cgi?h=17.72&amp;id=28c1654615d322517d21f3e894c26be3ce9abbf9'>plain</a>)
<table summary='blob content' class='blob'>
<tr><td class='linenumbers'><pre><a id='n1' href='#n1'>1</a>
<a id='n2' href='#n2'>2</a>
<a id='n3' href='#n3'>3</a>
<a id='n4' href='#n4'>4</a>
<a id='n5' href='#n5'>5</a>
<a id='n6' href='#n6'>6</a>
<a id='n7' href='#n7'>7</a>
<a id='n8' href='#n8'>8</a>
<a id='n9' href='#n9'>9</a>
<a id='n10' href='#n10'>10</a>
<a id='n11' href='#n11'>11</a>
<a id='n12' href='#n12'>12</a>
<a id='n13' href='#n13'>13</a>
<a id='n14' href='#n14'>14</a>
<a id='n15' href='#n15'>15</a>
<a id='n16' href='#n16'>16</a>
<a id='n17' href='#n17'>17</a>
<a id='n18' href='#n18'>18</a>
<a id='n19' href='#n19'>19</a>
<a id='n20' href='#n20'>20</a>
<a id='n21' href='#n21'>21</a>
<a id='n22' href='#n22'>22</a>
<a id='n23' href='#n23'>23</a>
<a id='n24' href='#n24'>24</a>
<a id='n25' href='#n25'>25</a>
<a id='n26' href='#n26'>26</a>
<a id='n27' href='#n27'>27</a>
<a id='n28' href='#n28'>28</a>
<a id='n29' href='#n29'>29</a>
<a id='n30' href='#n30'>30</a>
<a id='n31' href='#n31'>31</a>
<a id='n32' href='#n32'>32</a>
<a id='n33' href='#n33'>33</a>
<a id='n34' href='#n34'>34</a>
<a id='n35' href='#n35'>35</a>
<a id='n36' href='#n36'>36</a>
<a id='n37' href='#n37'>37</a>
<a id='n38' href='#n38'>38</a>
<a id='n39' href='#n39'>39</a>
<a id='n40' href='#n40'>40</a>
<a id='n41' href='#n41'>41</a>
<a id='n42' href='#n42'>42</a>
<a id='n43' href='#n43'>43</a>
<a id='n44' href='#n44'>44</a>
<a id='n45' href='#n45'>45</a>
<a id='n46' href='#n46'>46</a>
<a id='n47' href='#n47'>47</a>
<a id='n48' href='#n48'>48</a>
<a id='n49' href='#n49'>49</a>
<a id='n50' href='#n50'>50</a>
<a id='n51' href='#n51'>51</a>
<a id='n52' href='#n52'>52</a>
<a id='n53' href='#n53'>53</a>
<a id='n54' href='#n54'>54</a>
<a id='n55' href='#n55'>55</a>
<a id='n56' href='#n56'>56</a>
<a id='n57' href='#n57'>57</a>
<a id='n58' href='#n58'>58</a>
<a id='n59' href='#n59'>59</a>
<a id='n60' href='#n60'>60</a>
<a id='n61' href='#n61'>61</a>
<a id='n62' href='#n62'>62</a>
<a id='n63' href='#n63'>63</a>
<a id='n64' href='#n64'>64</a>
<a id='n65' href='#n65'>65</a>
<a id='n66' href='#n66'>66</a>
<a id='n67' href='#n67'>67</a>
<a id='n68' href='#n68'>68</a>
<a id='n69' href='#n69'>69</a>
<a id='n70' href='#n70'>70</a>
<a id='n71' href='#n71'>71</a>
<a id='n72' href='#n72'>72</a>
<a id='n73' href='#n73'>73</a>
<a id='n74' href='#n74'>74</a>
<a id='n75' href='#n75'>75</a>
<a id='n76' href='#n76'>76</a>
<a id='n77' href='#n77'>77</a>
<a id='n78' href='#n78'>78</a>
<a id='n79' href='#n79'>79</a>
<a id='n80' href='#n80'>80</a>
<a id='n81' href='#n81'>81</a>
<a id='n82' href='#n82'>82</a>
<a id='n83' href='#n83'>83</a>
<a id='n84' href='#n84'>84</a>
<a id='n85' href='#n85'>85</a>
<a id='n86' href='#n86'>86</a>
<a id='n87' href='#n87'>87</a>
<a id='n88' href='#n88'>88</a>
<a id='n89' href='#n89'>89</a>
<a id='n90' href='#n90'>90</a>
<a id='n91' href='#n91'>91</a>
<a id='n92' href='#n92'>92</a>
<a id='n93' href='#n93'>93</a>
<a id='n94' href='#n94'>94</a>
<a id='n95' href='#n95'>95</a>
<a id='n96' href='#n96'>96</a>
<a id='n97' href='#n97'>97</a>
<a id='n98' href='#n98'>98</a>
<a id='n99' href='#n99'>99</a>
<a id='n100' href='#n100'>100</a>
<a id='n101' href='#n101'>101</a>
<a id='n102' href='#n102'>102</a>
</pre></td>
<td class='lines'><pre><code><span class="hl slc">#!/usr/bin/perl</span>

<span class="hl kwa">use</span> CGI <span class="hl str">&apos;:all&apos;</span><span class="hl opt">;</span>
<span class="hl kwa">use</span> CGI<span class="hl opt">::</span>Carp<span class="hl opt">;</span>

<span class="hl kwc">my</span> <span class="hl kwb">$default_append</span> <span class="hl opt">=</span> <span class="hl str">&quot;ramdisk_size=128000 root=/dev/ram3&quot;</span><span class="hl opt">;</span>
<span class="hl kwc">my</span> <span class="hl kwb">$default_acpi</span> <span class="hl opt">=</span> <span class="hl str">&quot;acpi=ht&quot;</span><span class="hl opt">;</span>
<span class="hl kwc">my</span> <span class="hl kwb">$default_vga</span> <span class="hl opt">=</span> <span class="hl str">&quot;vga=788&quot;</span><span class="hl opt">;</span>

<span class="hl kwc">my</span> <span class="hl kwb">$cgi_name</span> <span class="hl opt">=</span> <span class="hl str">&quot;/&quot;</span> <span class="hl opt">. (</span><span class="hl kwb">$0</span> <span class="hl opt">=~</span> m<span class="hl opt">|([^/]+)$|)[</span><span class="hl num">0</span><span class="hl opt">];</span>

<span class="hl kwc">print</span>
  header<span class="hl opt">(),</span>
  start_html<span class="hl opt">(-</span>TITLE <span class="hl opt">=&gt;</span> <span class="hl str">&apos;hd_grub configuration&apos;</span><span class="hl opt">);</span>

<span class="hl kwa">if</span> <span class="hl opt">(</span>param<span class="hl opt">()) {</span>
    print_menu_lst<span class="hl opt">();</span>
<span class="hl opt">}</span> <span class="hl kwa">else</span> <span class="hl opt">{</span>
    print_form<span class="hl opt">();</span>
<span class="hl opt">}</span>

<span class="hl kwc">print</span> end_html<span class="hl opt">;</span>


<span class="hl kwa">sub</span> menu_lst <span class="hl opt">{</span>
    <span class="hl kwc">my</span> <span class="hl opt">(</span><span class="hl kwb">$hd, $hd_linux, $partition_number, $directory</span><span class="hl opt">) =</span> <span class="hl kwb">&#64;_</span><span class="hl opt">;</span>

    <span class="hl kwc">my</span> <span class="hl kwb">$grub_partition_number</span> <span class="hl opt">=</span> <span class="hl kwb">$partition_number</span> <span class="hl opt">-</span> <span class="hl num">1</span><span class="hl opt">;</span>

    <span class="hl str">&lt;&lt;EOF;</span>
<span class="hl str">timeout 0</span>
<span class="hl str">default 0</span>
<span class="hl str"></span>
<span class="hl str">title Mandriva Install</span>
<span class="hl str"></span>
<span class="hl str">root (</span><span class="hl ipl">$hd,$grub_partition_number</span><span class="hl str">)</span>
<span class="hl str">kernel</span> <span class="hl ipl">$directory/isolinux/alt0/vmlinuz</span> <span class="hl str"></span><span class="hl ipl">$default_append</span> <span class="hl str"></span><span class="hl ipl">$default_acpi</span> <span class="hl str"></span><span class="hl ipl">$default_vga</span> <span class="hl str">automatic=method:disk,partition:</span><span class="hl ipl">$hd_linux$partition_number,directory</span><span class="hl str">:</span><span class="hl ipl">$directory</span>
<span class="hl str">initrd</span> <span class="hl ipl">$directory/isolinux/alt0/all</span><span class="hl str">.rdz</span>
<span class="hl str">EOF</span>

<span class="hl opt">}</span>

<span class="hl kwa">sub</span> print_menu_lst <span class="hl opt">{</span>
    <span class="hl kwc">my</span> <span class="hl kwb">$directory</span> <span class="hl opt">=</span> param<span class="hl opt">(</span><span class="hl str">&apos;directory&apos;</span><span class="hl opt">);</span>
    <span class="hl kwb">$directory</span> <span class="hl opt">=~</span> <span class="hl kwd">s!^/!!</span><span class="hl opt">;</span>
    <span class="hl kwc">print</span>
      ol<span class="hl opt">(</span>li<span class="hl opt">(</span><span class="hl str">qq(Select the text below and save it in a file &quot;menu.lst&quot;)</span><span class="hl opt">),</span>
	 li<span class="hl opt">(</span><span class="hl str">qq(Create a floppy from</span> <span class="hl ipl">$directory/images/hd_grub</span><span class="hl str">.img (eg: &lt;tt&gt;dd if=hd_grub.img of=/dev/fd0&lt;/tt&gt;)</span><span class="hl opt">)),</span>
	 li<span class="hl opt">(</span><span class="hl str">qq(Copy the file &quot;menu.lst&quot; to the floppy, overwriting the existing one)</span><span class="hl opt">),</span>
	 <span class="hl opt">),</span>
      p<span class="hl opt">(),</span>
      start_form<span class="hl opt">(-</span>name <span class="hl opt">=&gt;</span> <span class="hl str">&apos;form&apos;</span><span class="hl opt">, -</span>action <span class="hl opt">=&gt;</span> <span class="hl kwb">$cgi_name,</span> <span class="hl opt">-</span><span class="hl kwa">method</span> <span class="hl opt">=&gt;</span> <span class="hl str">&apos;get&apos;</span><span class="hl opt">),</span>
      textarea<span class="hl opt">(-</span><span class="hl kwa">default</span> <span class="hl opt">=&gt;</span> menu_lst<span class="hl opt">(</span>param<span class="hl opt">(</span><span class="hl str">&apos;hd&apos;</span><span class="hl opt">),</span> param<span class="hl opt">(</span><span class="hl str">&apos;hd_linux&apos;</span><span class="hl opt">),</span> param<span class="hl opt">(</span><span class="hl str">&apos;partition_number&apos;</span><span class="hl opt">),</span> <span class="hl str">&quot;/</span><span class="hl ipl">$directory</span><span class="hl str">&quot;</span><span class="hl opt">),</span>
	       <span class="hl opt">-</span>rows <span class="hl opt">=&gt;</span> <span class="hl num">15</span><span class="hl opt">, -</span>columns <span class="hl opt">=&gt;</span> <span class="hl num">120</span><span class="hl opt">,</span>
	      <span class="hl opt">),</span>
      end_form<span class="hl opt">(),</span>
<span class="hl opt">}</span>

<span class="hl kwa">sub</span> print_form <span class="hl opt">{</span>
    <span class="hl kwc">print</span>
      p<span class="hl opt">(),</span>
      start_form<span class="hl opt">(-</span>name <span class="hl opt">=&gt;</span> <span class="hl str">&apos;form&apos;</span><span class="hl opt">, -</span>action <span class="hl opt">=&gt;</span> <span class="hl kwb">$cgi_name,</span> <span class="hl opt">-</span><span class="hl kwa">method</span> <span class="hl opt">=&gt;</span> <span class="hl str">&apos;get&apos;</span><span class="hl opt">),</span>
      ul<span class="hl opt">(</span><span class="hl str">&quot;Please choose the partition where Mandrivalinux is copied.&quot;</span><span class="hl opt">,</span>
	 li<span class="hl opt">(</span>popup_menu<span class="hl opt">(-</span>name <span class="hl opt">=&gt;</span> <span class="hl str">&quot;hd&quot;</span><span class="hl opt">, -</span><span class="hl kwa">default</span> <span class="hl opt">=&gt;</span> <span class="hl str">&apos;hd0&apos;</span><span class="hl opt">,</span> 
		       <span class="hl opt">-</span><span class="hl kwc">values</span> <span class="hl opt">=&gt; [</span> <span class="hl str">&apos;hd0&apos;</span> <span class="hl opt">..</span> <span class="hl str">&apos;hd3&apos;</span> <span class="hl opt">],</span>
		       <span class="hl opt">-</span>labels <span class="hl opt">=&gt; {</span> hd0 <span class="hl opt">=&gt;</span> <span class="hl str">&apos;1st BIOS hard drive (usually hda or sda)&apos;</span><span class="hl opt">,</span>
				    hd1 <span class="hl opt">=&gt;</span> <span class="hl str">&apos;2nd BIOS hard drive&apos;</span><span class="hl opt">,</span>
				    hd2 <span class="hl opt">=&gt;</span> <span class="hl str">&apos;3rd BIOS hard drive&apos;</span><span class="hl opt">,</span>
				    hd3 <span class="hl opt">=&gt;</span> <span class="hl str">&apos;4th BIOS hard drive&apos;</span><span class="hl opt">,</span>
				  <span class="hl opt">})),</span>
	 li<span class="hl opt">(</span>popup_menu<span class="hl opt">(-</span>name <span class="hl opt">=&gt;</span> <span class="hl str">&quot;hd_linux&quot;</span><span class="hl opt">, -</span><span class="hl kwa">default</span> <span class="hl opt">=&gt;</span> <span class="hl str">&apos;hda&apos;</span><span class="hl opt">,</span> 
		       <span class="hl opt">-</span><span class="hl kwc">values</span> <span class="hl opt">=&gt; [</span> <span class="hl str">&apos;hda&apos;</span> <span class="hl opt">..</span> <span class="hl str">&apos;hdd&apos;</span><span class="hl opt">,</span> <span class="hl str">&apos;sda&apos;</span> <span class="hl opt">..</span> <span class="hl str">&apos;sdc&apos;</span><span class="hl opt">,</span> <span class="hl str">&apos;hde&apos;</span> <span class="hl opt">..</span> <span class="hl str">&apos;hdh&apos;</span> <span class="hl opt">],</span>
		       <span class="hl opt">-</span>labels <span class="hl opt">=&gt; {</span> 
				    hda <span class="hl opt">=&gt;</span> <span class="hl str">&apos;1st IDE hard drive (hda)&apos;</span><span class="hl opt">,</span>
				    hdb <span class="hl opt">=&gt;</span> <span class="hl str">&apos;2nd IDE hard drive (hdb)&apos;</span><span class="hl opt">,</span>
				    hdc <span class="hl opt">=&gt;</span> <span class="hl str">&apos;3rd IDE hard drive (hdc)&apos;</span><span class="hl opt">,</span>
				    hdd <span class="hl opt">=&gt;</span> <span class="hl str">&apos;4th IDE hard drive (hdd)&apos;</span><span class="hl opt">,</span>
				    hde <span class="hl opt">=&gt;</span> <span class="hl str">&apos;5th IDE hard drive (hde)&apos;</span><span class="hl opt">,</span>
				    hdf <span class="hl opt">=&gt;</span> <span class="hl str">&apos;6th IDE hard drive (hdf)&apos;</span><span class="hl opt">,</span>
				    hdg <span class="hl opt">=&gt;</span> <span class="hl str">&apos;7th IDE hard drive (hdg)&apos;</span><span class="hl opt">,</span>
				    hdh <span class="hl opt">=&gt;</span> <span class="hl str">&apos;8th IDE hard drive (hdh)&apos;</span><span class="hl opt">,</span>
				    sda <span class="hl opt">=&gt;</span> <span class="hl str">&apos;1st SCSI hard drive (sda)&apos;</span><span class="hl opt">,</span>
				    sdb <span class="hl opt">=&gt;</span> <span class="hl str">&apos;2nd SCSI hard drive (sdb)&apos;</span><span class="hl opt">,</span>
				    sdc <span class="hl opt">=&gt;</span> <span class="hl str">&apos;3rd SCSI hard drive (sdc)&apos;</span><span class="hl opt">,</span>
				  <span class="hl opt">})),</span>
	 li<span class="hl opt">(</span>popup_menu<span class="hl opt">(-</span>name <span class="hl opt">=&gt;</span> <span class="hl str">&quot;partition_number&quot;</span><span class="hl opt">, -</span><span class="hl kwa">default</span> <span class="hl opt">=&gt;</span> <span class="hl str">&apos;0&apos;</span><span class="hl opt">,</span> 
		       <span class="hl opt">-</span><span class="hl kwc">values</span> <span class="hl opt">=&gt; [</span> <span class="hl num">1</span> <span class="hl opt">..</span> <span class="hl num">15</span> <span class="hl opt">],</span>
		       <span class="hl opt">-</span>labels <span class="hl opt">=&gt; {</span> <span class="hl num">1</span> <span class="hl opt">=&gt;</span> <span class="hl str">&apos;1st primary partition (hda1, sda1 or ...)&apos;</span><span class="hl opt">,</span>
				    <span class="hl num">2</span> <span class="hl opt">=&gt;</span> <span class="hl str">&apos;2nd primary partition&apos;</span><span class="hl opt">,</span>
				    <span class="hl num">3</span> <span class="hl opt">=&gt;</span> <span class="hl str">&apos;3rd primary partition&apos;</span><span class="hl opt">,</span>
				    <span class="hl num">4</span> <span class="hl opt">=&gt;</span> <span class="hl str">&apos;4th primary partition&apos;</span><span class="hl opt">,</span>
				    <span class="hl num">5</span> <span class="hl opt">=&gt;</span> <span class="hl str">&apos;5th partition (hda5, sda5 or ...) (first logical partition)&apos;</span><span class="hl opt">,</span>
				    <span class="hl kwc">map</span> <span class="hl opt">{</span> <span class="hl kwb">$_</span> <span class="hl opt">=&gt;</span> <span class="hl kwb">$_</span> <span class="hl opt">.</span> <span class="hl str">&apos;th partition&apos;</span> <span class="hl opt">}</span> <span class="hl num">6</span> <span class="hl opt">..</span> <span class="hl num">15</span>
				  <span class="hl opt">})),</span>
       <span class="hl opt">),</span>
      p<span class="hl opt">(),</span>
      ul<span class="hl opt">(</span><span class="hl str">&quot;Please enter the directory containing the Mandrivalinux Distribution (relative to the partition chosen above)&quot;</span><span class="hl opt">,</span>
	 li<span class="hl opt">(</span>textfield<span class="hl opt">(-</span>name <span class="hl opt">=&gt;</span> <span class="hl str">&apos;directory&apos;</span><span class="hl opt">, -</span><span class="hl kwa">default</span> <span class="hl opt">=&gt;</span> <span class="hl str">&apos;/cooker/i586&apos;</span><span class="hl opt">,</span> size <span class="hl opt">=&gt;</span> <span class="hl num">40</span><span class="hl opt">)),</span>
	 <span class="hl opt">),</span>
      p<span class="hl opt">(</span>submit<span class="hl opt">(-</span>name <span class="hl opt">=&gt;</span> <span class="hl str">&apos;Go&apos;</span><span class="hl opt">)),</span>
      end_form<span class="hl opt">();</span>
<span class="hl opt">}</span>
</code></pre></td></tr></table>
</div> <!-- class=content -->
<div class='footer'>generated by <a href='https://git.zx2c4.com/cgit/about/'>cgit v1.2.1</a> (<a href='https://git-scm.com/'>git 2.21.0</a>) at 2025-03-28 02:04:24 +0000</div>
</div> <!-- id=cgit -->
</body>
</html>