Lay groundwork for key publication in 'nbfs2' via LLDP

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10043 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2011-07-08 18:46:24 +00:00
parent 10e91bb2d4
commit a86fa76fea
2 changed files with 24 additions and 1 deletions

View File

@ -3,7 +3,7 @@ echo $drivers
dracut_install wget openssl tar ipmitool cpio gzip dash modprobe touch echo cut wc
dracut_install grep ip hostname awk egrep grep dirname expr
dracut_install mount.nfs sshd vi reboot lspci parted libvirtd /usr/share/libvirt/cpu_map.xml mkfs mkfs.ext4 mkfs.btrfs
dracut_install mkswap df brctl vconfig ifenslave ssh-keygen /usr/libexec/qemu-kvm scp clear dhclient
dracut_install mkswap df brctl vconfig ifenslave ssh-keygen /usr/libexec/qemu-kvm scp clear dhclient lldpad
dracut_install poweroff
inst "$moddir/xcatroot" "/sbin/xcatroot"
inst "$moddir/dhclient-script" "/sbin/dhclient-script"

View File

@ -48,6 +48,29 @@ echo 'Protocol 2' >> /etc/ssh/sshd_config
/usr/sbin/sshd
dhclient $bootnic &
dhclient -6 $bootnic -lf /var/lib/dhclient/dhclient6.leases &
mkdir -p /etc/xcat
openssl genrsa -out /etc/xcat/privkey.pem 1024
PUBKEY=`openssl rsa -in /etc/xcat/privkey.pem -pubout|grep -v "PUBLIC KEY"`
PUBKEY=`echo $PUBKEY|sed -e 's/ //g'`
mkdir -p /var/lib/lldpad
echo 'lldp :' >> /var/lib/lldpad/lldpad.conf
echo '{' >> /var/lib/lldpad/lldpad.conf
for iface in `ip link |grep -v '^ '|awk '{print $2}'|sed -e 's/:$//'`; do
echo "$iface :" >> /var/lib/lldpad/lldpad.conf
echo "{" >> /var/lib/lldpad/lldpad.conf
echo "tlvid00000006 :" >> /var/lib/lldpad/lldpad.conf
echo "{" >> /var/lib/lldpad/lldpad.conf
echo info = '"'$PUBKEY'";' >> /var/lib/lldpad/lldpad.conf
echo '};' >> /var/lib/lldpad/lldpad.conf
echo 'adminStatus = 3;' >> /var/lib/lldpad/lldpad.conf
echo '};' >> /var/lib/lldpad/lldpad.conf
done
echo '};' >> /var/lib/lldpad/lldpad.conf
lldpad -d
gripeiter=101
echo -n "Acquiring network addresses.."
while ! ip addr show dev $bootnic|grep -v 'scope link'|grep -v 'dynamic'|grep -v inet6|grep inet > /dev/null; do