Re: Forcing kickstart to ask for network configuration

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

 



Thanks, this is a good idea, I will give this a try. What I tried was to do
the following in %post section:

  /usr/sbin/netconfig > /dev/tty1

This worked but the only problem was that the user was unable to enter
the hostname. I tried to add this with another read statement, but this
did not work, because I did not know how to do the stdin redirection.
But this should now work with your exec redirection.

Besides is it better to put this in the %pre section? The disadvantage
I see with this approach is that you cannot enter more then one
name server. In post one can do the full network setup by catting
everything into ifcfg-eth0, network, hosts and resolv.conf.

The big advantage of putting it in pre would be that you have access
to the network during the installation.

Holger

On Fri, 12 Sep 2003 ebrown@xxxxxxxx wrote:

>    It would be great if RedHat would provide for this, as the question
> comes up fairly regularly on this list (Jeremy?).  A quick
> workaround, untested in 8 or 9, would be to open a shell in %pre, and edit
> /tmp/ks.cfg.  Somewhat more user friendly would be to modify the previous
> %pre script  to prompt the user for the required information.
> 
> -------------------
> %pre
> 
> chvt 3
> exec < /dev/tty3 > /dev/tty3
> echo "--Static Network Configuration--"
> echo "Please enter ip address for this machine."
> read IPADDR
> ...
> -------------
> and so on, for the other required variables for the network line. After
> the line editing steps, before the end of %pre, change back to the
> graphical install screen:
> 
> chvt 1
> exec < /dev/tty1 > /dev/tty1
> 
> 
> -Ed
> 
> 
> 
> 
> > Forgot to mention that I am using redhat 9. I did try what you suggested
> but it did not ask for the network info and anaconda got an exception
> since there was no /tmp/netinfo file.
> >
> > Thanks,
> > Holger
> >
> > On 11 Sep 2003, Ed Brown wrote:
> >
> >> 	The following works with redhat 7.3 to allow entering static ip
> >> configuration.  I haven't tested with 8 or 9.
> >> 	Use this network line:
> >> network --device eth0 --bootproto query
> >> The query option, (undocumented for 7.3 I think, so it may have gone
> away in subsequent releases) brings up the network configuration window in
> the first stage of the install.  For some reason, this info is not
> communicated to anaconda in the second stage, so it needs a little help in
> the %pre section, to rewrite the network line in the copy of ks.cfg that
> is written to the hard drive:
> >> ------------------------
> >> %pre
> >> get()  {
> >>         grep $1 /tmp/netinfo |cut -d'=' -f2
> >> }
> >> device=`get DEVICE`
> >> ip=`get IPADDR`
> >> netmask=`get NETMASK`
> >> host=`get HOSTNAME`
> >> gateway=`get GATEWAY`
> >> nameserver=`grep  nameserver /etc/resolv.conf`
> >> line="network --bootproto static --device $device --ip $ip --netmask
> $netmask --hostname $host --gateway $gateway --$nameserver"
> >> ks="/tmp/ks.cfg"
> >> sed -e "/^network/s/^network.*/$line/" $ks >${ks}.tmp && mv ${ks}.tmp
> $ks
> >> -------------------------
> >> (Note that the last two lines begin with "line=" and "sed -e"
> >> respectively. There should be no line breaks. And of course those are
> backticks around the `get xxx`'s and `grep nameser...`)
> >> HTH,
> >> Ed
> >> On Thu, 2003-09-11 at 16:24, Holger Kiehl wrote:
> >> > Hello
> >> >
> >> > Is there a way to force kickstart to ask the user for the network
> >> information?
> >> >
> >> > Thanks,
> >> > Holger
> >> >
> >> >




[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