#!/usr/bin/perl # # Copyright (C) 2004-2005 by Mandriva aginies _ateuh_ mandriva.com # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # Quick configuration of PXE menu parameters # use with care developement release.... # thx R1 for test and some debug # cvs.mandrakesoft.com module: /soft/drakpxelinux my $version = "1.2.0"; # i18n: IMPORTANT: to get correct namespace (drakpxelinux instead of libDrakX) BEGIN { unshift @::textdomains, 'drakpxelinux' } use lib qw(/usr/lib/libDrakX); use standalone; use strict; use common; use services; use network::network; use network::pxe; use network::tools; use interactive; # must come *after* definition of textdomains for proper initialisation use ugtk2 qw(:ask :helpers :wrappers :create :dialogs); use mygtk2 qw(gtknew); use Gtk2::SimpleList; use Gtk2::Helper; use run_program; use Data::Dumper; our $model = create_model(); our $treeview = Gtk2::TreeView->new_with_model($model); # ie of entry menu in PXE: #label linux # KERNEL images/vmlinuz # APPEND initrd=images/all.rdz automatic=method:http,interface:eth0,network:dhcp,server:10.0.1.33,directory:/install/ ramdisk_size=64000 root=/dev/ram3 rw vga=788 display=:0 # default VAR my $SYSLINUXPATH = '/usr/lib/syslinux/'; my $MEMDISK = $SYSLINUXPATH . '/memdisk'; my $XINETDDIR = "/etc/xinetd.d"; my $conf_mac_profiles_name = "/var/lib/tftpboot/X86PC/conf_mac_profiles"; my $net = {}; network::network::read_net_conf($net); my $sys_wizard_pxe = "/etc/sysconfig/drak_pxe"; my ($interface) = cat_($sys_wizard_pxe) =~ /INTERFACE=(.*)/; $interface ||= $net->{net_interface}; link_default_path(); my $help = "" . N("PXE Label: the name to be displayed in the PXE menu (an ASCII word/number)") . "\n" . N("Server: IP address of server, that contains the installation directory") . "\n" . N("Kernel: memdisk or vmlinuz") . "\n" . N("Initrd: network boot image (network.img) or all.rdz") . "\n" . N("Interface: network interface used for the installation process") . "\n" . N("Network: DHCP or an IP address") . "\n" . N("Directory: full path to Mandriva Linux install server directory") . "\n" . N("Installation method: NFS or HTTP") . "\n" . N("Ramsize: ramsize parameter on boot image") . "\n" . N("Display: export display to another computer (e.g.: 10.0.1.33:0)") . "\n" . N("VGA: if you encounter any problem with VGA, please adjust") . "\n" . ""; my %help = ( 'initrd' => N("network boot image (network.img) or all.rdz"), 'kernel' => N("memdisk in case of network.img, or vmlinuz"), 'vga' => N("if you encounter any problem with VGA, please adjust"), 'interface' => N("network interface used for the installation process"), 'info' => N("Information displayed in PXE help (F1 key)"), 'network' => N("DHCP or an IP address"), 'directory' => N("full path to Mandriva Linux install server directory"), 'automatic' => N("installation method: choose NFS or HTTP"), 'ramsize' => N("ramsize parameter on boot image"), 'display' => N("export display on another computer (e.g.: 10.0.1.33:0)"), 'other' => "apic nolapic acpi=off initrd=/bin/shell", 'server' => N("IP address of server, that contains the installation directory"), 'labels' => N("lists all PXE entries, the default boot is the selected one"), 'wizardsrv' => N("launches a wizard to setup a PXE server"), 'editb' => N("edits the PXE entry selected with a dialog box"), 'removepxe' => N("removes the selected PXE entry"), 'apply' => N("apply change to configuration file"), 'addpxe' => N("launches a wizard to add a PXE entry "), 'helponline' => N("get help from online documentation"), 'auto_install' => "http://your_ip:3712/auto__