diff options
author | Antoine Ginies <aginies@mandriva.com> | 2004-02-10 16:12:52 +0000 |
---|---|---|
committer | Antoine Ginies <aginies@mandriva.com> | 2004-02-10 16:12:52 +0000 |
commit | dcd8c03b786d94786e7a718fb5a9add99e616714 (patch) | |
tree | 882d15aa473d280b9e81799b74973dc6a1d4bf0c | |
parent | 69b8bba47ab3c7f13820ba32804264941a2835fc (diff) | |
download | drakwizard-dcd8c03b786d94786e7a718fb5a9add99e616714.tar drakwizard-dcd8c03b786d94786e7a718fb5a9add99e616714.tar.gz drakwizard-dcd8c03b786d94786e7a718fb5a9add99e616714.tar.bz2 drakwizard-dcd8c03b786d94786e7a718fb5a9add99e616714.tar.xz drakwizard-dcd8c03b786d94786e7a718fb5a9add99e616714.zip |
- fix pb of copying vmlinuz
- use ip addr show if IPADDR is null
- add test before modify/remove Boot image
-rw-r--r-- | pxe_wizard/Pxe.pm | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/pxe_wizard/Pxe.pm b/pxe_wizard/Pxe.pm index 0f2b7c20..3316be0e 100644 --- a/pxe_wizard/Pxe.pm +++ b/pxe_wizard/Pxe.pm @@ -47,9 +47,11 @@ my $SYSLINUXPATH = '/usr/lib/syslinux/'; my $MEMDISK = $SYSLINUXPATH . '/memdisk'; my $XINETDDIR = "/etc/xinetd.d"; -#my $IPSERVER = $wiz->{net}->itf_get("IPADDR"); -my $interface = 'eth0'; -my ($IPSERVER) = `/sbin/ip addr show dev $interface` =~ /^\s*inet\s+(\d+\.\d+\.\d+\.\d+)/m; +my $IPSERVER = $wiz->{net}->itf_get("IPADDR"); +if (!$IPSERVER) { + my $interface = 'eth0'; + ($IPSERVER) = `/sbin/ip addr show dev $interface` =~ /^\s*inet\s+(\d+\.\d+\.\d+\.\d+)/m; +} #my $DOMAINNAME = $wiz->{net}->network_get("DOMAINNAME"); my $DOMAINNAME = chomp_(`dnsdomainname`); @@ -112,7 +114,7 @@ $o->{pages} = { }, post => sub { -f "$X86/drakwizard_pxe" or return 'error_needpxe'; -# @list_menu or return 'addimgrdz' ; + @list_menu or return 'needimg' ; if ($o->{var}{wiz_level} == 2) { return 'addimg' } elsif ($o->{var}{wiz_level} == 3) { @@ -194,6 +196,14 @@ $o->{pages} = { name => N("Please provide a bootable image..."), next => 'addimg', }, + needimg => { + name => N("Need an image. Please add one."), + no_back => 1, + next => 'welcome', + post => sub { + $o->{var}{wiz_level} = 5 + }, + }, error_imgrdz => { name => N("Please provide a bootable image..."), next => 'addimgrdz', @@ -212,6 +222,7 @@ $o->{pages} = { }, error_needpxe => { name => N("To add/remove/modify PXE boot image, you need to run 'Set PXE server' before."), + no_back => 1, next => 'pxeserver', }, simmilar_entry => { @@ -424,8 +435,8 @@ sub add_img { sub add_imgrdz { my ($SIMG, $VM, $PXENAME) = @_; !member($SIMG, "tfptboot") or return 'error_path_img'; + cp_af($VM, "$IMGPATH/" . basename($VM) . "-$PXENAME"); cp_af($SIMG, "$IMGPATH/$PXENAME.rdz"); - cp_af($VM, "$IMGPATH/$VM-$PXENAME"); } |