Network configuration with post install script.
I'm trying to automate the network configuration on a post install script with autoyast. I cannot predict the number of ethernet card and the ones that will be used before the installation. So i wrote a script that ask the user all the network info, hostname, gateway etc . . . Actually the problem i have is when i want to use the ifcfg-eth-xxxxx file generated by autoyast when i put this : <interfaces config:type="list"> <interface> <bootproto>dhcp</bootproto> <device>eth0</device> <startmode>onboot</startmode> </interface> <interface> <bootproto>dhcp</bootproto> <device>eth1</device> <startmode>onboot</startmode> </interface> <interface> <bootproto>dhcp</bootproto> <device>eth2</device> <startmode>onboot</startmode> </interface> <interface> <bootproto>dhcp</bootproto> <device>eth3</device> <startmode>onboot</startmode> </interface> <interface> <bootproto>dhcp</bootproto> <device>eth4</device> <startmode>onboot</startmode> </interface> </interfaces> the file generated by autoyast have not the same content that when i use yast and give the same info. With autoyast i don't have a _nm_name=..... field on the ifcfg file and so i don't have the hwcfg-$_nm_name associated file created on /etc/sysconfig/hardware I could bypass that but it seems that i need this field to configure the bonding that i want to use on all my servers. By parsing the 'hwinfo --network' output i could generate by myself the ifcfg-xxx files & hwcfg-xxxx associated files but i'm not sure it's the way i should go. I simply cannot predict the number of card and associated driver before the install and so i cannot predict the final parameters before scanning the hardware and asking the user witch card he wanna use. So i cannot put those info on the autoyast xml file, that's why i doing that on a post instal script. So my question is, how can i automate the network configuration for various servers (i have i386 & ia64 arch) with autoyast & post install scripts ? something like that : card_list=`ls -A /sys/class/net | grep eth` choice=`kdialog --title "Bonding interfaces" --inputbox "Activate Bonding on ? (ethx ethy) :" "$card_list"` and then i ask all the network config for the bonding and i wanna be able to generate all the associated config files. i can find the info for generating the files with requests like : # the simple name here hwinfo --network | grep "Device File" | echo `awk '{print $3}'` # the driver here hwinfo --network | grep "Driver:" | awk '{print $2}' # The Driver # the pci-bus-xxxx string there hwinfo --network | grep "SysFS Device Link:" | awk '{print $4}' | grep -n devices | echo `awk -F/ '{print "pci-bus-"$NF}'` # the HW Adress hwinfo --network | grep "HW" | echo `awk '{print $3}'` # the unique id hwinfo --network | grep "Unique" | echo `awk '{print $3}'` if guess there are simple a way to do that, but i can't find it :) Greetings. Daniel
On Tue, Apr 26, 2005 at 02:54:12PM +0200, dbenisty@free.fr wrote:
By parsing the 'hwinfo --network' output i could generate by myself the ifcfg-xxx files & hwcfg-xxxx associated files but i'm not sure it's the way i should go.
I simply cannot predict the number of card and associated driver before the install and so i cannot predict the final parameters before scanning the hardware and asking the user witch card he wanna use. So i cannot put those info on the autoyast xml file, that's why i doing that on a post instal script.
So my question is, how can i automate the network configuration for various servers (i have i386 & ia64 arch) with autoyast & post install scripts ?
Instead of parsing hwinfo output, try "eval `getcfg eth0`" in the shell. -- Martin Vidner, YaST developer SuSE CR, s.r.o. e-mail: mvidner@suse.cz Drahobejlova 27 tel:+420-296542373 190 00 Praha 9, Czech Republic http://www.suse.cz
participants (2)
-
dbenisty@free.fr
-
Martin Vidner