2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-12 08:10:12 +00:00

replace the determine install disk precess with script share/xcat/install/scripts/getinstdisk, it will write the install disk to /tmp/install_disk

This commit is contained in:
ertaozh
2015-12-11 03:55:29 -05:00
parent e64a5017c6
commit fdca2cc3f9
11 changed files with 43 additions and 178 deletions

View File

@ -467,13 +467,13 @@ If not specified, the default value will be used.
nodeset <nodename> osimage=<osimage>
- the 'd:' preceding the filename tells nodeset that this is a partition disk file.
- For Ubuntu, when nodeset runs and generates the /install/autoinst file for a node, it will generate a script to write the content of the partition disk file to /tmp/boot_disk, this context to run the script will replace the #XCA_PARTMAN_DISK_SCRIPT# directive in /install/autoinst/<node>.pre.
- For Ubuntu, when nodeset runs and generates the /install/autoinst file for a node, it will generate a script to write the content of the partition disk file to /tmp/install_disk, this context to run the script will replace the #XCA_PARTMAN_DISK_SCRIPT# directive in /install/autoinst/<node>.pre.
.. END_Partition_Disk_File_ubuntu_only
.. BEGIN_Partition_Disk_Script_ubuntu_only
The disk script contains a script to generate a partitioning disk file named "/tmp/boot_disk". for example: ::
The disk script contains a script to generate a partitioning disk file named "/tmp/install_disk". for example: ::
rm /tmp/devs-with-boot 2>/dev/null || true;
for d in $(list-devices partition); do
@ -486,12 +486,12 @@ The disk script contains a script to generate a partitioning disk file named "/t
fi
done;
if [[ -e /tmp/devs-with-boot ]]; then
head -n1 /tmp/devs-with-boot | egrep -o '\S+[^0-9]' > /tmp/boot_disk;
head -n1 /tmp/devs-with-boot | egrep -o '\S+[^0-9]' > /tmp/install_disk;
rm /tmp/devs-with-boot 2>/dev/null || true;
else
DEV=`ls /dev/disk/by-path/* -l | egrep -o '/dev.*[s|h|v]d[^0-9]$' | sort -t : -k 1 -k 2 -k 3 -k 4 -k 5 -k 6 -k 7 -k 8 -g | head -n1 | egrep -o '[s|h|v]d.*$'`;
if [[ "$DEV" == "" ]]; then DEV="sda"; fi;
echo "/dev/$DEV" > /tmp/boot_disk;
echo "/dev/$DEV" > /tmp/install_disk;
fi;
If not specified, the default value will be used.

View File

@ -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/boot_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/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 ","

View File

@ -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/boot_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/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

View File

@ -779,7 +779,7 @@ linuximage => {
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/boot_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/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.",

View File

@ -426,7 +426,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/boot_disk
#the content of the specified file is the disknames to partition or a script which can write disk names into /tmp/install_disk
# split the disk file out from the $inc
($inc, $diskcontent) = split(/FFFFFFFFFFFFPARTITIONDISKFILESTART\n/, $inc);
($diskcontent,$res) = split(/\nFFFFFFFFFFFFPARTITIONDISKFILEEND/, $diskcontent);
@ -449,8 +449,8 @@ sub subvars {
$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/boot_disk\n";
$diskcontent .= "base64decode</tmp/diskscript.enc >/tmp/boot_disk\n";
#$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";
}
#replace the #XCA_PARTMAN_DISK_SCRIPT#

View File

@ -3,55 +3,18 @@
shopt -s nullglob
#first take the disk with the MAX WWN numer to be the installdisk
if [ -z "$instdisk" ]; then
disks=$(awk -F' ' '{print $4 }' /proc/partitions |grep -e "sd[a-z]\+$")
for disk in $disks; do
diskinfo=$(udevadm info --name $disk)
diskname=$(IFS= ;echo $diskinfo|grep '\<DEVNAME\>'|cut -d "=" -f2|tr A-Z a-z)
devtype=$(IFS= ;echo $diskinfo|grep '\<DEVTYPE\>'|cut -d "=" -f2|tr A-Z a-z)
devwwn=$(IFS= ;echo $diskinfo|grep '\<ID_WWN\>'|cut -d "=" -f2|tr A-Z a-z)
[ "$devtype" != "disk" ] && continue
diskentry=$diskentry"$diskname $devwwn\n"
done
instdisk=$(echo -e $diskentry|grep -v "^$"|sort -k 2 -b -r|cut -d" " -f1|head -n 1)
#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
#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...
if [ -z "$instdisk" ]; then
for disk in /dev/sd*[^0-9]; do
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"|"mpt3sas") #*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
# Could not determine the install disk for whatever reason,
# try the default /dev/sda
if [ -z "$instdisk" ]; then
instdisk="/dev/sda"
fi
echo "part PV.01 --ondisk=$instdisk" >> /tmp/partitioning
echo "volgroup ibmpkvm_rootvg PV.01" >> /tmp/partitioning

View File

@ -142,46 +142,13 @@ fi
#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"|"mpt3sas") #*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
#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
if [ -z "$instdisk" ]; then
if [ ! -z "$firstdirectdisk" ]; then
instdisk=$firstdirectdisk
elif [ ! -z "$probablyfirstdirectdisk" ]; then
instdisk=$probablyfirstdirectdisk
elif [ ! -z "$firstdisk" ]; then
instdisk=$firstdisk
fi
fi
# Could not determine the install disk for whatever reason,
# try the default /dev/sda
if [ -z "$instdisk" ]; then

View File

@ -125,45 +125,20 @@ fi
/tmp/foo.awk >/tmp/foo.log 2>&1 &
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"|"mpt3sas") #*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
#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
if [ ! -z "$firstdirectdisk" ]; then
instdisk=$firstdirectdisk
elif [ ! -z "$probablyfirstdirectdisk" ]; then
instdisk=$probablyfirstdirectdisk
elif [ ! -z "$firstdisk" ]; then
instdisk=$firstdisk
fi
instdisk="/dev/sda"
fi
if [ -d /sys/firmware/efi ]; then
sed -e 's!<device>XCATPARTITIONHOOK</device>!<device>'$instdisk'</device><partitions config:type="list"><partition><filesystem config:type="symbol">vfat</filesystem><mount>/boot/efi</mount><size>128mb</size></partition><partition><mount>swap</mount><size>auto</size></partition><partition><mount>/</mount><size>auto</size></partition></partitions>!' /tmp/profile/autoinst.xml > /tmp/profile/modified.xml
else

View File

@ -178,6 +178,13 @@ base64decode()
done
}
#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
echo "/dev/sda" > /tmp/install_disk
fi
if [ -d /sys/firmware/efi ]; then
echo "ubuntu-efi ::" > /tmp/partitionfile
echo " 512 512 1024 fat16" >> /tmp/partitionfile

