diff --git a/docs/source/guides/admin-guides/references/man5/linuximage.5.rst b/docs/source/guides/admin-guides/references/man5/linuximage.5.rst index 1028e48ac..f9855f147 100644 --- a/docs/source/guides/admin-guides/references/man5/linuximage.5.rst +++ b/docs/source/guides/admin-guides/references/man5/linuximage.5.rst @@ -158,7 +158,7 @@ linuximage Attributes: \ **partitionfile**\ - The path of the configuration file which will be used to partition the disk for the node. For stateful osimages,two types of files are supported: "" which contains a partitioning definition that will be inserted directly into the generated autoinst configuration file and must be formatted for the corresponding OS installer (e.g. kickstart for RedHat, autoyast for SLES, pressed for Ubuntu). "s:" which specifies a shell script that will be run from the OS installer configuration file %pre section; the script must write the correct partitioning definition into the file /tmp/partitionfile on the node which will be included into the configuration file during the install process. For statelite osimages, partitionfile should specify ""; see the xCAT Statelite documentation for the xCAT defined format of this configuration file.For Ubuntu, besides "" or "s:", the disk name(s) to partition must be specified in traditional, non-devfs format, delimited with space, it can be specified in 2 forms: "d:" which contains the disk name(s) to partition and "s:d:" which runs in pressed/early_command and writes the disk names into the "/tmp/install_disk" . To support other specific partition methods such as RAID or LVM in Ubuntu, some additional preseed values should be specified, these values can be specified with "c:" which contains the additional pressed entries in "d-i ..." form and "s:c:" which runs in pressed/early_command and set the preseed values with "debconf-set". The multiple values should be delimited with comma "," + The path of the configuration file which will be used to partition the disk for the node. For stateful osimages,two types of files are supported: "" which contains a partitioning definition that will be inserted directly into the generated autoinst configuration file and must be formatted for the corresponding OS installer (e.g. kickstart for RedHat, autoyast for SLES, pressed for Ubuntu). "s:" which specifies a shell script that will be run from the OS installer configuration file %pre section; the script must write the correct partitioning definition into the file /tmp/partitionfile on the node which will be included into the configuration file during the install process. For statelite osimages, partitionfile should specify ""; see the xCAT Statelite documentation for the xCAT defined format of this configuration file.For Ubuntu, besides "" or "s:", the disk name(s) to partition must be specified in traditional, non-devfs format, delimited with space, it can be specified in 2 forms: "d:" which contains the disk name(s) to partition and "s:d:" which runs in pressed/early_command and writes the disk names into the "/tmp/xcat.install_disk" . To support other specific partition methods such as RAID or LVM in Ubuntu, some additional preseed values should be specified, these values can be specified with "c:" which contains the additional pressed entries in "d-i ..." form and "s:c:" which runs in pressed/early_command and set the preseed values with "debconf-set". The multiple values should be delimited with comma "," diff --git a/docs/source/guides/admin-guides/references/man7/osimage.7.rst b/docs/source/guides/admin-guides/references/man7/osimage.7.rst index 23ac6bd49..308479527 100644 --- a/docs/source/guides/admin-guides/references/man7/osimage.7.rst +++ b/docs/source/guides/admin-guides/references/man7/osimage.7.rst @@ -279,7 +279,7 @@ osimage Attributes: \ **partitionfile**\ (linuximage.partitionfile, winimage.partitionfile) - The path of the configuration file which will be used to partition the disk for the node. For stateful osimages,two types of files are supported: "" which contains a partitioning definition that will be inserted directly into the generated autoinst configuration file and must be formatted for the corresponding OS installer (e.g. kickstart for RedHat, autoyast for SLES, pressed for Ubuntu). "s:" which specifies a shell script that will be run from the OS installer configuration file %pre section; the script must write the correct partitioning definition into the file /tmp/partitionfile on the node which will be included into the configuration file during the install process. For statelite osimages, partitionfile should specify ""; see the xCAT Statelite documentation for the xCAT defined format of this configuration file.For Ubuntu, besides "" or "s:", the disk name(s) to partition must be specified in traditional, non-devfs format, delimited with space, it can be specified in 2 forms: "d:" which contains the disk name(s) to partition and "s:d:" which runs in pressed/early_command and writes the disk names into the "/tmp/install_disk" . To support other specific partition methods such as RAID or LVM in Ubuntu, some additional preseed values should be specified, these values can be specified with "c:" which contains the additional pressed entries in "d-i ..." form and "s:c:" which runs in pressed/early_command and set the preseed values with "debconf-set". The multiple values should be delimited with comma "," + The path of the configuration file which will be used to partition the disk for the node. For stateful osimages,two types of files are supported: "" which contains a partitioning definition that will be inserted directly into the generated autoinst configuration file and must be formatted for the corresponding OS installer (e.g. kickstart for RedHat, autoyast for SLES, pressed for Ubuntu). "s:" which specifies a shell script that will be run from the OS installer configuration file %pre section; the script must write the correct partitioning definition into the file /tmp/partitionfile on the node which will be included into the configuration file during the install process. For statelite osimages, partitionfile should specify ""; see the xCAT Statelite documentation for the xCAT defined format of this configuration file.For Ubuntu, besides "" or "s:", the disk name(s) to partition must be specified in traditional, non-devfs format, delimited with space, it can be specified in 2 forms: "d:" which contains the disk name(s) to partition and "s:d:" which runs in pressed/early_command and writes the disk names into the "/tmp/xcat.install_disk" . To support other specific partition methods such as RAID or LVM in Ubuntu, some additional preseed values should be specified, these values can be specified with "c:" which contains the additional pressed entries in "d-i ..." form and "s:c:" which runs in pressed/early_command and set the preseed values with "debconf-set". The multiple values should be delimited with comma "," or diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index 402d1aa0a..7203a6570 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -783,7 +783,7 @@ use xCAT::ExtTab; permission => 'The mount permission of /.statelite directory is used, its default value is 755', dump => qq{The NFS directory to hold the Linux kernel dump file (vmcore) when the node with this image crashes, its format is "nfs:///". If you want to use the node's "xcatmaster" (its SN or MN), can be left blank. For example, "nfs:///" means the NFS directory to hold the kernel dump file is on the node's SN, or MN if there's no SN.}, crashkernelsize => 'the size that assigned to the kdump kernel. If the kernel size is not set, 256M will be the default value.', - partitionfile => 'The path of the configuration file which will be used to partition the disk for the node. For stateful osimages,two types of files are supported: "" which contains a partitioning definition that will be inserted directly into the generated autoinst configuration file and must be formatted for the corresponding OS installer (e.g. kickstart for RedHat, autoyast for SLES, pressed for Ubuntu). "s:" which specifies a shell script that will be run from the OS installer configuration file %pre section; the script must write the correct partitioning definition into the file /tmp/partitionfile on the node which will be included into the configuration file during the install process. For statelite osimages, partitionfile should specify ""; see the xCAT Statelite documentation for the xCAT defined format of this configuration file.For Ubuntu, besides "" or "s:", the disk name(s) to partition must be specified in traditional, non-devfs format, delimited with space, it can be specified in 2 forms: "d:" which contains the disk name(s) to partition and "s:d:" which runs in pressed/early_command and writes the disk names into the "/tmp/install_disk" . To support other specific partition methods such as RAID or LVM in Ubuntu, some additional preseed values should be specified, these values can be specified with "c:" which contains the additional pressed entries in "d-i ..." form and "s:c:" which runs in pressed/early_command and set the preseed values with "debconf-set". The multiple values should be delimited with comma "," ', + partitionfile => 'The path of the configuration file which will be used to partition the disk for the node. For stateful osimages,two types of files are supported: "" which contains a partitioning definition that will be inserted directly into the generated autoinst configuration file and must be formatted for the corresponding OS installer (e.g. kickstart for RedHat, autoyast for SLES, pressed for Ubuntu). "s:" which specifies a shell script that will be run from the OS installer configuration file %pre section; the script must write the correct partitioning definition into the file /tmp/partitionfile on the node which will be included into the configuration file during the install process. For statelite osimages, partitionfile should specify ""; see the xCAT Statelite documentation for the xCAT defined format of this configuration file.For Ubuntu, besides "" or "s:", the disk name(s) to partition must be specified in traditional, non-devfs format, delimited with space, it can be specified in 2 forms: "d:" which contains the disk name(s) to partition and "s:d:" which runs in pressed/early_command and writes the disk names into the "/tmp/xcat.install_disk" . To support other specific partition methods such as RAID or LVM in Ubuntu, some additional preseed values should be specified, these values can be specified with "c:" which contains the additional pressed entries in "d-i ..." form and "s:c:" which runs in pressed/early_command and set the preseed values with "debconf-set". The multiple values should be delimited with comma "," ', driverupdatesrc => 'The source of the drivers which need to be loaded during the boot. Two types of driver update source are supported: Driver update disk and Driver rpm package. The value for this attribute should be comma separated sources. Each source should be the format tab:full_path_of_srouce_file. The tab keyword can be: dud (for Driver update disk) and rpm (for driver rpm). If missing the tab, the rpm format is the default. e.g. dud:/install/dud/dd.img,rpm:/install/rpm/d.rpm', comments => 'Any user-written notes.', disable => "Set to 'yes' or '1' to comment out this row.", diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index c2ba52cd6..0fe3cb4a3 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -411,7 +411,7 @@ sub subvars { if ($diskfile && $doneincludes) { - #the content of the specified file is the disknames to partition or a script which can write disk names into /tmp/install_disk + # The content of the specified file is the disknames to partition or a script which can write disk names into /tmp/xcat.install_disk # split the disk file out from the $inc ($inc, $diskcontent) = split(/FFFFFFFFFFFFPARTITIONDISKFILESTART\n/, $inc); ($diskcontent,$res) = split(/\nFFFFFFFFFFFFPARTITIONDISKFILEEND/, $diskcontent); @@ -433,9 +433,8 @@ sub subvars { $diskcontent .= "chmod 755 /tmp/diskscript\n"; $diskcontent .= "/tmp/diskscript\n"; }else{ - # Put the code to decode the preseed disk file - #$diskcontent .= "python -c 'import base64; print base64.b64decode(open(\"/tmp/diskscript.enc\",\"rb\").read())' >/tmp/install_disk\n"; - $diskcontent .= "base64decode/tmp/install_disk\n"; + # Put the code to decode the preseed disk file + $diskcontent .= "base64decode /tmp/xcat.install_disk\n"; } #replace the #XCA_PARTMAN_DISK_SCRIPT# @@ -444,10 +443,10 @@ sub subvars { } elsif ("ubuntu" eq $platform) { my $default_script = " wget http://`cat /tmp/xcatserver`".$ENV{INSTALLDIR}."/autoinst/getinstdisk; chmod u+x getinstdisk; ./getinstdisk;"; - $inc =~ s/#INCLUDE_GET_FIRST_DISK_SCRIPT#/$default_script/; + $inc =~ s/#INCLUDE_GET_INSTALL_DISK_SCRIPT#/$default_script/; } else { - $inc =~ s/#INCLUDE_GET_FIRST_DISK_SCRIPT#/ /; + $inc =~ s/#INCLUDE_GET_INSTALL_DISK_SCRIPT#/ /; } diff --git a/xCAT-server/share/xcat/install/scripts/getinstdisk b/xCAT-server/share/xcat/install/scripts/getinstdisk index 720469e98..bc8efa338 100644 --- a/xCAT-server/share/xcat/install/scripts/getinstdisk +++ b/xCAT-server/share/xcat/install/scripts/getinstdisk @@ -13,12 +13,13 @@ # type, select the first one. # 3. Select the default one: /dev/sda. # -# Output: /tmp/install_disk +# Output: /tmp/xcat.install_disk # #----------------------------------------------------------- install_disk="" -rm -f /tmp/install_disk +install_disk_file="/tmp/xcat.install_disk" + tmpdir="/tmp/xcat.getinstalldisk" mkdir -p $tmpdir @@ -205,5 +206,5 @@ if [ -z "$install_disk" ]; then echo "[get_install_disk]The default install_disk is $install_disk." fi -# Output the result to /tmp/install_disk file -echo $install_disk > /tmp/install_disk +# Output the result to $install_disk_file +echo $install_disk > $install_disk_file diff --git a/xCAT-server/share/xcat/install/scripts/pre.pkvm3 b/xCAT-server/share/xcat/install/scripts/pre.pkvm3 index bda6cced5..2e7df51a0 100755 --- a/xCAT-server/share/xcat/install/scripts/pre.pkvm3 +++ b/xCAT-server/share/xcat/install/scripts/pre.pkvm3 @@ -3,16 +3,13 @@ shopt -s nullglob -#The script getinstdisk is common for rh/sles/pkvm/ubuntu, it will write the install_disk into /tmp/install_disk file +# +# 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/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" +if [ -e "/tmp/xcat.install_disk" ]; then + instdisk=`cat /tmp/xcat.install_disk` fi echo "part PV.01 --ondisk=$instdisk" >> /tmp/partitioning diff --git a/xCAT-server/share/xcat/install/scripts/pre.rh b/xCAT-server/share/xcat/install/scripts/pre.rh index 9dd9883f9..79b28a57d 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.rh +++ b/xCAT-server/share/xcat/install/scripts/pre.rh @@ -184,18 +184,15 @@ fi #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 +# +# 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/install_disk" ]; then - instdisk=`cat /tmp/install_disk` +if [ -e "/tmp/xcat.install_disk" ]; then + instdisk=`cat /tmp/xcat.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 diff --git a/xCAT-server/share/xcat/install/scripts/pre.rh.rhels7 b/xCAT-server/share/xcat/install/scripts/pre.rh.rhels7 index 36fb944b9..01bbe8882 100755 --- a/xCAT-server/share/xcat/install/scripts/pre.rh.rhels7 +++ b/xCAT-server/share/xcat/install/scripts/pre.rh.rhels7 @@ -148,16 +148,13 @@ fi #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 +# +# 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/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" +if [ -e "/tmp/xcat.install_disk" ]; then + instdisk=`cat /tmp/xcat.install_disk` fi modprobe ext4 >& /dev/null diff --git a/xCAT-server/share/xcat/install/scripts/pre.sles b/xCAT-server/share/xcat/install/scripts/pre.sles index 600cc5829..f11ad0517 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.sles +++ b/xCAT-server/share/xcat/install/scripts/pre.sles @@ -135,16 +135,13 @@ fi shopt -s nullglob -#The script getinstdisk is common for rh/sles/pkvm/ubuntu, it will write the install_disk into /tmp/install_disk file +# +# 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/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" +if [ -e "/tmp/xcat.install_disk" ]; then + instdisk=`cat /tmp/xcat.install_disk` fi diff --git a/xCAT-server/share/xcat/install/ubuntu/compute.tmpl b/xCAT-server/share/xcat/install/ubuntu/compute.tmpl index cf7739aca..15b9d7056 100644 --- a/xCAT-server/share/xcat/install/ubuntu/compute.tmpl +++ b/xCAT-server/share/xcat/install/ubuntu/compute.tmpl @@ -52,8 +52,8 @@ d-i partman-md/device_remove_md boolean true #create the /tmp/partitionfile based on the uefi or legacy bios d-i partman/early_command string \ { \ -#INCLUDE_GET_FIRST_DISK_SCRIPT# \ - debconf-set partman-auto/disk "$(cat /tmp/install_disk)"; \ +#INCLUDE_GET_INSTALL_DISK_SCRIPT# \ + debconf-set partman-auto/disk "$(cat /tmp/xcat.install_disk)"; \ } >>/tmp/pre-install.log 2>&1 d-i partman-auto/expert_recipe_file string /tmp/partitionfile