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

Brian MacLeod nym.bnm at gmail.com
Tue May 22 13:11:55 EDT 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

My first guess is that you are running these in two different
environments:

The %pre gets run in the environment of the boot image (whatever its
source its).

The %post, without seeing the relevant lines, is being run in a chroot
environment of your newly installed system.  As such, /root is a
different place than the /root %PRE stashed the files.

You probably want:

%post --nochroot

For this to work.

And in case it is a question (for you or others), you can have
multiple %posts, some chroot and some not.  Just separate what you
need appropriately.


Brian


On 5/22/12 1:01 PM, Chuck Payne wrote:
> 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
> 
> _______________________________________________ Ale mailing list 
> Ale at ale.org http://mail.ale.org/mailman/listinfo/ale See JOBS,
> ANNOUNCE and SCHOOLS lists at http://mail.ale.org/mailman/listinfo

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQE4BAEBCAAiBQJPu8jaGxhoa3A6Ly9rZXlzZXJ2ZXIudWJ1bnR1LmNvbQAKCRD5
XCJY/q4Y6IDYCACOke+DYOmh1GzudhvNrkuFmEN7qkISuZuewexd4YTTUFudP4ga
JIr4/94c109Kh6GTeNw2DM1/bA5f0pSEwkGhNkn6l8te8JltVTRwg5Cz/6SQCxcD
D+SCH3LsmtGufEk4PzZdhHumbhK/o6lWunMZLZj/gyYuiJnlvDhHAfUwAiGp11iy
Hzro3/cwGV+uaqgPjgbbNq1O9arTBMl0CvNydyC0tdlQ9MU5dDtDu+CurCq0Ln19
5i6UtrLjRPrQpjoh0gesLRuTdkrQQqnQH8unle+YcnNfs6xitjtSSEfvbjJpEDj5
sT+Sf+UAUUY88wCGBzkyNBK2xbjoD6kNZBY0
=4nYj
-----END PGP SIGNATURE-----


More information about the Ale mailing list