View File

@ -192,6 +192,13 @@ base64decode()
done
}
#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
echo "/dev/sda" > /tmp/install_disk
fi
if [ -d /sys/firmware/efi ]; then
echo "ubuntu-efi ::" > /tmp/partitionfile
echo " 512 512 1024 fat16" >> /tmp/partitionfile

View File

@ -51,61 +51,7 @@ 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 \
set -x; \
if [ -f /tmp/boot_disk ]; then \
debconf-set partman-auto/disk "$(cat /tmp/boot_disk)"; \
exit; \
fi; \
rm /tmp/devs-with-boot 2>/dev/null || true; \
for d in $(list-devices partition); do \
mkdir -p /tmp/mymount; \
rc=0; \
mount $d /tmp/mymount || rc=$?; \
if [[ $rc -eq 0 ]]; then \
[[ -d /tmp/mymount/boot ]] && echo $d >>/tmp/devs-with-boot; \
for i in /tmp/mymount/vmlinuz* ; do \
if [ -e $i ]; then \
echo $d >>/tmp/devs-with-boot; break; \
fi; \
done; \
umount /tmp/mymount; \
fi; \
done; \
if [[ -e /tmp/devs-with-boot ]]; then \
head -n1 /tmp/devs-with-boot | egrep -o '\S+[^0-9]' > /tmp/boot_disk; \
rm /tmp/devs-with-boot 2>/dev/null || true; \
else \
if [[ -e /tmp/disk_info ]]; then \
rm -f /tmp/disk_info; \
fi; \
for disk in $(list-devices disk); do \
diskbootable=''; \
currdriver=`udevadm info -a -n $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") \
diskbootable=$disk; \
;; \
"mptsas"|"mpt2sas"|"mpt3sas") \
diskbootable=$disk; \
;; \
*) \
diskbootable=''; \
;; \
esac; \
if [ ! -z "$diskbootable" ]; then \
devpath=`udevadm info $diskbootable | grep DEVPATH`; \
echo $devpath ." $diskbootable" >> /tmp/disk_info; \
fi; \
done; \
if [[ -e /tmp/disk_info ]]; then \
DEV=`cat /tmp/disk_info | sort -t : -k 1 -k 2 -k 3 -k 4 -k 5 -k 6 -k 7 -k 8 -g | head -n1 | egrep -o '/dev/[s|h|v]d.*$'`; \
fi; \
if [[ "$DEV" == "" ]]; then \
DEV="/dev/sda"; \
fi; \
echo "$DEV" > /tmp/boot_disk; \
fi; \
debconf-set partman-auto/disk "$(cat /tmp/boot_disk)"
debconf-set partman-auto/disk "$(cat /tmp/install_disk)"
d-i partman-auto/expert_recipe_file string /tmp/partitionfile
# This makes partman automatically partition without confirmation, provided