mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-07-31 08:41:18 +00:00
add getinstdisk as the default getdisk script for ubuntu
This commit is contained in:
@@ -110,6 +110,13 @@ sub subvars {
|
||||
}
|
||||
$ENV{PERSKCMDLINE}=getPersistentKcmdline($node);
|
||||
|
||||
my $installroot;
|
||||
$installroot = xCAT::TableUtils->get_site_attribute("installdir");
|
||||
if (!defined($installroot)) {
|
||||
$installroot = "/install";
|
||||
}
|
||||
$ENV{INSTALLDIR} = $installroot;
|
||||
|
||||
|
||||
#replace the env with the right value so that correct include files can be found
|
||||
$inc =~ s/#ENV:([^#]+)#/envvar($1)/eg;
|
||||
@@ -457,6 +464,14 @@ sub subvars {
|
||||
$inc =~ s/#XCA_PARTMAN_DISK_SCRIPT#/$diskcontent/;
|
||||
}
|
||||
}
|
||||
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/;
|
||||
}
|
||||
else {
|
||||
$inc =~ s/#INCLUDE_GET_FIRST_DISK_SCRIPT#/ /;
|
||||
}
|
||||
|
||||
|
||||
if ($configfile && $doneincludes) {
|
||||
#the content of the specified file is the additional pressed config with 'd-i' or
|
||||
|
@@ -470,6 +470,11 @@ sub mkinstall {
|
||||
}
|
||||
|
||||
xCAT::MsgUtils->trace($verbose_on_off,"d","debian->mkinstall: installroot=$installroot");
|
||||
|
||||
# Check whether the default getinstdisk script exist, if so, copy it into /install/autoinst/
|
||||
if ( -r "$::XCATROOT/share/xcat/install/scripts/getinstdisk") {
|
||||
copy("$::XCATROOT/share/xcat/install/scripts/getinstdisk", "$installroot/autoinst");
|
||||
}
|
||||
|
||||
my $node;
|
||||
my $ostab = xCAT::Table->new('nodetype');
|
||||
|
@@ -178,13 +178,6 @@ 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
|
||||
|
@@ -192,13 +192,6 @@ 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
|
||||
|
@@ -51,6 +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 \
|
||||
#INCLUDE_GET_FIRST_DISK_SCRIPT# \
|
||||
debconf-set partman-auto/disk "$(cat /tmp/install_disk)"
|
||||
d-i partman-auto/expert_recipe_file string /tmp/partitionfile
|
||||
|
||||
|
Reference in New Issue
Block a user