summaryrefslogtreecommitdiffstats
path: root/pxe_wizard/Pxe.pm
diff options
context:
space:
mode:
Diffstat (limited to 'pxe_wizard/Pxe.pm')
-rw-r--r--pxe_wizard/Pxe.pm23
1 files changed, 13 insertions, 10 deletions
diff --git a/pxe_wizard/Pxe.pm b/pxe_wizard/Pxe.pm
index a959c908..f64eb9cf 100644
--- a/pxe_wizard/Pxe.pm
+++ b/pxe_wizard/Pxe.pm
@@ -68,6 +68,7 @@ my $o = {
DIR => '/var/install/',
ALLRDZ => '/mnt/cdrom/isolinux/alt0/all.rdz',
VMLINUZ => '/mnt/cdrom/isolinux/alt0/vmlinuz',
+ OPTION => '',
i => '',
},
needed_rpm => [ 'pxe', 'tftp-server', 'xinetd' ],
@@ -183,6 +184,7 @@ $o->{pages} = {
{ label => N("VGA option:"), val => \$o->{var}{VGA}, fixed_list => \@list_vga },
{ label => N("ACPI option:"), val => \$o->{var}{ACPI}, fixed_list => \@list_acpi },
{ label => N("APIC option:"), val => \$o->{var}{APIC}, fixed_list => \@list_apic },
+ { label => N("Custom option:"), val => \$o->{var}{OPTION} },
],
next => 'summarymodify',
},
@@ -232,7 +234,7 @@ $o->{pages} = {
next => 'addimgrdz',
},
summaryserver => {
- name => N("Now will prepare all default files to set the PXE server"),
+ name => N("Will now prepare all default files to set the PXE server"),
data => [
{ label => N("TFTP directory:"), fixed_val => \$TFTPDIR },
{ label => N("Boot image path:"), fixed_val => \$IMGPATH },
@@ -243,7 +245,7 @@ $o->{pages} = {
next => 'endserver',
},
summarymodify => {
- name => N("Now will modify boot options in image"),
+ name => N("Will now modify boot options in image"),
data => [
{ label => N("Boot image to modify:"), fixed_val => \$o->{var}{i} },
{ label => N("Server IP:"), fixed_val => \$o->{var}{IP} },
@@ -254,12 +256,13 @@ $o->{pages} = {
{ label => N("VGA option:"), fixed_val => \$o->{var}{VGA} },
{ label => N("ACPI option:"), fixed_val => \$o->{var}{ACPI} },
{ label => N("APIC option:"), fixed_val => \$o->{var}{APIC} },
+ { label => N("Custom option:"), fixed_val => \$o->{var}{OPTION} },
],
post => \&do_it_modify,
next => 'endmodify',
},
summaryremove => {
- name => N("Now will remove your PXE boot image"),
+ name => N("Will now remove your PXE boot image"),
data => [
{ label => N("PXE entry to remove:"), fixed_val => \$o->{var}{IMGTOREMOVE} },
],
@@ -267,7 +270,7 @@ $o->{pages} = {
next => 'endremove',
},
summaryadd => {
- name => N("Now will add your PXE boot image"),
+ name => N("Will now add your PXE boot image"),
data => [
{ label => "PXE name:", fixed_val => \$o->{var}{PXENAME} },
{ label => "PXE description:", fixed_val => \$o->{var}{DESCR} },
@@ -277,7 +280,7 @@ $o->{pages} = {
next => 'endadd',
},
summaryaddrdz => {
- name => N("Now will add your PXE boot image"),
+ name => N("Will now add your PXE boot image"),
data => [
{ label => "PXE name:", fixed_val => \$o->{var}{PXENAME} },
{ label => "PXE description:", fixed_val => \$o->{var}{DESCR} },
@@ -552,7 +555,7 @@ sub read_option {
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 =~ m!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)!;
+ ($o->{var}{METHOD}, $o->{var}{ETH}, $o->{var}{IP}, $o->{var}{DIR}, $o->{var}{RAM}, $o->{var}{VGA}, $o->{var}{ACPI}, $o->{var}{APIC}, $o->{var}{OPTION}) = $line =~ m!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)\s(.*)!;
system("umount $mount");
if (-e $mount) {
rm_rf($mount);
@@ -560,7 +563,7 @@ sub read_option {
} else {
my $line = cat_($PXEDEFAULT);
$o->{var}{i} = "$IMGPATH/$IMG.rdz";
- ($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 =~ m!APPEND initrd=images/$IMG.rdz automatic=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)!;
+ ($o->{var}{METHOD}, $o->{var}{ETH}, $o->{var}{IP}, $o->{var}{DIR}, $o->{var}{RAM}, $o->{var}{VGA}, $o->{var}{ACPI}, $o->{var}{APIC}, $o->{var}{OPTION}) = $line =~ m!APPEND initrd=images/$IMG.rdz automatic=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)\s(.*)!;
}
}
@@ -569,7 +572,7 @@ sub read_option {
sub do_it_modify {
@list_menu or return 'needimg';
my $IMG = $o->{var}{IMGTOMODIFY};
- my ($METHOD, $ETH, $IP, $DIR, $RAM, $VGA, $ACPI, $APIC) = ($o->{var}{METHOD}, $o->{var}{ETH}, $o->{var}{IP}, $o->{var}{DIR}, $o->{var}{RAM}, $o->{var}{VGA}, $o->{var}{ACPI}, $o->{var}{APIC});
+ my ($METHOD, $ETH, $IP, $DIR, $RAM, $VGA, $ACPI, $APIC, $OPTION) = ($o->{var}{METHOD}, $o->{var}{ETH}, $o->{var}{IP}, $o->{var}{DIR}, $o->{var}{RAM}, $o->{var}{VGA}, $o->{var}{ACPI}, $o->{var}{APIC}, $o->{var}{OPTION});
return if $::testing;
if (-f "$IMGPATH/$IMG.img") {
$o->{var}{i} = "$IMGPATH/$IMG.img";
@@ -588,7 +591,7 @@ F2 advanced.msg
F3 boot.msg
label linux
kernel vmlinuz
- append initrd=network.rdz automatic=method:$METHOD,interface:$ETH,network:dhcp,server:$IP,directory:$DIR ramdisk_size=$RAM root=/dev/ram3 rw vga=$VGA acpi=$ACPI $APIC
+ append initrd=network.rdz automatic=method:$METHOD,interface:$ETH,network:dhcp,server:$IP,directory:$DIR ramdisk_size=$RAM root=/dev/ram3 rw vga=$VGA acpi=$ACPI $APIC $OPTION
EOF
system("umount $mount");
@@ -598,7 +601,7 @@ EOF
} else {
$o->{var}{i} = "$IMGPATH/$IMG.rdz";
substInFile {
- s!APPEND initrd=images/$IMG.rdz!APPEND initrd=images/$IMG.rdz automatic=method:$METHOD,interface:$ETH,network:dhcp,server:$IP,directory:$DIR ramdisk_size=$RAM root=/dev/ram3 rw vga=$VGA acpi=$ACPI $APIC!m;
+ s!APPEND initrd=images/$IMG.rdz!APPEND initrd=images/$IMG.rdz automatic=method:$METHOD,interface:$ETH,network:dhcp,server:$IP,directory:$DIR ramdisk_size=$RAM root=/dev/ram3 rw vga=$VGA acpi=$ACPI $APIC $OPTION!m;
} $PXEDEFAULT;
}
}