diff options
author | Antoine Ginies <aginies@mandriva.com> | 2004-01-21 17:36:59 +0000 |
---|---|---|
committer | Antoine Ginies <aginies@mandriva.com> | 2004-01-21 17:36:59 +0000 |
commit | 5d26e277b2d6bf0d70f5842bce3878897db3441c (patch) | |
tree | 41e2e792fe8fe1c7979a0be7f0a3193c4508eb22 /pxe_wizard | |
parent | 1379898533cc08b5a50c32444ff446a731bcd0d1 (diff) | |
download | drakwizard-5d26e277b2d6bf0d70f5842bce3878897db3441c.tar drakwizard-5d26e277b2d6bf0d70f5842bce3878897db3441c.tar.gz drakwizard-5d26e277b2d6bf0d70f5842bce3878897db3441c.tar.bz2 drakwizard-5d26e277b2d6bf0d70f5842bce3878897db3441c.tar.xz drakwizard-5d26e277b2d6bf0d70f5842bce3878897db3441c.zip |
- some fix after receiving erwan test report :-)
Diffstat (limited to 'pxe_wizard')
-rw-r--r-- | pxe_wizard/Pxe.pm | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/pxe_wizard/Pxe.pm b/pxe_wizard/Pxe.pm index 42f761d8..f575e7d6 100644 --- a/pxe_wizard/Pxe.pm +++ b/pxe_wizard/Pxe.pm @@ -92,20 +92,13 @@ foreach (cat_($PXEDEFAULT)) { #set default list for entry in syslinux.cfg my @list_method = qw(nfs http); -my @list_ram = qw(32000 64000 1280000); -my @list_vga = qw(788 normal 785 791 text); +my @list_ram = qw(32000 48000 64000 1280000); +my @list_vga = qw(788 normal 785 791 792 text); my @list_acpi = qw(ht force off); my @list_apic = qw(apic noapic); my @list_eth = qw(eth0 eth1 eth2); -# to get list menu entry -my @list_menu; -foreach (cat_($PXEDEFAULT)) { - my ($ent) = /# TAG: (\w+)_BEGIN/; - ! $ent or push @list_menu,$ent; -} - #begin of wizard $o->{pages} = { welcome => { @@ -115,6 +108,7 @@ $o->{pages} = { $o->{var}{wiz_level} ||= 1; }, post => sub { + -f "$X86/drakwizard_pxe" or return 'error_needpxe'; if ($o->{var}{wiz_level} == 2) { return 'addimg' } elsif ($o->{var}{wiz_level} == 3) { @@ -135,7 +129,7 @@ $o->{pages} = { { label => "PXE description:", val => \$o->{var}{DESCR} }, { label => "Full path to boot image:", val => \$o->{var}{IMG} }, ], - post => \&test_data, + next => 'summaryadd', }, removeimg => { @@ -176,10 +170,18 @@ $o->{pages} = { name => N("Please provide a bootable image..."), next => 'addimg', }, + error_path_img => { + name => N("Please choose an image from a different directory than $IMGPATH."), + next => 'addimg', + }, error_name => { - name => N("Please provide a correct name in PXE entry (one word)"), + name => N("Please provide a correct name in PXE entry (one word)."), next => 'addimg', }, + error_needpxe => { + name => N("To add/remove/modify PXE boot image, you need to run 'Set PXE server' before."), + next => 'pxeserver', + }, simmilar_entry => { name => N("Similar name is already used in PXE menu entry") . "\n\n" . N("Please provide another PXE Menu name"), next => 'addimg', @@ -320,6 +322,7 @@ EOF # add bootable image in correct place sub add_img { my ($SIMG, $PXENAME) = @_; + !member($SIMG, "tfptboot") or return 'error_path_img'; cp_af($SIMG, $IMGPATH . "/" . $PXENAME . '.img'); } @@ -428,7 +431,7 @@ sub read_option { my ($IMG) = $o->{var}{IMGTOMODIFY}; my $mount = "/tmp/loop_for_images"; mkdir_p($mount); - system("mount $IMGPATH/$IMG.img $mount -o loop"); + system("mount $IMGPATH/$IMG.img $mount -o loop 2>/dev/null"); my $line = cat_("$mount/syslinux.cfg"); $o->{var}{i} = "$IMGPATH/$IMG.img"; ($o->{var}{METHOD}, $o->{var}{ETH}, $o->{var}{IP}, $o->{var}{DIR}, $o->{var}{RAM}, $o->{var}{VGA}, $o->{var}{ACPI}, $o->{var}{APIC}) = $line =~ /method:(nfs|http),interface:(eth0|eth1|eth2),network:dhcp,server:(.*?),directory:(.*?) ramdisk_size=(.*?) root=\/dev\/ram3 rw vga=(.*?)acpi=(ht|force|off)\s(apic|noapic)/; @@ -480,6 +483,12 @@ sub do_it_pxe { return if $::testing; my $in = 'interactive'->vnew('su', 'PXE server'); my $w = $in->wait_message(N("PXE server"), N("Configuring PXE server on your system...")); + output("$X86/drakwizard_pxe", <<EOF); +do not remove +use to check if drakwizard PXE set server +has been launch. +EOF + mkdir_p($IMGPATH); memlinux_prep(); default_pxe_menu(); |