2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-30 09:36:41 +00:00

Merge pull request #6216 from gurevichmark/genimage_exec

Verify packaging commands can be executed during genimage processing
This commit is contained in:
yangsong 2019-04-11 10:04:20 +08:00 committed by GitHub
commit 5abb2a20ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -255,6 +255,12 @@ unless ($onlyinitrd) {
my $non_interactive;
if (!$prompt) { $non_interactive = "--non-interactive --no-gpg-checks --gpg-auto-import-keys"; }
my $zypper_cmd = "zypper";
if (! -x $zypper_cmd) {
print "Can not execute $zypper_cmd command. Make sure you are running on SUSE based system";
exit 1;
}
if ($osver_host >= 11) { #zypper in SLES11 is different
system("rm -rf $rootimg_dir/etc/zypp/repos.d/$osver-*.repo");

View File

@ -333,10 +333,14 @@ unless ($onlyinitrd) {
}
}
if (! -x $aptcmd1) {
print "Error: Can not execute $aptcmd1 command. Make sure you are running on a Debian based system.\n";
exit 1;
}
print "Run cmd [$aptcmd1 $aptcmd2] to create rootimage bootstraps\n";
my $rc = system("$aptcmd1 $aptcmd2");
if ($rc) {
print "Error: cannnot create bootstraps for rootimage. Make sure you specified full http mirror path.\n";
print "Error: Can not create bootstraps for rootimage. Make sure you specified full http mirror path.\n";
exit 1;
}