summaryrefslogtreecommitdiffstats
path: root/drakpxelinux.pl
diff options
context:
space:
mode:
authorAntoine Ginies <aginies@mandriva.com>2005-09-02 14:26:50 +0000
committerAntoine Ginies <aginies@mandriva.com>2005-09-02 14:26:50 +0000
commitfd6079f5e834b023bef9f761dcb9b7426e690110 (patch)
tree9c2bda08755a7f4ad73e7fe3493deeb618d6a5b8 /drakpxelinux.pl
parent7e5c600b4e665f7e19f04f2fcb97fa743475a935 (diff)
downloaddrakpxelinux-fd6079f5e834b023bef9f761dcb9b7426e690110.tar
drakpxelinux-fd6079f5e834b023bef9f761dcb9b7426e690110.tar.gz
drakpxelinux-fd6079f5e834b023bef9f761dcb9b7426e690110.tar.bz2
drakpxelinux-fd6079f5e834b023bef9f761dcb9b7426e690110.tar.xz
drakpxelinux-fd6079f5e834b023bef9f761dcb9b7426e690110.zip
fix memdis/data.img and kernel/initrd test
Diffstat (limited to 'drakpxelinux.pl')
-rw-r--r--drakpxelinux.pl26
1 files changed, 15 insertions, 11 deletions
diff --git a/drakpxelinux.pl b/drakpxelinux.pl
index 151145b..9ea92f8 100644
--- a/drakpxelinux.pl
+++ b/drakpxelinux.pl
@@ -460,20 +460,24 @@ 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") {
- run_program::get_stdout("file $file") =~ /boot sector/ or err_dialog(N("Error!"), N("Should be a boot sector file")) and return;
- run_program::get_stdout("cp -avf $file " . $network::pxe::pxelinux_images . "/vmlinuz-$label");
- $data->set_text("images/vmlinuz-$label");
+ 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;
+ run_program::get_stdout("cp -avf $file " . $network::pxe::pxelinux_images . "/vmlinuz-$label");
+ $data->set_text("images/vmlinuz-$label");
+ } else { $data->set_text("memdisk") }
} elsif ($filetotest eq "initrd") {
- run_program::get_stdout("file $file") =~ /initrd/ or err_dialog(N("Error!"), N("Should be an initrd file")) and return;
- system("cp -avf $file " . $network::pxe::pxelinux_images . "/$label.rdz");
- $data->set_text("images/$label.rdz");
+ if (basename($file) !~ /^\w+\.img$/) {
+ run_program::get_stdout("file $file") =~ /initrd/ or err_dialog(N("Error!"), N("Should be an initrd file")) and return;
+ system("cp -avf $file " . $network::pxe::pxelinux_images . "/$label.rdz");
+ $data->set_text("images/$label.rdz");
+ } else {
+ system("cp -avf $file " . $network::pxe::pxelinux_images . "/$label.img");
+ $data->set_text("images/$label.img");
+ }
}
-# my $d = dirname($file);
-# if ($d =~ /images/) { $filesel = "images/" . $filesel }
-# print "$filesel\n";
-# $data->set_text($filesel);
- $fd->hide;
+ $fd->hide;
}, $fd);
$fd->cancel_button->signal_connect(clicked => sub { $fd->hide });
return $fd;