RE: Solved: Making anaconda prompt for network information during CD-based Kickstart

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I handle this in the %pre section.  I use text installs, but the same would
hold true if the script was a .py file you wrote to gather the info via the
GUI.  Anyway, I do this (using text installs) by putting a prompt script in
the %pre section that gets called.  It first sees if quick was passed.  If
so, it sets everything to DHCP.  Otherwise, I prompt for the info for each
interface.  The first thing I usually do is ask if you want it enabled, then
if you want to use DHCP, and finally for info I need if using static host
info.

Here is some code to do what I describe above.  It is not complete, but
should give you an idea of what I am doing.  I also define shortcuts in the
isolinux directory to control some of this.  I add the command I am looking
for to the linux boot command line.  For example, I will define quick in the
isolinux directory to be linux with quick appended.  Thus, it will show in
the /proc/cmdline file.  It is important to test the key words you use and
make sure the kernel doesn't care about it, though.  Keywords it doesn't
care about are ignored, but the are in the /proc/cmdline file, which is what
we want.

The advantage to this approach is no changes are needed to the source.  As
long as the ks.cfg options stay the same, it will continue to work, no
matter what happens to the anaconda source.  It also has the advantage of
asking upfront, so the installer/builder can answer the questions and leave,
having a usable system when they return.  Or a system available on the net
for post processing.  Of course, this requires a CD eject and an automatic
reboot after install.  It also requires you have setup SSH and any accounts
you need, etc. to reach the machine.

	--Dave

========= ks.cfg
%include /tmp/nics.ks
...
%pre
/mnt/sources/admin/pre-install

========= /mnt/sources/admin/pre-install		# This is on the CD
you create...
#!/sbin/sh

exec 1>&3				# Used for trace echoes to proper
tty
exec > /dev/tty			# So user sees query on tty1
exec 4> /tmp/nics.ks		# output to include file

cmdl=$( cat /proc/cmdline )
for i in $( grep eth /proc/net/dev | sed -e 's/:.(//; s/ //g' )
do
    # I usually prompt if DHCP is wanted for any interfaces before the
actual info...
    if [[ $cmdl != *quick* ]]; then
        printf "\nEnter IP Address: "
        read ip
        ...
        echo network --bootproto=static --device=$i --ip=$ip ...  1>&4
    else
        echo network --bootproto=dhcp --device=$i  1>&4
    fi
done


-----Original Message-----
From: kickstart-list-bounces@xxxxxxxxxx
[mailto:kickstart-list-bounces@xxxxxxxxxx]On Behalf Of Ed Brown
Sent: Friday, March 19, 2004 3:20 PM
To: Discussion list about Kickstart
Subject: Re: Solved: Making anaconda prompt for network information
duringCD-based Kickstart


Since you are not using the network for your install, another approach
that doesn't require modifying anaconda would be to run netconfig in
%post.

-Ed



On Fri, 2004-03-19 at 15:44, James_Martin@xxxxxxxxxxxxxxx wrote:
> Your first assumption is correct, you don't understand what I'm trying to 
> do.  I'm simply trying to be prompted by anaconda during a CD-based 
> kickstart for network information such as IP, DNS, etc.. --not the NIC I 
> want to install through.
> 
> James
> 
> James S. Martin, RHCE
> Contractor
> Administrative Office of the United States Courts
> Washington, DC
> (202) 502-2394
> 
> 
> 
> 
> Tom Diehl <tdiehl@xxxxxxxxxxxx>
> Sent by: kickstart-list-bounces@xxxxxxxxxx
> 03/19/2004 03:04 PM
> Please respond to Discussion list about Kickstart
> 
>  
>         To:     Discussion list about Kickstart
<kickstart-list@xxxxxxxxxx>
>         cc: 
>         Subject:        Re: Solved: Making anaconda prompt for network
information during CD-based 
> Kickstart
> 
> 
> On Fri, 19 Mar 2004 James_Martin@xxxxxxxxxxxxxxx wrote:
> 
> > As some of us know, when doing a CD-based kickstart, anaconda will not 
> > prompt you for network information, even if you leave the network line 
> > blank, empty, etc.  After some digging, I came up with a solution.
> 
> Unless I do not understand what you are trying to do, all you need to
> do is pass ksdevice-link on the command line and it will find the
> nic that has a link light.
> 
> Of course ths only applies to RHL9 and later. You can also do 
> ksdevice=eth0
> 
> HTH,
> 
> Tom
> 
> 
> _______________________________________________
> Kickstart-list mailing list
> Kickstart-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/kickstart-list
> 
> 
> 
> 
> _______________________________________________
> Kickstart-list mailing list
> Kickstart-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/kickstart-list


_______________________________________________
Kickstart-list mailing list
Kickstart-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/kickstart-list



[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux