[ale] [ALE] Any Kickstart Guru's In the House

Chuck Payne terrorpup at gmail.com
Tue May 22 13:01:57 EDT 2012


Hey Guys,

I neeed help for Kickstart Guru.

I am trying to get my kickstart to work, where I can type the host
name, up, and nic and it will place it.

I have two script a pre and post . While the box is being build, if I
log in tty2, I can see that it is create the files from the pre, but I
am not seeing them place in the post.  I was able to copy the file to
the tmp of the system and place them, but I want to script to do it.


------------------------------------------PRE
----------------------------------------------------------

chvt 6

read -p "
What is my fully-qualified hostname (ex. somehost.magidesign.com)?
" NAME < /dev/tty6 >/dev/tty6 2>&1

read -p "
What is my IP address?
" IP < /dev/tty6 >/dev/tty6 2>&1

read -p "
What is my netmask?
" NM < /dev/tty6 >/dev/tty6 2>&1

read -p "
What is my default gateway?
" GATEWAY < /dev/tty6 >/dev/tty6 2>&1

read -p "
What network interface am I using (ex. eth0, eth1, etc)?
" INT < /dev/tty6 >/dev/tty6 2>&1

# ===================================

# Create /etc/sysconfig/network file
echo "NETWORKING=yes
GATEWAY=${GATEWAY}
HOSTNAME=${NAME}" > /root/network

#Create network config
echo "DEVICE=${INT}
ONBOOT=yes
NETMASK=${NM}
IPADDR=${IP}
TYPE=Ethernet
USERCTL=no
IPV6INIT=no " > /root/ifcfg-${INT}

cat /etc/sysconfig/network-scripts/ifcfg-${INT} | grep HW >> /root/ifcfg-${INT}

echo ${INT} > /root/tmp-int

chvt 1

---------------------------------------------------PRE
SCRIPT-------------------------------------------


There is one other issue, doesn't look like it copying my script to
the box as well. If I do 2>&1 to a log, I should be able to get my
output correct?


--------------------------------------------------Post
SCRIPT---------------------------------------------

cp /etc/resolv.conf /mnt/sysimage/etc/resolv.conf
# copy files
cp -f /root/network /mnt/sysimage/etc/sysconfig/network
cp -f /root/ifcfg-eth* /mnt/sysimage/etc/sysconfig/network-scripts/
cp -f /root/tmp-int /mnt/sysimage/root

# force hostname change
export LONG=`/mnt/sysimage/bin/grep -i hostname
/mnt/sysimage/etc/sysconfig/network | /mnt/sysimage/bin/cut -f2 -d=`
export SHORT=`/mnt/sysimage/bin/echo $LONG | /mnt/sysimage/bin/cut -f1 -d.`
/mnt/sysimage/bin/hostname $LONG

# setup variables for use in /etc/hosts
export INT=`/mnt/sysimage/bin/cat /mnt/sysimage/tmp/tmp-int`
export IP=`/mnt/sysimage/bin/grep -i ipaddr
/mnt/sysimage/etc/sysconfig/network-scripts/ifcfg-$INT |
/mnt/sysimage/bin/cut -f2 -d=`
echo "${IP}                     ${LONG} ${SHORT}" >> /mnt/sysimage/etc/hosts

#/mnt/sysimage/bin/rm -f /mnt/sysimage/root/tmp-int

%post
# Fix resolv.conf
cat >> /etc/resolv.conf << EOF
nameserver 65.166.136.9
nameserver 38.116..38.49
nameserver 65.166.136.2
domain magidesign.com
search magidesign.net magidesign.com
EOF

# Set up the server to be a part of magi
cp motd motd.old
cd /tmp
wget https://spacewalk2.magidesign.com/pub/motd

cd /mnt/sysimage/usr/local/bin
wget https://spacewalk2.magidesign.com/pub/sat_reg.sh
chmod +x /mnt/sysimage/usr/local/bin/sat_reg.sh
wget https://spacewalk2.magidesign.com/pub/magi_setup.sh
chmod +x /mnt/sysimage/usr/local/bin/magi_setup.sh
/mnt/usr/local/bin/sat_reg.sh
/mnt/usr/local/bin/magi_setup.sh

cd /tmp
wget http://spacewalk2.magidesign.com/pub/webmin-1.580-1.noarch.rpm
rpm -ivh webmin-1.580-1.noarch.rpm

---------------------------------------------------POST
SCRIPT-----------------------------------------------------
--
Terror PUP a.k.a
Chuck "PUP" Payne

(678) 636-9678
-----------------------------------------
Discover it! Enjoy it! Share it! openSUSE Linux.
-----------------------------------------
openSUSE -- en.opensuse.org/User:Terrorpup
openSUSE Ambassador/openSUSE Member
Community Manager -- Southeast Linux Foundation (SELF)
skype,twiiter,identica,friendfeed -- terrorpup
freenode(irc) --terrorpup/lupinstein
Register Linux Userid: 155363

Have you tried SUSE Studio? Need to create a Live CD,  an app you want to
package and distribute , or create your own linux distro. Give SUSE Studio a
try. www.susestudio.com.
See you at Southeast Linux Fest, June 8-10, 2012 in Charlotte, NC.
www.southeastlinuxfest.org



More information about the Ale mailing list