3 # Display all the boot partitions
5 require './lilo-lib.pl';
6 &ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1, 0,
7 &help_search_link("lilo", "man", "doc", "howto"));
9 # Check for non-intel architecture
11 # print "<p>$text{'index_earch'}<p>\n";
12 # &ui_print_footer("/", $text{'index'});
16 # Check if lilo.conf exists
17 if (!-r $config{'lilo_conf'}) {
18 print "<p>",&text('index_econf',
19 "<tt>$config{'lilo_conf'}</tt>"),"<p>\n";
20 &ui_print_footer("/", $text{'index'});
24 # Get the lilo version
25 $out = `$config{'lilo_cmd'} -V 2>&1`;
26 if ($out =~ /lilo\s+version\s+([0-9\.]+)/i) {
32 open(VERSION, ">$module_config_directory/version");
33 print VERSION $lilo_version,"\n";
36 $conf = &get_lilo_conf();
37 @images = sort { $a->{'index'} <=> $b->{'index'} }
38 ( &find("image", $conf), &find("other", $conf) );
40 $default = &find_value("default", $conf);
41 foreach $i (@images) {
42 local $n = $i->{'name'};
43 push(@icons, $n eq "image" ? "images/image.gif" : "images/other.gif");
44 $l = &find_value("label", $i->{'members'});
45 push(@titles, !$default && $i eq $images[0] ? "<b>$l</b>" :
46 $default && $default eq $l ? "<b>$l</b>" : $l);
47 push(@links, "edit_$n.cgi?idx=$i->{'index'}");
49 print "<a href='edit_image.cgi?new=1'>$text{'index_addk'}</a> \n";
50 print "<a href='edit_other.cgi?new=1'>$text{'index_addp'}</a><br>\n";
51 &icons_table(\@links, \@titles, \@icons, 4);
52 print "<a href='edit_image.cgi?new=1'>$text{'index_addk'}</a> \n";
53 print "<a href='edit_other.cgi?new=1'>$text{'index_addp'}</a><p>\n";
56 print "<table width=100%>\n";
57 print "<form action=edit_global.cgi>\n";
58 print "<tr><td><input type=submit value=\"$text{'index_global'}\"></td>\n";
59 print "<td>$text{'index_globalmsg'}</td></tr></form>\n";
61 %flang = &load_language('fdisk');
62 $text{'select_part'} = $flang{'select_part'};
63 $text{'select_device'} = $flang{'select_device'};
64 $text{'select_fd'} = $flang{'select_fd'};
65 $dev = &find_value("boot", $conf);
66 print "<form action=apply.cgi>\n";
67 print "<tr><td><input type=submit value=\"$text{'index_apply'}\"></td> <td>\n";
69 print &text('index_applymsg1',
70 $dev =~ /fd(\d+)$/ ? &text('select_fd', $1) :
71 $dev =~ /hd([a-z])(\d+)$/ ? &text('select_part', 'IDE', uc($1), $2) :
72 $dev =~ /sd([a-z])(\d+)$/ ? &text('select_part', 'SCSI', uc($1), $2) :
73 $dev =~ /hd([a-z])$/ ? &text('select_device', 'IDE', uc($1)) :
74 $dev =~ /sd([a-z])$/ ? &text('select_device', 'SCSI', uc($1)) : $dev);
77 print $text{'index_applymsg2'};
79 print "\n",$text{'index_applymsg3'},"</td></tr></form>\n";
82 &ui_print_footer("/", $text{'index'});