<div dir="ltr">Just a pratical example - i have used it with RHEL5 - , there are many  document on this<br>*********************************************************<br>****** Begin kickstart<br>*********************************************************<br>
# Use CDROM installation media<br>install<br>cdrom<br>reboot<br>monitor --noprobe<br>#platform=x86, AMD64, o Intel EM64T<br># System authorization information<br>auth  --useshadow  --enablemd5<br># System bootloader configuration<br>
bootloader --location=mbr --driveorder=sda  --md5pass=$1$LTpksksk$tgrE3JE2fXT/gqvVMUJwz1<br># Clear the Master Boot Record<br>zerombr<br># Partition clearing information<br>clearpart --all --initlabel<br>......................<br>
......................<br>timezone --isUtc Europe/London<br># Network     #<br>%include /tmp/network.cfg      <b><----------------------------------------</b><br># Disk Layout #<br>%include /tmp/disk.cfg           <b><----------------------------------------</b><br>
<br>%packages --nobase<br>@core<br>dbus<br>dbus-python<br>dbus-glib<br>hal<br>httpd<br>openldap-servers<br>openldap-clients<br>........................<br>........................<br><br>%pre  --interp /usr/bin/ash<br>PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH<br>
<br>echo_user () {<br>        echo >/dev/tty "$@"<br>}<br><br>ask () {<br>        echo_user<br>        echo_user -n "$1 [$2] ? "<br>        read res </dev/tty<br>        [ -z "$res" ] && res="$2"<br>
<br>        if [ ."$res" = .'!' ]<br>        then<br>                echo_user<br>                echo_user "Starting interactive shell, type 'exit' when done"<br>                sh </dev/tty >/dev/tty 2>&1<br>
                # re-do the prompt<br>                ask "$@"<br>        else<br>                echo "$res"<br>        fi<br>}<br><br>confirm () {<br>        res=$(ask "$1 (y/n)" "$2")<br>
        case "$res" in<br>        [yYjJ]*) true ;;<br>        *) false ;;<br>        esac<br>}<br><br>cmdline_val () {<br>        Res=$(cat /proc/cmdline | sed -n 's/.*'"$1"'=\([^ ]*\).*/\1/p')<br>
        if [ -z "$Res" ]<br>        then<br>                echo "$2"<br>        else<br>                echo "$Res"<br>        fi<br>}<br><br>die () {<br>        echo_user "FATAL: $*"<br>
        exit 1<br>}<br><br>gen_network() {<br>        echo -n "network --device $IFACE --bootproto static"<br>        [ ! -z "$IP"   ] && echo -n " --ip $IP"<br>        [ ! -z "$MASK" ] && echo -n " --netmask $MASK"<br>
<br>STTY_SAVE=$(stty -g </dev/tty)<br>stty sane </dev/tty<br>reset </dev/tty >/dev/tty || clear >/dev/tty<br><br>echo_user "*****************************************"<br>echo_user "*** EXAMPLE configuration kickstart ***"<br>
echo_user "*****************************************"<br>echo_user " - Hope for the better ...........       "<br>echo_user "   and enjoy                             "<br>echo_user "*****************************************"<br>
echo_user<br><br>Interactive="y"<br><br>if [ "$Interactive" ]<br>then<br>        while true<br>        do<br>            while [ -z "${NAME}"  ]<br>            do<br>             echo_user<br>
                cat <<EOF >/dev/tty<br>*******************************************************<br>** This is the list of valid hostname : please pick one<br>** The dns domain is <a href="http://example.com">example.com</a><br>
*******************************************************<br>example1<br>example2<br>EOF<br>                NAME=$(ask "Hostname (not fqdn qualified)" "$NAME")<br>                case "$NAME" in<br>
                example1)<br>                cat <<EOF >/tmp/network.cfg<br>network --device eth0 --noipv6 --bootproto static --ip x.y.z.h --netmask <a href="http://255.255.255.128">255.255.255.128</a> --nameserver <a href="http://127.0.0.1">127.0.0.1</a> --hostname <br>
EOF<br><br>cat <<EOF >/tmp/disk.cfg<br>clearpart --all --initlabel<br>part /boot --fstype ext3 --size 128<br>part swap --size=1024<br>part pv.3 --size 0  --grow --ondisk=sda<br>volgroup rootvg pv.3<br>logvol / --fstype ext3 --name=lv_root --vgname=rootvg --size=4096<br>
logvol /home --fstype ext3 --name=lv_home --vgname=rootvg --size=1024<br>logvol /opt --fstype ext3 --name=lv_opt --vgname=rootvg --size=512<br>logvol /tmp --fstype ext3 --name=lv_tmp --vgname=rootvg --size=1024<br>logvol /var --fstype ext3 --name=lv_var --vgname=rootvg --size=1024<br>
logvol /var/log --fstype ext3 --name=lv_var_log --vgname=rootvg --size=1024<br>logvol /var/tmp --fstype ext3 --name=lv_var_tmp --vgname=rootvg --size=1024<br>logvol /var/www --fstype ext3 --name=lv_var_www --vgname=rootvg --size=1024<br>
logvol /var/log/audit --fstype ext3 --name=lv_audit --vgname=rootvg --size=1024<br>EOF<br>                ;;<br>.........<br>.........  (for example2)<br><br>                *)<br>                clear >/dev/tty<br>                NAME=""<br>
                ;;<br>                esac<br>               done<br>                echo_user<br>                echo_user "--------------------- WARNING -------------------------------"<br>                echo_user "This is your last chance to stop the installation. Continuing"<br>
                echo_user "will erase the destination disk and install noninteractively."<br>                echo_user "Answer 'n' if you need to reedit your settings."<br><br>else<br>        # noninteractive<br>
        gen_network > /tmp/network.cfg<br>fi<br># restore file descriptors and TTY<br>clear >/dev/tty<br>stty $STTY_SAVE </dev/tty<br>%post <br>(<br>.....<br>.....<br>)<br><br>***********************************************<br>
It is an incomplete example, the dynamic part was for the network config, but i think it could  be useful anyway<br><br>Regards<br><br><div class="gmail_quote">2008/7/24 Mogens Kjaer <<a href="mailto:mk@crc.dk">mk@crc.dk</a>>:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">yersinia wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
In kickstart it is simple ask the user in %pre, generate the file stanza<br>
based on user request, and %include in kickstart the generate file stanza<br>
</blockquote>
<br>
How does one ask the user in %pre?<br>
<br>
Mogens<br>
<br>
-- <br>
Mogens Kjaer, Carlsberg A/S, Computer Department<br>
Gamle Carlsberg Vej 10, DK-2500 Valby, Denmark<br>
Phone: +45 33 27 53 25, Fax: +45 33 27 47 08<br>
Email: <a href="mailto:mk@crc.dk" target="_blank">mk@crc.dk</a> Homepage: <a href="http://www.crc.dk" target="_blank">http://www.crc.dk</a><br><font color="#888888">
<br>
-- <br>
fedora-devel-list mailing list<br>
<a href="mailto:fedora-devel-list@redhat.com" target="_blank">fedora-devel-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/fedora-devel-list" target="_blank">https://www.redhat.com/mailman/listinfo/fedora-devel-list</a><br>
</font></blockquote></div><br></div>