When doing installations without network, we need to ensure that we don't try
to perform apt operations that require internet. To do this in Plucky, we need
to temporarily copy the ubuntu.sources file to an ubuntu.sources.bak file. To
bring all of the previous commits in this upload together, we use the
bind-mounted /media/cdrom not only to install the correct GRUB packages, but
to ensure that we can still install them and any other packages on ship-live.
There has to be a better, more native way to do this. It works for now, but in
the Questing cycle, we're probably going to move some of these command-line
apt calls to be a consumer of the libapt C library (LP: #2107287).
Simply pass through packages starting with "^" or containing "*". For this
cycle we can trust our distributors won't do anything unusual, but next cycle,
we need to perform explicit validation on these items.
If you are a downstream, please be careful!
Instead of utilizing a contextualprocess to only bind-mount /cdrom to
/media/cdrom when it's a specific type of system, simply add it to the mounts
for all flavors, and move the specific copy of the vmlinuz file to a dedicated
shellprocess module. This will be re-factored next cycle, ideally being worked
directly into a dedicated C++ module instead of several, miscellaneous shell
scripts wrapped in YAML.
To complement the last fix, ensure that Calamares ends up on the removal list
for non-stacked squashfses if and only if OEM is disabled, and Calamares shows
up on the install list only for stacked squashfses which have OEM enabled.
This nuanced approach ensures all potential combinations have the intended
functionality.
As a temporary measure until OEM is refactored in the 25.10 cycle, we need to
ensure that Calamares and its necessary dependencies are installed on the
target, iff this is a stacked squashfs *and* it is an OEM install. We're doing
this in pkgselect instead of pkgselectprocess because pkgselect already knows
about stacked squashfses, it's what provides the final "additional install
list" to be considered by checkpackage-backend, and this is a temporary fix
anyway (LP: #2104343).
When we are creating the final list of packages to feed to "apt install,"
virtual packages which do not have a valid candidate are included in this
list, causing the installation to fail. When creating this list, use FindGrp
instead of FindPkg, and only add it to the list if there is a valid candidate.
Additionally, add these items to an unordered set, to eliminate deduplication
(LP: #2106773).
A reliable testcase for this is the libreoffice-help-is package, at least in
Plucky.
As a temporary stop-gap until this can be completely re-written next cycle,
ensure the sed call in the Calamares OEM setup refers to pkgselectprocess,
not packages. This was preventing the OEM processing step (as opposed to just
the GUI configuration) to be missing (LP: #2104343).
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).