Specifying values dynamically using pre section

Tom Miller tmafs at us.ibm.com
Wed Sep 6 13:43:33 UTC 2006


Jesse Keating,
      You sound like you know linux RedHat boot process very well.  I am
installing linux
RedHat and SuSE on IBM power 5 logical partitions.  Both the netboot.img
and the
kickstart file want a nic device name ex: ksdevice = eth0 and I would like
to be able to use the mac address to designate the nic card to use instead
of the devcie name.  Its very hard from SMS, on a first time install of a
large lpar with 100 nic cards of all different types, to figure out in what
order anaconda or the netboot.img, is going to configure those 100 cards.

SMS (lowlevel system management service),  a group of text menus on power
5, is used to pick the boot nic card and enter the ip address of victim and
server, and set the boot list to boot from that nic card. Next, sms does a
bootp request to the server which has been set up in /etc/bootptab to
respond to a bootp request for that victim.
NOTE: SMS only supports bootp no pxelinux or dhcp functions.
The server also has a kickstart file modified by my code just for this
victim.  SMS is also used to set kernel command line parms that are passed
to the netboot.img.

Currenly my expect script, that fills in the SMS menus, pulls out the list
of nic cards and mac addresses as they appear in SMS menus, This code
attempts ping on all the listed card until it finds one that pings the
server. This nic card is used. This list with the last one in the list
being the one that is used is passed to a perl script on the server that
modifies the kickstart file for this victim, and sets up the /etc/bootptab
and exports the install dir for an nfs install. This script also builds the
netboot.img command line required to configure the nic card to pull down
the kickstart file. The expect script then sets the sms boot-file variable
so this value is passed to the netboot.img when it loads.

boot command line parms look like this:
Set boot-file to boot_parms = ip=9.3.22.102 netmask=255.255.255.128
gateway=9.3.
22.1 nameserver=9.0.7.1 ksdevice=eth0
ks=nfs:9.3.80.16:/lpars/9.3.22.102.cfg

My question is this.

1. Is there support in netboot image for a command line parm something like
this:
ksmacaddr = 00:00:54:4a:34:9e  instead of ksdevice = eth20

Note: I could use the %pre and ifconfg -a to find out what which nic card
to put in the kickstart file, but that still does not help me.  The netboot
image runs before kicstart %pre would be involked and I have to know the
right nic name to pass to netboot.img.

thanks



Wednesday, September 06, 2006 7:18 AM
To: kickstart-list at redhat.com
cc:
From: Jesse Keating <jkeating at j2solutions.net>
Subject: Re: Specifying values dynamically using pre section


On Wednesday 06 September 2006 06:03, Ajitabh Pandey wrote:
> I am sure there is a dynamic way of specifying such differences in the
> form of variables in the pre section of the kickstart. If yes, can
> someone give some examples. This will also help me in setting up the
> hostname, ip-address and so on dynamically.

We specificed the method at the bootloader time, not in the kickstart file.
>From the PXE menu an installer could choose 'rhel464' which would pass the
correct kernel and a method=nfs:server:/path/to/64bit/tree.  This way the
actual kickstart file can be arch agnostic and used for both arches.

The way I've found to pass data from %pre to the rest of the kickstart is
to
process things such as kernel arguments (/proc/cmdline) and create
kickstart
file stubs in /tmp/.  Then in the kickstart file you can
do %include /tmp/stub to get your dynamic content.  Using this usually left
us with pretty sparse base kickstart files and all the magic happening
in %pre to write out stubs to be included.  Things were very arch agnostic
and even install type (full, special selection, partitioning, etc..)
agnostic.  We could use the same base kickstart file for a plethora of
different installs due to the magic that would happen in %pre processing.
The key was specifying method at boot time (method can't be %included) and
smart scripting in %pre.

--
Jesse Keating RHCE      (geek.j2solutions.net)
Fedora Legacy Team      (www.fedoralegacy.org)
GPG Public Key          (geek.j2solutions.net/jkeating.j2solutions.pub)
(See attached file: C.DTF)
_______________________________________________
Kickstart-list mailing list
Kickstart-list at redhat.com
https://www.redhat.com/mailman/listinfo/kickstart-list




More information about the Kickstart-list mailing list