export XCATDEBUGMODE="#TABLEBLANKOKAY:site:key=xcatdebugmode:value#" if [ "$XCATDEBUGMODE" != "0" ] && [ "$XCATDEBUGMODE" != "" ] then set -x fi if grep n8r /proc/cmdline > /dev/null 2>&1; then stty crtscts fi for x in 0 1 2 3 4 5 6 7 8 do mknod /dev/vcs$x c 7 $x mknod /dev/vcsa$x c 7 $[$x+128] done chmod 644 /dev/vcs* chown root /dev/vcs* if [ -r /tmp/updates/etc/pki/tls/certs/ca-bundle.crt ]; then cp -f /tmp/updates/etc/pki/tls/certs/ca-bundle.crt /etc/pki/tls/certs/ fi #there is no boot option to set dns search domain in kickstart file, #the search domain in /etc/resolv.conf is set in the pre installation script export MANAGEDADDRESSMODE=#MANAGEDADDRESSMODE# export SEARCHDOMAIN=#GETNODEDOMAIN:THISNODE# if [ "$MANAGEDADDRESSMODE" == "static" ]; then echo "#appended by %pre " >> /etc/resolv.conf echo "search $SEARCHDOMAIN" >> /etc/resolv.conf fi cat >/tmp/baz.py </tmp/foo.py < 0): percent = int(((count - 2) * 100)/numpack + .5) if(percent > 100): percent = 100 if(percent < 0): percent = 0 r2 = re.compile("^Installing (.*)\.") m2 = r2.search(line) if m2: newline = m2.group(1) newline = newline + " (" newline = newline + str(percent) newline = newline + "%)" # newline = newline + " [" # count = count - 2 # newline = newline + str(count) # newline = newline + "/" # newline = newline + str(numpack) # newline = newline + "]" else: newline = "prep" line = "installing " + newline if(line and post and not pre): line = "installing " + line if(not line): line = "installing prep" newSocket.send(line) break #UNCOMMENONXCATDEBUGMODE# if(command[0] == "sh"): #DEBUG purposes only, wide open root priv command here. #UNCOMMENONXCATDEBUGMODE# newcommand = "" #UNCOMMENONXCATDEBUGMODE# for i in command[1:]: #UNCOMMENONXCATDEBUGMODE# newcommand = newcommand + i + " " #UNCOMMENONXCATDEBUGMODE# output = os.popen(newcommand).read() #UNCOMMENONXCATDEBUGMODE# newSocket.send(output) #UNCOMMENONXCATDEBUGMODE# break if(command[0] == "screendump"): newcommand = "cat /dev/vcs" for i in command[1:]: newcommand = newcommand + i output = os.popen(newcommand).read() newSocket.send(output) break newSocket.close() finally: sock.close() EOF chmod 755 /tmp/foo.py chmod 755 /tmp/baz.py NODESTATUS=#TABLEBLANKOKAY:site:key=nodestatus:value# if [ -z "$NODESTATUS" ] || [ "$NODESTATUS" != "0" -a "$NODESTATUS" != "N" -a "$NODESTATUS" != "n" ]; then /tmp/baz.py "installstatus installing" & fi /tmp/foo.py >/foo.log 2>&1 & #time to ascertain fstype and PReP/UEFI/legacy #also, find first available block device (sda or vda likely) #TODO: pick a likely non-SAN target if possible shopt -s nullglob #The script getinstdisk is common for rh/sles/pkvm/ubuntu, it will write the install_disk into /tmp/install_disk file #INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/getinstdisk# if [ -e "/tmp/install_disk" ]; then instdisk=`cat /tmp/install_disk` fi # Could not determine the install disk for whatever reason, # try the default /dev/sda if [ -z "$instdisk" ]; then instdisk="/dev/sda" fi modprobe ext4 >& /dev/null modprobe ext4dev >& /dev/null if grep ext4dev /proc/filesystems > /dev/null; then FSTYPE=ext3 elif grep ext4 /proc/filesystems > /dev/null; then FSTYPE=ext4 else FSTYPE=ext3 fi BOOTFSTYPE=ext3 EFIFSTYPE=vfat if [ `uname -m` = "ppc64" ]; then echo 'part None --fstype "PPC PReP Boot" --ondisk '$instdisk' --size 8' >> /tmp/partitioning fi if [ -d /sys/firmware/efi ]; then echo 'bootloader --driveorder='$instdisk >> /tmp/partitioning echo 'part /boot/efi --size 50 --ondisk '$instdisk' --fstype '$EFIFSTYPE >> /tmp/partitioning else echo 'bootloader' >> /tmp/partitioning fi #TODO: ondisk detection, /dev/disk/by-id/edd-int13_dev80 for legacy maybe, and no idea about efi. at least maybe blacklist SAN if mptsas/mpt2sas/megaraid_sas seen... echo "part /boot --size 256 --fstype $BOOTFSTYPE --ondisk $instdisk" >> /tmp/partitioning echo "part swap --recommended --ondisk $instdisk" >> /tmp/partitioning echo "part / --size 1 --grow --ondisk $instdisk --fstype $FSTYPE" >> /tmp/partitioning #XCA_PARTITION_SCRIPT# # The following code is to generate the repository for the installation cat /proc/cmdline NEXTSERVER=`cat /proc/cmdline | grep http | head -n 1` NEXTSERVER=${NEXTSERVER#*http://} NEXTSERVER=${NEXTSERVER%%:*} export nextserver=$NEXTSERVER #INSTALL_SOURCES_IN_PRE# if [ "$XCATDEBUGMODE" != "0" ] && [ "$XCATDEBUGMODE" != "" ] then set +x fi