From af305e1c65c945ed098c0d68d9300122132bbe14 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 10 Feb 2014 13:59:14 -0500 Subject: [PATCH] RHEL7 support for diskful compute profile complete --- ...e.rhels7.pkglist => compute.rhel7.pkglist} | 1 + ...compute.rhels7.tmpl => compute.rhel7.tmpl} | 4 +- xCAT-server/share/xcat/install/scripts/pre.rh | 2 + .../share/xcat/install/scripts/pre.rh.rhel7 | 218 ++++++++++++++++++ 4 files changed, 223 insertions(+), 2 deletions(-) rename xCAT-server/share/xcat/install/rh/{compute.rhels7.pkglist => compute.rhel7.pkglist} (96%) rename xCAT-server/share/xcat/install/rh/{compute.rhels7.tmpl => compute.rhel7.tmpl} (95%) create mode 100644 xCAT-server/share/xcat/install/scripts/pre.rh.rhel7 diff --git a/xCAT-server/share/xcat/install/rh/compute.rhels7.pkglist b/xCAT-server/share/xcat/install/rh/compute.rhel7.pkglist similarity index 96% rename from xCAT-server/share/xcat/install/rh/compute.rhels7.pkglist rename to xCAT-server/share/xcat/install/rh/compute.rhel7.pkglist index 675b27249..8ce3030c3 100644 --- a/xCAT-server/share/xcat/install/rh/compute.rhels7.pkglist +++ b/xCAT-server/share/xcat/install/rh/compute.rhel7.pkglist @@ -1,4 +1,5 @@ #Please make sure there is a space between @ and group name +wget ntp nfs-utils net-snmp diff --git a/xCAT-server/share/xcat/install/rh/compute.rhels7.tmpl b/xCAT-server/share/xcat/install/rh/compute.rhel7.tmpl similarity index 95% rename from xCAT-server/share/xcat/install/rh/compute.rhels7.tmpl rename to xCAT-server/share/xcat/install/rh/compute.rhel7.tmpl index e18896eb0..ad84661d4 100644 --- a/xCAT-server/share/xcat/install/rh/compute.rhels7.tmpl +++ b/xCAT-server/share/xcat/install/rh/compute.rhel7.tmpl @@ -145,8 +145,8 @@ reboot #INCLUDE_DEFAULT_PKGLIST# %end %pre -#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/pre.rh# +#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/pre.rh.rhel7# %end %post -#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.rh# +#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.xcat# %end diff --git a/xCAT-server/share/xcat/install/scripts/pre.rh b/xCAT-server/share/xcat/install/scripts/pre.rh index 03d591e80..72f691e86 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.rh +++ b/xCAT-server/share/xcat/install/scripts/pre.rh @@ -76,6 +76,8 @@ try: percent = 0 count = 0 numpack = 0 + if(os.path.isfile('/tmp/packaging.log')): + ilog = '/tmp/packaging.log' if(os.path.isfile('/mnt/sysimage/root/install.log')): ilog = '/mnt/sysimage/root/install.log' if(os.path.isfile('/mnt/sysimage/tmp/install.log')): diff --git a/xCAT-server/share/xcat/install/scripts/pre.rh.rhel7 b/xCAT-server/share/xcat/install/scripts/pre.rh.rhel7 new file mode 100644 index 000000000..392a6ce13 --- /dev/null +++ b/xCAT-server/share/xcat/install/scripts/pre.rh.rhel7 @@ -0,0 +1,218 @@ +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 +for disk in /dev/vd*[^0-9];do + if [ -z "$firstdirectdisk" ]; then firstdirectdisk=$disk; fi #remember first disk as a guess of medium resort + eddname=$(/lib/udev/edd_id $disk 2> /dev/null) + if [ ! -z "$eddname" -a "$eddname" = "int13_dev80" ]; then + instdisk=$disk + break + fi +done + +if [ -z "$instdisk" ]; then + for disk in /dev/sd*[^0-9]; do + eddname=$(/lib/udev/edd_id $disk 2> /dev/null) + if [ ! -z "$eddname" -a "$eddname" = "int13_dev80" ]; then + instdisk=$disk + break + fi + currdriver=`udevadm info --attribute-walk --name $disk |grep DRIVERS|grep -v '""'|grep -v '"sd"'|head -n 1|sed -e 's/[^"]*"//' -e 's/"//'` + case "$currdriver" in + "ata_piix4"|"PMC MaxRAID"|"ahci"|"megaraid_sas") #certainly direct + if [ -z "$firstdirectdisk" ]; then firstdirectdisk=$disk; fi #remember first disk as a guess of medium resort + ;; + "mptsas"|"mpt2sas") #*PROBABLY* not SAN, but SAS SAN is possible + if [ -z "$probablyfirstdirectdisk" ]; then probablyfirstdirectdisk=$disk; fi #remember first disk as a guess of medium resort + ;; + *) + if [ -z "$firstdisk" ]; then firstdisk=$disk; fi #remember first disk as a guess of medium resort + ;; + esac + done +fi + +if [ -z "$instdisk" ]; then + if [ ! -z "$firstdirectdisk" ]; then + instdisk=$firstdirectdisk + elif [ ! -z "$probablyfirstdirectdisk" ]; then + instdisk=$probablyfirstdirectdisk + elif [ ! -z "$firstdisk" ]; then + instdisk=$firstdisk + fi +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 + +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 'part /boot/efi --size 50 --ondisk '$instdisk' --fstype vfat' >> /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 ext3 --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# + +