mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-29 09:13:08 +00:00
Modify the getinstdisk to create a temporary file called /tmp/xcat.install_disk
so that it's easier for the admin who is debugging the install to know which files are created by xCAT
This commit is contained in:
parent
c9368c32fb
commit
23e124ac2d
@ -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: "<partition file absolute path>" 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:<partitioning script absolute path>" 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 "<partition file absolute path>"; see the xCAT Statelite documentation for the xCAT defined format of this configuration file.For Ubuntu, besides "<partition file absolute path>" or "s:<partitioning script absolute path>", 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:<the absolute path of the disk name file>" which contains the disk name(s) to partition and "s:d:<the absolute path of the disk script>" 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:<the absolute path of the additional pressed config file>" which contains the additional pressed entries in "d-i ..." form and "s:c:<the absolute path of the additional pressed config script>" 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: "<partition file absolute path>" 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:<partitioning script absolute path>" 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 "<partition file absolute path>"; see the xCAT Statelite documentation for the xCAT defined format of this configuration file.For Ubuntu, besides "<partition file absolute path>" or "s:<partitioning script absolute path>", 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:<the absolute path of the disk name file>" which contains the disk name(s) to partition and "s:d:<the absolute path of the disk script>" 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:<the absolute path of the additional pressed config file>" which contains the additional pressed entries in "d-i ..." form and "s:c:<the absolute path of the additional pressed config script>" which runs in pressed/early_command and set the preseed values with "debconf-set". The multiple values should be delimited with comma ","
|
||||
|
||||
|
||||
|
||||
|
@ -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: "<partition file absolute path>" 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:<partitioning script absolute path>" 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 "<partition file absolute path>"; see the xCAT Statelite documentation for the xCAT defined format of this configuration file.For Ubuntu, besides "<partition file absolute path>" or "s:<partitioning script absolute path>", 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:<the absolute path of the disk name file>" which contains the disk name(s) to partition and "s:d:<the absolute path of the disk script>" 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:<the absolute path of the additional pressed config file>" which contains the additional pressed entries in "d-i ..." form and "s:c:<the absolute path of the additional pressed config script>" 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: "<partition file absolute path>" 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:<partitioning script absolute path>" 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 "<partition file absolute path>"; see the xCAT Statelite documentation for the xCAT defined format of this configuration file.For Ubuntu, besides "<partition file absolute path>" or "s:<partitioning script absolute path>", 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:<the absolute path of the disk name file>" which contains the disk name(s) to partition and "s:d:<the absolute path of the disk script>" 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:<the absolute path of the additional pressed config file>" which contains the additional pressed entries in "d-i ..." form and "s:c:<the absolute path of the additional pressed config script>" which runs in pressed/early_command and set the preseed values with "debconf-set". The multiple values should be delimited with comma ","
|
||||
|
||||
or
|
||||
|
||||
|
@ -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://<nfs_server_ip>/<kdump_path>". If you want to use the node's "xcatmaster" (its SN or MN), <nfs_server_ip> can be left blank. For example, "nfs:///<kdump_path>" 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: "<partition file absolute path>" 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:<partitioning script absolute path>" 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 "<partition file absolute path>"; see the xCAT Statelite documentation for the xCAT defined format of this configuration file.For Ubuntu, besides "<partition file absolute path>" or "s:<partitioning script absolute path>", 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:<the absolute path of the disk name file>" which contains the disk name(s) to partition and "s:d:<the absolute path of the disk script>" 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:<the absolute path of the additional pressed config file>" which contains the additional pressed entries in "d-i ..." form and "s:c:<the absolute path of the additional pressed config script>" 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: "<partition file absolute path>" 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:<partitioning script absolute path>" 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 "<partition file absolute path>"; see the xCAT Statelite documentation for the xCAT defined format of this configuration file.For Ubuntu, besides "<partition file absolute path>" or "s:<partitioning script absolute path>", 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:<the absolute path of the disk name file>" which contains the disk name(s) to partition and "s:d:<the absolute path of the disk script>" 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:<the absolute path of the additional pressed config file>" which contains the additional pressed entries in "d-i ..." form and "s:c:<the absolute path of the additional pressed config script>" 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.",
|
||||
|
@ -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/diskscript.enc >/tmp/install_disk\n";
|
||||
# Put the code to decode the preseed disk file
|
||||
$diskcontent .= "base64decode</tmp/diskscript.enc > /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#/ /;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user