#!/usr/local/bin/perl # edit_image.cgi # Edit or create a boot partition require './lilo-lib.pl'; &foreign_require("fdisk", "fdisk-lib.pl"); &ReadParse(); if ($in{'new'}) { &ui_print_header(undef, $text{'image_title1'}, ""); $members = [ ]; } else { &ui_print_header(undef, $text{'image_title2'}, ""); $conf = &get_lilo_conf(); $image = $conf->[$in{'idx'}]; $members = $image->{'members'}; } print "
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
$text{'image_options'}
\n"; print "\n"; printf "\n", &find_value("label", $members); print "\n"; printf "\n", $image->{'value'}, &file_chooser_button("image", 0); print "\n", $append ? $append : $literal; print "\n"; print "\n", $initrd, &file_chooser_button("initrd"); $readonly = &find("read-only", $members); $readwrite = &find("read-write", $members); print "\n"; $vga = lc(&find_value("vga", $members)); print "\n"; print "\n", $vga =~ /\d/ ? $vga : ""; $lock = &find("lock", $members); print "\n", $lock ? "" : "checked"; $optional = &find("optional", $members); print "\n", $optional ? "" : "checked"; $password = &find_value("password", $members); print "\n"; $restricted = &find("restricted", $members); printf "\n", $restricted ? "" : "checked", $text{'image_any'}; print "
$text{'image_name'}$text{'image_kernel'} %s
$text{'image_opts'} \n"; $append = &find_value("append", $members); $literal = &find_value("literal", $members); $append =~ s/^"(.*)"$/$1/g; $literal =~ s/^"(.*)"$/$1/g; printf " $text{'image_default'}\n", $append || $literal ? "" : "checked"; printf " $text{'image_add'}\n", $append ? "checked" : ""; printf " $text{'image_replace'}\n", $literal ? "checked" : ""; printf " 
$text{'image_root'} \n"; $root = &find_value("root", $members); printf " $text{'image_fromkern'}\n", $root ? "" : "checked"; printf " $text{'image_rcurr'}\n", $root eq "current" ? "checked" : ""; printf " $text{'image_rdev'}\n", $root && $root ne "current" ? "checked" : ""; print &foreign_call("fdisk", "partition_select", "root", $root eq "current" ? undef : $root, 0); print "
$text{'image_initrd'} \n"; $initrd = &find_value("initrd", $members); printf " $text{'default'}\n", $initrd ? '' : 'checked'; printf "\n", $initrd ? 'checked' : ''; printf " %s
$text{'image_mode'} $text{'image_vga'}
$text{'image_lock'} \n"; printf " $text{'yes'}\n", $lock ? "checked" : ""; printf " $text{'no'}$text{'image_optional'} \n"; printf " $text{'yes'}\n", $optional ? "checked" : ""; printf " $text{'no'}
$text{'image_password'} \n"; printf " $text{'image_none'}\n", $password ? "" : "checked"; printf "\n", $password ? "checked" : ""; print "
$text{'image_restricted'} \n"; printf " %s\n", $restricted ? "checked" : "", $text{'image_extra'}; printf " %s
\n"; print "\n"; print "\n"; if (!$in{'new'}) { print "\n"; } print "
", "
\n"; &ui_print_footer("", $text{'index_return'});