Commit b6d82f16 authored by Thomas Goirand's avatar Thomas Goirand

Using system serial number, and not chassis anymore.

parent 8ddb4fe6
......@@ -35,14 +35,15 @@ sed -i ${NMU_LINES}'s/,$//' ${TMPFILE2}
echo ' ],' >>${TMPFILE2}
# Chassis serial number, product name, BIOS version, IPMI version, IPMI ip
CHASSIS_SERIAL=$(dmidecode -s chassis-serial-number)
#CHASSIS_SERIAL=$(dmidecode -s chassis-serial-number)
SYSTEM_SERIAL=$(dmidecode -s system-serial-number)
PRODUCT_NAME=$(dmidecode -t 1 | grep "Product Name" | sed -e "s/[ \t]*Product Name:[ ]*//" -e "s/,//g")
LADVDC_MINUS_B=$(ladvdc -b | grep -E '^HOSTNAME_0' | sed -e 's/HOSTNAME_0=//' -e "s/'//g")
BIOS_VERSION=$(dmidecode -s bios-version)
IPMI_FIRMWARE_VERSION=$(ipmitool mc info | grep "Firmware Revision" | awk '{print $4}')
IPMI_DETECTED_IP=$(ipmitool lan print 1 | grep -E "IP Address[ ]*:" | sed 's/IP Address[ \t:]*//')
echo ' "machine": [' >>${TMPFILE2}
echo ' {"serial": "'${CHASSIS_SERIAL}'", "productname": "'${PRODUCT_NAME}'", "bios_version": "'${BIOS_VERSION}'", "ipmi_firmware_version": "'${IPMI_FIRMWARE_VERSION}'", "ipmi_detected_ip": "'${IPMI_DETECTED_IP}'", "ladvd_report": "'${LADVDC_MINUS_B}'"}' >>${TMPFILE2}
echo ' {"serial": "'${SYSTEM_SERIAL}'", "productname": "'${PRODUCT_NAME}'", "bios_version": "'${BIOS_VERSION}'", "ipmi_firmware_version": "'${IPMI_FIRMWARE_VERSION}'", "ipmi_detected_ip": "'${IPMI_DETECTED_IP}'", "ladvd_report": "'${LADVDC_MINUS_B}'"}' >>${TMPFILE2}
echo ' ],' >>${TMPFILE2}
......
......@@ -32,6 +32,7 @@ sleep 5
PXE_SERVER_IP=\$(cat /etc/oci/pxe-server-ip)
CHASSIS_SERIAL=\$(dmidecode -s chassis-serial-number)
SYSTEM_SERIAL=\$(dmidecode -s system-serial-number)
DEFROUTE_IF=\$(awk '{ if ( \$2 == \"00000000\" ) print \$1 }' /proc/net/route)
if [ -n \"\${DEFROUTE_IF}\" ] ; then
......@@ -47,7 +48,7 @@ else
IP_PARAM=\"\"
fi
curl \"http://\${PXE_SERVER_IP}/oci/install-status.php?status=installed&chassis-serial=\${CHASSIS_SERIAL}\${IP_PARAM}\"
curl \"http://\${PXE_SERVER_IP}/oci/install-status.php?status=installed&chassis-serial=\${SYSTEM_SERIAL}\${IP_PARAM}\"
" >${BODI_CHROOT_PATH}/usr/bin/oci-report-status
chmod +x ${BODI_CHROOT_PATH}/usr/bin/oci-report-status
......@@ -225,7 +226,7 @@ export LS_OPTIONS='--color=auto'
eval \"\$(dircolors)\"
alias ls='ls \${LS_OPTIONS}'
CHASSIS_SERIAL_NUM=\$(cat /etc/serial_number)
SYSTEM_SERIAL_NUM=\$(cat /etc/serial_number)
RED=\"\\[\\033[1;31m\\]\"
LGRAY=\"\\[\\033[0;37m\\]\"
......@@ -234,7 +235,7 @@ CHASSIS_SERIAL_NUM=\$(cat /etc/serial_number)
NO_COL=\"\\[\\033[0m\\]\"
LBLUE=\"\\[\\033[1;36m\\]\"
export PS1=\${RED}'\\u'\${LGRAY}@\${TEAL}\${CHASSIS_SERIAL_NUM}\${LGRAY}-\${BLUE}'\\h'\${LGRAY}'>_'\${NO_COL}' \\w # '
export PS1=\${RED}'\\u'\${LGRAY}@\${TEAL}\${SYSTEM_SERIAL_NUM}\${LGRAY}-\${BLUE}'\\h'\${LGRAY}'>_'\${NO_COL}' \\w # '
alias ssh='ssh -A -X'
......@@ -392,9 +393,10 @@ rac5.inipath=/opt/dell/srvadmin/etc/srvadmin-isvc
fi
# Add chassis serial number in /etc
CHASSIS_SERIAL_NUMBER=$(dmidecode -s chassis-serial-number)
echo ${CHASSIS_SERIAL_NUMBER} > ${BODI_CHROOT_PATH}/etc/serialnumber
echo ${CHASSIS_SERIAL_NUMBER} > ${BODI_CHROOT_PATH}/etc/serial_number
#CHASSIS_SERIAL_NUMBER=$(dmidecode -s chassis-serial-number)
SYSTEM_SERIAL_NUMBER=$(dmidecode -s system-serial-number)
echo ${SYSTEM_SERIAL_NUMBER} > ${BODI_CHROOT_PATH}/etc/serialnumber
echo ${SYSTEM_SERIAL_NUMBER} > ${BODI_CHROOT_PATH}/etc/serial_number
chmod 0400 ${BODI_CHROOT_PATH}/etc/serialnumber ${BODI_CHROOT_PATH}/etc/serial_number
HOSTNAME=$(cat ${BODI_CHROOT_PATH}/etc/hostname)
......
......@@ -141,13 +141,15 @@ set -e
# Set status = live
PXE_SERVER_IP=\$(cat /etc/oci/pxe-server-ip)
CHASSIS_SERIAL=\$(dmidecode -s chassis-serial-number)
#CHASSIS_SERIAL=\$(dmidecode -s chassis-serial-number)
SYSTEM_SERIAL=\$(dmidecode -s system-serial-number)
curl \"http://\${PXE_SERVER_IP}/oci/install-status.php?status=live&chassis-serial=\${CHASSIS_SERIAL}\"
curl \"http://\${PXE_SERVER_IP}/oci/install-status.php?status=live&chassis-serial=\${SYSTEM_SERIAL}\"
CHASSIS_SERIAL_NUM=\$(dmidecode -s chassis-serial-number)
echo \${CHASSIS_SERIAL_NUM} >/etc/oci_chassis_serial_num
SYSTEM_SERIAL_NUM=\$(dmidecode -s system-serial-number)
echo \${SYSTEM_SERIAL_NUM} >/etc/oci_system_serial_num
# Install the daemon
update-rc.d oci-agent-daemon defaults
......@@ -190,7 +192,7 @@ export LS_OPTIONS='--color=auto'
eval \"\$(dircolors)\"
alias ls='ls \${LS_OPTIONS}'
CHASSIS_SERIAL_NUM=\$(cat /etc/oci_chassis_serial_num)
SYSTEM_SERIAL_NUM=\$(cat /etc/oci_system_serial_num)
BLUE=\"\\[\\033[1;34m\\]\"
LGRAY=\"\\[\\033[0;37m\\]\"
......@@ -198,7 +200,7 @@ NO_COL=\"\\[\\033[0m\\]\"
LBLUE=\"\\[\\033[1;36m\\]\"
RED=\"\\[\\033[1;31m\\]\"
export PS1=\${RED}'\\u'\${LGRAY}@\${BLUE}\${CHASSIS_SERIAL_NUM}\${LGRAY}'>_'\${NO_COL}' \\w # '
export PS1=\${RED}'\\u'\${LGRAY}@\${BLUE}\${SYSTEM_SERIAL_NUM}\${LGRAY}'>_'\${NO_COL}' \\w # '
alias ssh='ssh -A -X'
......@@ -219,7 +221,7 @@ export LS_OPTIONS='--color=auto'
eval \"\$(dircolors)\"
alias ls='ls \${LS_OPTIONS}'
CHASSIS_SERIAL_NUM=\$(cat /etc/oci_chassis_serial_num)
SYSTEM_SERIAL_NUM=\$(cat /etc/oci_system_serial_num)
BLUE=\"\\[\\033[1;34m\\]\"
LGRAY=\"\\[\\033[0;37m\\]\"
......@@ -227,7 +229,7 @@ NO_COL=\"\\[\\033[0m\\]\"
LBLUE=\"\\[\\033[1;36m\\]\"
RED=\"\\[\\033[1;31m\\]\"
GREEN=\"\\[\\033[1;32m\\]\"
export PS1=\${GREEN}'\\u'\${LGRAY}@\${BLUE}\${CHASSIS_SERIAL_NUM}\${LGRAY}'>_'\${NO_COL}' \\w # '
export PS1=\${GREEN}'\\u'\${LGRAY}@\${BLUE}\${SYSTEM_SERIAL_NUM}\${LGRAY}'>_'\${NO_COL}' \\w # '
export PAGER=most
" >config/includes.chroot/home/user/.bashrc
......
......@@ -43,6 +43,7 @@ openstack-cluster-installer (22) UNRELEASED; urgency=medium
* Add support for Stein's separated placement.
* Adapt puppet manifests so that they also work with Stein's puppet-openstack.
* Add the feature to setup any machine with software RAID.
* Using system serial number, and not chassis anymore.
[ Oliver Chaze ]
* swift: do not log in syslog general logs
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment