summaryrefslogtreecommitdiffstats
path: root/drakpxelinux.pl
diff options
context:
space:
mode:
authorAntoine Ginies <aginies@mandriva.com>2005-09-14 14:58:19 +0000
committerAntoine Ginies <aginies@mandriva.com>2005-09-14 14:58:19 +0000
commite68f1e103909eadc34728e62f2d53a2aa1a85dfb (patch)
treeab28c742579d9966c4c14b06dc457fbfb66efea3 /drakpxelinux.pl
parent00584745764ad40fea3dbf38c172763a532e814e (diff)
downloaddrakpxelinux-e68f1e103909eadc34728e62f2d53a2aa1a85dfb.tar
drakpxelinux-e68f1e103909eadc34728e62f2d53a2aa1a85dfb.tar.gz
drakpxelinux-e68f1e103909eadc34728e62f2d53a2aa1a85dfb.tar.bz2
drakpxelinux-e68f1e103909eadc34728e62f2d53a2aa1a85dfb.tar.xz
drakpxelinux-e68f1e103909eadc34728e62f2d53a2aa1a85dfb.zip
improve auto_install option
Diffstat (limited to 'drakpxelinux.pl')
-rw-r--r--drakpxelinux.pl17
1 files changed, 12 insertions, 5 deletions
diff --git a/drakpxelinux.pl b/drakpxelinux.pl
index 1f392bf..e18fc0c 100644
--- a/drakpxelinux.pl
+++ b/drakpxelinux.pl
@@ -101,7 +101,7 @@ my %help = (
'apply' => N("apply change to configuration file"),
'addpxe' => N("launches a wizard to add a PXE entry "),
'helponline' => N("get help from online documentation"),
- 'auto_install' => "http://yourwebserver/auto_inst.cfg.pl",
+ 'auto_install' => "http://your_ip:3712/<profil>_<label>.pl",
);
sub get_items {
@@ -477,12 +477,12 @@ sub edit_box_item {
my $info = Gtk2::Entry->new;
$info->set_text($entry->{info});
- $info->set_sensitive(0);
+# $info->set_sensitive(0);
set_help_tip($info, 'info');
# create file dialog widget, with file or directory selection
my $fdwidget = sub {
- my ($data, $test, $filetotest, $label) = @_;
+ my ($data, $test, $filetotest, $label, $profile) = @_;
chdir($network::pxe::pxelinux_client_root);
my $fd = new Gtk2::FileSelection(N("Selection"));
$fd->set_modal(1);
@@ -494,7 +494,6 @@ sub edit_box_item {
} else {
-f $file or err_dialog(N("Error!"), N("Should be a file")) and return;
}
- print "file $file\n";
if ($filetotest eq "kernel") {
if (basename($file) ne "memdisk") {
run_program::get_stdout("file $file") =~ /boot sector/ or err_dialog(N("Error!"), N("Should be a boot sector file")) and return;
@@ -510,6 +509,10 @@ sub edit_box_item {
system("cp -avf $file " . $network::pxe::pxelinux_images . "/$label.img");
$data->set_text("images/$label.img");
}
+ } elsif ($filetotest eq "auto_install") {
+ my $ip_address = network::tools::get_interface_ip_address($net, $interface);
+ run_program::get_stdout("cp -avf $file " . $network::pxe::pxelinux_client_root . "/pxelinux.cfg/profiles/auto_" . $profile . "_" . $label . ".pl");
+ $data->set_text("http://$ip_address:3712/auto_" . $profile . "_" . $label . ".pl");
}
$fd->hide;
}, $fd);
@@ -536,6 +539,10 @@ sub edit_box_item {
my $auto_install = Gtk2::Entry->new;
$auto_install->set_text($entry->{auto_install});
set_help_tip($auto_install, 'auto_install');
+ my $profile = get_selected_profile();
+ my $profile_selection = $fdwidget->($auto_install, "", "auto_install", $entry->{label}, $profile);
+ my $buttonprofil = Gtk2::Button->new("Select auto_install.pl");
+ $buttonprofil->signal_connect(clicked => sub { $profile_selection->show });
my $file_dialog = $fdwidget->($initrd, "", "initrd", $entry->{label});
my $buttoninitrd = Gtk2::Button->new(N("Select associated initrd"));
@@ -647,7 +654,7 @@ sub edit_box_item {
2, gtkadd_widget($size_groups{button}, ""),
),
0, $label_and_widgets->(N("Remote server name"), $server, ""),
- 0, $label_and_widgets->("auto_install", $auto_install, ""),
+ 0, $label_and_widgets->("auto_install", $auto_install, $buttonprofil),
0, $label_and_widgets->(N("Remote installation directory"), $directory, ""),
),
),