mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-09-04 20:17:55 +00:00
fix(genesis): protect Power architecture fallback
This commit is contained in:
@@ -62,7 +62,8 @@ sub _genesis_boot_arch {
|
||||
my $arch = $requested_arch eq 'ppc64el' ? 'ppc64le' : $requested_arch;
|
||||
|
||||
if ($arch eq 'ppc64le'
|
||||
&& !-r "$directory/xcat/genesis.kernel.ppc64le") {
|
||||
&& !-r "$directory/xcat/genesis.kernel.ppc64le"
|
||||
&& !-r "$directory/xcat/genesis.exact-arch.ppc64") {
|
||||
return 'ppc64';
|
||||
}
|
||||
return $arch;
|
||||
|
||||
@@ -198,6 +198,8 @@ sub _install_prebuilt_genesis {
|
||||
my @artifacts = (
|
||||
[ 'kernel', "$destination_dir/genesis.kernel.$arch" ],
|
||||
[ 'initramfs.cpio.gz', "$destination_dir/genesis.fs.$arch.gz" ],
|
||||
[ $GENESIS_EXPORT_MANIFEST,
|
||||
"$destination_dir/genesis.exact-arch.$arch" ],
|
||||
);
|
||||
my @staged;
|
||||
|
||||
@@ -282,6 +284,7 @@ sub _remove_openembedded_genesis {
|
||||
"$directory/genesis.kernel.$arch",
|
||||
"$directory/genesis.fs.$arch.gz",
|
||||
"$directory/genesis.fs.$arch.lzma",
|
||||
"$directory/genesis.exact-arch.$arch",
|
||||
);
|
||||
my $removed = 0;
|
||||
foreach my $artifact (@artifacts) {
|
||||
@@ -602,6 +605,13 @@ sub process_request {
|
||||
$callback->({ data => ["Creating filesystem file in $tftpdir/xcat failed"] });
|
||||
return;
|
||||
}
|
||||
my $exact_arch_marker = "$tftpdir/xcat/genesis.exact-arch.$arch";
|
||||
if (($genesis_type eq 'legacy' || $genesis_type eq 'classic')
|
||||
&& (-e $exact_arch_marker || -l $exact_arch_marker)
|
||||
&& !unlink($exact_arch_marker)) {
|
||||
$callback->({ error => ["Unable to remove Genesis architecture marker: $exact_arch_marker"], errorcode => [1] });
|
||||
return;
|
||||
}
|
||||
|
||||
CREAT_CONF_FILE:
|
||||
if ($configfileonly) {
|
||||
|
||||
Reference in New Issue
Block a user