From a68f151e091330b852db2b25c8047a167225623e Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Tue, 21 Jun 2005 08:59:24 +0000 Subject: - give config file path as argument in network::pxe::{read,write}_pxelinux_conf - add write_conf in drakpxelinux to ease profile handling --- perl-install/network/pxe.pm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/perl-install/network/pxe.pm b/perl-install/network/pxe.pm index 90fb30fcc..0dd81a6d0 100644 --- a/perl-install/network/pxe.pm +++ b/perl-install/network/pxe.pm @@ -25,19 +25,21 @@ our %vga_bios_to_resolution = ( ); our %vga_resolution_to_bios = reverse %vga_bios_to_resolution; -sub read_pxelinux_help() { +sub read_pxelinux_help { + my ($help_file) = @_; my %info; - foreach (cat_($pxelinux_help_file)) { + foreach (cat_($help_file)) { /^(\w+)\s*:\s*(.*)$/ and $info{$1} = $2; } \%info; } -sub read_pxelinux_conf() { +sub read_pxelinux_conf { + my ($conf_file, $help_file) = @_; my (%conf); - my $info = read_pxelinux_help(); + my $info = read_pxelinux_help($help_file); my $entry = {}; - foreach (cat_($pxelinux_config_file)) { + foreach (cat_($conf_file)) { my $global = join('|', @global_pxelinux_settings); if (/^($global)\s+(.*)/) { $conf{lc($1)} = $2; @@ -81,9 +83,9 @@ sub list_pxelinux_labels { } sub write_pxelinux_conf { - my ($conf) = @_; + my ($conf, $conf_file) = @_; - output($pxelinux_config_file, + output($conf_file, join("\n", "# DO NOT EDIT auto_generated by drakpxelinux.pl", (map { $_ . ' ' . $conf->{lc($_)} } @global_pxelinux_settings), -- cgit v1.2.1