From 5dd5713d695b3e936761510303672abd417486ec Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 14 Jan 2011 15:16:11 +0000 Subject: [PATCH] -Script to make RHEL6 do DUID-UUID git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8649 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/share/xcat/scripts/genduiduuid.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 xCAT-server/share/xcat/scripts/genduiduuid.sh diff --git a/xCAT-server/share/xcat/scripts/genduiduuid.sh b/xCAT-server/share/xcat/scripts/genduiduuid.sh new file mode 100644 index 000000000..016046316 --- /dev/null +++ b/xCAT-server/share/xcat/scripts/genduiduuid.sh @@ -0,0 +1,19 @@ +if [ ! -r /etc/redhat-release ] || ! grep "release 6" /etc/redhat-release >/dev/null; then + exit 0; #only rhel6 supported +fi +if [ -r /sys/devices/virtual/dmi/id/product_uuid ]; then + duid='default-duid "\000\004'; + for i in `sed -e s/-//g -e 's/\(..\)/\1 /g' /sys/devices/virtual/dmi/id/product_uuid`; do + num=`printf "%d" 0x$i` + octnum=`printf "\\%03o" 0x$i` + if [ $num -lt 127 -a $num -gt 31 ]; then + octnum=`printf $octnum` + fi + duid=$duid$octnum + done + duid=$duid'";' + for interface in `ifconfig -a|grep HWaddr|awk '{print $1}'`; do + echo $duid > /var/lib/dhclient/dhclient6-$interface.leases + done + echo $duid > /var/lib/dhclient/dhclient6.leases +fi