mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-09-21 16:39:30 +00:00
fix(xcat-core): the Ubuntu POWER diskful install never leaves the installer
reg_linux_diskfull_installation_flat fails on ubuntu-22-ppc64le-devel and ubuntu-24-ppc64le-devel in build #121 of xcat-core-devel-ubuntu-cd. The Subiquity installer starts, errors in its early-commands, tars /var/log/installer to port 8080 and reboots, nine times in 75 minutes. No system is ever installed, so the address answers from the live installer and the case ends on "root@xcat25-cn: Permission denied (publickey,password)". mkinstall in xCAT-server/lib/xcat/plugins/debian.pm selected pre.ubuntu.subiquity and then replaced it with pre.ubuntu.ppc64 for every ppc64 node, whichever installer was in use. pre.ubuntu.ppc64 writes a partman recipe, and the early-commands append it to /autoinstall.yaml, which Subiquity cannot parse. pre.ubuntu.subiquity offered a UEFI branch and a BIOS branch, so a ppc64el node took the BIOS branch and was given a bios_grub partition. POWER firmware loads the boot loader from a PReP partition. install_prescript now returns the script from the installer and the architecture together, and the ppc64 script is reached only on the debian-installer path. pre.ubuntu.subiquity gains a PReP branch, taken when uname reports a POWER machine, which flags an 8M first partition prep and makes that partition the grub device. debian_install_prescript.t and the PReP case of ubuntu_subiquity_storage.t fail without these changes. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
This commit is contained in:
@@ -383,6 +383,32 @@ sub _no_grub2_loader {
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 install_prescript
|
||||
|
||||
Descriptions: Return the pre-install script an Ubuntu or Debian install runs.
|
||||
Arguments:
|
||||
$platform - the distribution family, for example ubuntu
|
||||
$arch - the architecture of the node
|
||||
$subiquity - true when the osimage template is a Subiquity autoinstall
|
||||
Returns: the full path of the pre-install script
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub install_prescript
|
||||
{
|
||||
my ($platform, $arch, $subiquity) = @_;
|
||||
my $base = "$::XCATROOT/share/xcat/install/scripts/pre.$platform";
|
||||
|
||||
# pre.ubuntu.ppc64 writes a partman recipe, which only the debian-installer
|
||||
# reads. Subiquity gets its POWER partitioning from pre.ubuntu.subiquity.
|
||||
return "$base.subiquity" if ($subiquity);
|
||||
return "$base.ppc64" if (defined($arch) and $arch =~ /ppc64/i and $platform eq "ubuntu");
|
||||
return $base;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 install_media_is_bootable
|
||||
|
||||
Descriptions: Report whether copied media carries an install kernel and initrd.
|
||||
@@ -1155,18 +1181,10 @@ sub mkinstall {
|
||||
);
|
||||
}
|
||||
|
||||
# maybe Debian will decide to use subiquity at some point?
|
||||
my $prescript = "$::XCATROOT/share/xcat/install/scripts/pre.$platform";
|
||||
if (using_subiquity($os,$tmplfile)) {
|
||||
$prescript = $prescript . ".subiquity";
|
||||
}
|
||||
my $prescript =
|
||||
install_prescript($platform, $arch, using_subiquity($os, $tmplfile));
|
||||
my $postscript = "$::XCATROOT/share/xcat/install/scripts/post.$platform";
|
||||
|
||||
# for powerkvm VM ubuntu LE#
|
||||
if ($arch =~ /ppc64/i and $platform eq "ubuntu") {
|
||||
$prescript = "$::XCATROOT/share/xcat/install/scripts/pre.$platform.ppc64";
|
||||
}
|
||||
|
||||
|
||||
if (-r "$prescript") {
|
||||
$preerr = xCAT::Template->subvars($prescript,
|
||||
|
||||
@@ -278,6 +278,60 @@ storage:
|
||||
path: /
|
||||
device: root-part-fs
|
||||
EOF
|
||||
elif [ "$(uname -m)" = "ppc64le" ] || [ "$(uname -m)" = "ppc64" ]; then
|
||||
# POWER firmware reads neither an ESP nor a bios_grub partition. It loads the
|
||||
# boot loader from a PReP partition, and curtin writes grub to the partition
|
||||
# flagged prep, not to the disk.
|
||||
cat <<EOF >/tmp/partitionfile
|
||||
storage:
|
||||
version: 1
|
||||
config:
|
||||
- id: disk-detected
|
||||
type: disk
|
||||
ptable: gpt
|
||||
path: $INSTALL_DISK
|
||||
wipe: superblock-recursive
|
||||
preserve: false
|
||||
- id: prep-part
|
||||
type: partition
|
||||
device: disk-detected
|
||||
size: 8M
|
||||
flag: prep
|
||||
number: 1
|
||||
preserve: false
|
||||
grub_device: true
|
||||
- id: swap-part
|
||||
type: partition
|
||||
device: disk-detected
|
||||
size: 2G
|
||||
number: 2
|
||||
preserve: false
|
||||
- id: root-part
|
||||
type: partition
|
||||
device: disk-detected
|
||||
size: -1
|
||||
wipe: superblock
|
||||
number: 3
|
||||
preserve: false
|
||||
- id: swap-part-fs
|
||||
type: format
|
||||
fstype: swap
|
||||
volume: swap-part
|
||||
preserve: false
|
||||
- id: root-part-fs
|
||||
type: format
|
||||
fstype: ext4
|
||||
volume: root-part
|
||||
preserve: false
|
||||
- id: swap-part-mount
|
||||
type: mount
|
||||
path: none
|
||||
device: swap-part-fs
|
||||
- id: root-part-mount
|
||||
type: mount
|
||||
path: /
|
||||
device: root-part-fs
|
||||
EOF
|
||||
else
|
||||
cat <<EOF >/tmp/partitionfile
|
||||
storage:
|
||||
|
||||
Reference in New Issue
Block a user