mirror of
https://git.launchpad.net/~ubuntu-qt-code/+git/calamares-settings-ubuntu
synced 2025-04-23 17:11:34 +00:00
[pkgselectprocess] Fix usage of checkpackage-backend
If checkpackage-backend does not exist in the target system, likely due to the use of stacked squashfses, ensure it temporarily exists so it can be used in the install process. This fixes installation of the Virtual Machine Manager when selected on the Customize menu (LP: #2104243).
This commit is contained in:
parent
0c540f933a
commit
68b993050c
@ -6,6 +6,7 @@
|
||||
#include <QDir>
|
||||
#include <QCoreApplication>
|
||||
#include <QRegularExpression>
|
||||
#include <QFile>
|
||||
|
||||
CALAMARES_PLUGIN_FACTORY_DEFINITION(PackageSelectProcessFactory, registerPlugin<PackageSelectProcess>();)
|
||||
|
||||
@ -359,15 +360,31 @@ Calamares::JobResult PackageSelectProcess::exec()
|
||||
qDebug() << "Progress range: installStart:" << installStart << "installEnd:" << installEnd;
|
||||
|
||||
if (!debPackages.isEmpty()) {
|
||||
const QString packageList = debPackages.join(" ");
|
||||
const QString installCommand = QString("DEBIAN_FRONTEND=noninteractive apt-get -y install $(/usr/libexec/checkpackage-backend %1);").arg(packageList);
|
||||
const QString checkpackage_path = "/usr/libexec/checkpackage-backend";
|
||||
const QString chroot_checkpackage_path = rootMountPoint + checkpackage_path;
|
||||
|
||||
Calamares::JobResult installResult = runAptCommand(installCommand,
|
||||
rootMountPoint,
|
||||
installStart,
|
||||
installEnd,
|
||||
true);
|
||||
if (!installResult) return std::move(installResult);
|
||||
// checkpackage-backend needs to be explicitly copied to the chroot
|
||||
// and removed later for systems with stacked squashfses, or the
|
||||
// install command will fail. LP: #2104243
|
||||
QFile* cpbe = new QFile(chroot_checkpackage_path);
|
||||
if (!cpbe->exists()) {
|
||||
QFile* parent_cpbe = new QFile(checkpackage_path);
|
||||
if (!parent_cpbe->copy(chroot_checkpackage_path)) {
|
||||
return Calamares::JobResult::error(tr("Internal Error"),
|
||||
tr("Permission denied when copying checkpackage-backend, are you running Calamares correctly?"));
|
||||
}
|
||||
|
||||
const QString packageList = debPackages.join(" ");
|
||||
const QString installCommand = QString("DEBIAN_FRONTEND=noninteractive apt-get -y install $(/usr/libexec/checkpackage-backend %1);").arg(packageList);
|
||||
|
||||
Calamares::JobResult installResult = runAptCommand(installCommand,
|
||||
rootMountPoint,
|
||||
installStart,
|
||||
installEnd,
|
||||
true);
|
||||
if (!cpbe->remove()) qDebug() << "Warning: failed to clean up /usr/libexec/checkpackage-backend";
|
||||
if (!installResult) return std::move(installResult);
|
||||
}
|
||||
}
|
||||
else qDebug() << "No packages to install.";
|
||||
|
||||
|
5
debian/changelog
vendored
5
debian/changelog
vendored
@ -1,6 +1,11 @@
|
||||
calamares-settings-ubuntu (1:25.04.24) UNRELEASED; urgency=medium
|
||||
|
||||
* Bump Standards-Version to 4.7.2, no changes needed.
|
||||
* [pkgselectprocess] If checkpackage-backend does not exist in the target
|
||||
system, likely due to the use of stacked squashfses, ensure it temporarily
|
||||
exists so it can be used in the install process. This fixes installation
|
||||
of the Virtual Machine Manager when selected on the Customize menu
|
||||
(LP: #2104243).
|
||||
|
||||
-- Simon Quigley <tsimonq2@ubuntu.com> Wed, 09 Apr 2025 01:55:07 -0500
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user