On 21 Jun, Dave Thacker wrote:
This has not worked. I've checked the /var/log/yaST2 logs to see if the
tags "<pxelinux>" show up and are acted upon, but I don't see them being
read or seen by autoyast. What can I do to debug this problem?
Have you tried adding a loghost option to the command line (or info file) to
see if it logs there? I seem to see more info in there then in the logs on a
host after it jumps.
That said... I wrote my own solution to the pxe config setup issue..
I use either mac address config files (01-), i.e. host
mac 00:02:A5:7F:65:92 becomes 01-00-02-a5-7f-65-92
or, I fall back to Hex value of IP: 192.168.1.1 becomes C0A80101
I also pass a variable of pxe=ethX,Y,Z.Z.Z.Z
where X is the ethernet card pxe booted (we did our first pxe boots on a
closed net using eth1 even though the host eventually config'd itself on our
compute net on eth0). Y is 0 for the NFS source is no on the pxe host and 1
for the NFS install source is on the same pxe host.
I wrote a pre.sh in my control files that does:
#!/bin/sh
echo "In pre-install"
if [ -n "`grep pxe= /proc/cmdline`" ]
then
echo "Need to disable tftpboot config"
pxe_ip=`cat /proc/cmdline | sed -e 's/.*pxe=eth.,//g' -e 's/ .*//g'`
pxe_ip=`echo $pxe_ip | sed 's/[0-9],//g'`
pxe_dev=`cat /proc/cmdline | sed -e 's/.*pxe=\(eth.\).*/\1/g'`
mkdir /tmp/pxe
mount -o rw,nolock ${pxe_ip}:/tftpboot /tmp/pxe
/bin/sh -xv /tmp/pxe/fix-pxe.sh $pxe_dev
umount /tmp/pxe
fi
the scripts are:
======
cornholio pxe {894}$ cat fix-pxe.sh
#!/bin/sh
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
if [ ! -x /bin/bash ]
then
if [ -x /usr/bin/bash ]
then
ln -s /usr/bin/bash /bin/bash
fi
fi
eth_dev=$1
if [ "x$eth_dev" = "x" ]
then
eth_dev=eth1
fi
MYIP=`ifconfig $eth_dev | awk '/inet addr/{print $2}' | awk -F: '{print $2}'`
mycfg=`/tmp/pxe/conv.sh $MYIP`
if [ "x$mycfg" = "x" ]
then
echo "Something happened.. mycfg is blank"
exit 1
fi
if [ ! -f /tmp/pxe/pxelinux.cfg/$mycfg ]
then
mycfg=`ifconfig $eth_dev | awk '/HWaddr/{print $NF}' | sed 's/:/-/g' | tr
'[:upper:]' '[:lower:]'`
mycfg="01-$mycfg"
fi
if [ ! -f /tmp/pxe/pxelinux.cfg/$mycfg ]
then
echo "Can't find pxe config file $mycfg"
exit 1
fi
mv -f /tmp/pxe/pxelinux.cfg/$mycfg /tmp/pxe/pxelinux.cfg/${mycfg}.orig
sed -e 's/^DEFAULT/#DEFAULT/g' -e 's/^#\(DEFAULT disk\)/\1/g'
/tmp/pxe/pxelinux.cfg/${mycfg}.orig > /tmp/pxe/pxelinux.cfg/$mycfg
chmod 666 /tmp/pxe/pxelinux.cfg/$mycfg
=========
and
cornholio pxe {895}$ cat conv.sh
#!/bin/bash
if [ $# -ne 1 ]
then
echo Usage: conv.sh $ip
exit 1
fi
hex () {
if [ $1 -lt 10 ]
then
echo $1
elif [ $1 = 10 ]
then
echo A
elif [ $1 = 11 ]
then
echo B
elif [ $1 = 12 ]
then
echo C
elif [ $1 = 13 ]
then
echo D
elif [ $1 = 14 ]
then
echo E
elif [ $1 = 15 ]
then
echo F
fi
}
IP=$1
for block in `echo $IP | sed 's/\./ /g'`
do
if [ $block -lt 10 ]
then
echo -n 0$block
else
let div=$block/16
let mult=$div*16
let rem=$block-$mult
echo -n `hex $div``hex $rem`
fi
done
echo ""
==================
So far, this has worked like a charm from sles8 through sles9-sp1.
The only negative is if the pre.sh runs, but the install has a problem later
for some reason. You have to go back and reset the config to pxe boot the
installer again instead of booting locally.
Of course, /tftpboot on the pxe/tftp server has to be exported root writeable
to all. We're doing pxe installs in our subnets now where our dns/dhcp system
hands out the pxe data, and a linux box serves as the pxe config box by
running tftp and exporting /tftpboot open for root.
Of course, you have to know the mac address and IP of a host before you
can jump it in this setup. We don't use a default.
--
Mike Marion-Unix SysAdmin/Staff Engineer-http://www.qualcomm.com
Marge: "Homer, we'd like to talk to you."
Homer: "But then I wouldn't be watching TV. You can see the bind I'm in."
==> Simpsons