export XCATDEBUGMODE="#TABLEBLANKOKAY:site:key=xcatdebugmode:value#" if [ "$XCATDEBUGMODE" = "1" ] || [ "$XCATDEBUGMODE" = "2" ]; 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 cat >/tmp/baz.py </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 getinstdisk script is common for RHEL/SLES/PowerKVM/Ubuntu. # It will attempt to select the install disk and write the selection to /tmp/xcat.install_disk # #INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/getinstdisk# if [ -e "/tmp/xcat.install_disk" ]; then instdisk=`cat /tmp/xcat.install_disk` 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 -r|grep -q '^3.*el7'; then BOOTFSTYPE=xfs FSTYPE=xfs EFIFSTYPE=efi fi echo "ignoredisk --only-use=$instdisk" >> /tmp/partitionfile if [ `uname -m` = "ppc64" -o `uname -m` = "ppc64le" ]; then echo 'part None --fstype "PPC PReP Boot" --ondisk '$instdisk' --size 8' >> /tmp/partitionfile fi if [ -d /sys/firmware/efi ]; then echo 'part /boot/efi --size 50 --ondisk '$instdisk' --fstype '$EFIFSTYPE >> /tmp/partitionfile 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 512 --fstype $BOOTFSTYPE --ondisk $instdisk" >> /tmp/partitionfile echo "part swap --recommended --ondisk $instdisk" >> /tmp/partitionfile echo "part pv.01 --size 1 --grow --ondisk $instdisk" >> /tmp/partitionfile echo "volgroup system pv.01" >> /tmp/partitionfile echo "logvol / --vgname=system --name=root --size 1 --grow --fstype $FSTYPE" >> /tmp/partitionfile #specify "bootloader" configuration in "/tmp/partitionfile" if there is no user customized partition file BOOTLOADER="bootloader " #Specifies which drive the boot loader should be written to #and therefore which drive the computer will boot from. [ -n "$instdisk" ] && BOOTLOADER=$BOOTLOADER" --boot-drive=$(basename $instdisk)" echo "$BOOTLOADER" >> /tmp/partitionfile #XCA_PARTITION_SCRIPT# #specify the kernel options which will be persistent after installation if [ -n "#ENV:PERSKCMDLINE#" ];then #append the persistent kernel options to the lines including "bootloader --append" sed -i -e /bootloader/s#\'#\"#g -e '/bootloader/s/--append=\([^"]\S*[^"]\)/--append="\1"/g' -e '/bootloader/s/--append="\(.*\)"/--append="\1 #ENV:PERSKCMDLINE#"/g' /tmp/partitionfile #append the persistent kernel options to the lines including "bootloader" without "--append" sed -i -e '/bootloader/{/append=/!s/$/& --append="#ENV:PERSKCMDLINE#" /}' /tmp/partitionfile #append the persistent kernel options to /tmp/partitionfile if it does not include "bootloader" grep bootloader /tmp/partitionfile >/dev/null 2>&1|| echo -e "bootloader --append=\"#ENV:PERSKCMDLINE#\"" >>/tmp/partitionfile fi #save the content of /tmp/partitionfile in /var/log/xcat/xcat.log #so that we can inspect the partition scheme after installation echo "=================The Partition Scheme================" cat /tmp/partitionfile echo "=====================================================" # 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" = "1" ] || [ "$XCATDEBUGMODE" = "2" ]; then set +x fi