diff --git a/xCAT-nbroot2/install b/xCAT-nbroot2/install index 441212a79..6b6056880 100755 --- a/xCAT-nbroot2/install +++ b/xCAT-nbroot2/install @@ -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" diff --git a/xCAT-nbroot2/xcat-cmdline.sh b/xCAT-nbroot2/xcat-cmdline.sh index 9668b7fc1..23eedaa68 100755 --- a/xCAT-nbroot2/xcat-cmdline.sh +++ b/xCAT-nbroot2/xcat-cmdline.sh @@ -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