The latest curtin now does package dep checks during installation
which may install and enable things like lvm2 and mdadm. These
packages trigger running daemons which prevent the unmounting of
filesystem when building the installer image. Resolve this by
re-implementing curtin's [un]disable_daemon_in_root functions.
Update runinstaller to use 3 spare disks as virtio to enable
raid testing.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
Attempt to shrink the partition size for the rootfs via mkfs options
Ensure we use the same mkfs and rsync options everywhere.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
Make sure we continue to use 1M alignment, this helps
parted shift things around properly. Don't reserve
space for root in installer image since it's read-only.
Add some fudge factor to the root image to allow for
sparse expansion.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
Wily images and newer now contain a lxcbr0 by default.
Ignore this interface and don't attempt to dhcp autostart it.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
The size of the rootfs fluxuates and sometimes does not fit in the
pre-allocated sizes. Instead, calculate the size needed for the
rootfs read-only partition (+ 100M padding) and use the remaining
space for the overlay partition as it's needed when the install
image updates it's apt repository.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
Speed up install time by pre-installing required curtin packages
in the installer image. Do this by optionally exploiting a
curtin feature which handles preparing the target for installation
of services that we don't want running during the image build.
Fallback on simple apt-get install but filter out daemon services
as this will break the image build.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
Instead of packing up curtin via source, build a
deb from the source and inject that into the installer.
This also means we always are consuming an 'installed'
curtin (aka /usr/bin/curtin).
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
RAID devices require special handling since they cannot be partitioned.
Adjust the blockdev model to accomodate this.
Fix sorting of our actions to handle proper ordering when using RAID devices
Implement whole-disk formatting view and controller
Update cloud-init configuration to ensure repeated runs of installer work
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
Subshell cd to source dir was silently failing. Instead use
tar -C and add an additional check on that we did generate
a subiquity tarball for the installer image.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
Make offline mode default. We always want to
install the packages required to run the installer in the
image we generate.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
We want geninstaller to acquire the subiquity source from either
the in-tree directories, or if running installed from a deb, the
path where it was installed.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
After renaming bin/subiquity to bin/subiquity-tui we broke a
few things that invoked subiquity via bin/subiquity which is
now bin/subiquity-tui
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
geninstaller, which is installed as /usr/bin/subiquity-geninstaller
needed some changes to allow it to run outside of the build tree.
Quieted the output from geninstaller a lot and redirect the verbosity
into the log file.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
Instead of tracking many directories, we'll use only one
overlay directory to hold any scripts or change we want to
see applied over the base image.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
overlayfs changed mount options between different kernel versions.
In some cases, an Ubuntu release may have a different kernel than
what was included during the release, so instead use the version
included in the module itself to determine what parameters to pass
when mounting.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
- Fix up issues with efi mode grub serial configuration
- Modify blockdev model to order storage configuration output
- Handle when we're running in uefi mode
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
Use a flag to set efi mode or not. Switch to IDE controller for
disks as UEFI bios doesn't support virtio block devices.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
Update grub2 configuration for UEFI booting with fallback to bios mode.
Include new detection scheme so we don't list existing partitions of the
installer.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
With updated kernels, overlayroot programs will fail with
a disconnected_path error. Resolve our use of dhclient by
adding the allow_disconnected flag to the profile.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
We can't use curses_display with an external event loop (tornado). The good
news is that we don't have to. Instead we switch to using agetty to bypass
login, specify the installer and options to execture. This also handles
respawning the installer and works both on serial and without.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
Using parted required root privileges since it opened the underlying device.
Instead create our own Disk model and use sysfs interface for extracting
size information.
This also clears the way for providing device data via probert input. This
means we can feed subiquity a probert dump and have it present that to
the installer UI even if we're running on a different system.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
Non-virtio nics get persistent names which require a 2 minute timeout
which slows the installer down. Use net.ifnames=0 in grub config to
handle non virtio nics getting persistent names until a fix arrives.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
- storage config is now a dict, with "version: 1" and "config: <storage
config>"
- switched curtin branch to use to lp:curtin, because custom storage features
are now available there
- added apt-get update before installing packages
- install all packages at once instead of looping over them
- check for error from apt-get install
- don't try to chroot if copying resolv.conf fails
- Removed package list from installer-user-data, and added a placemarker
instead
- geninstaller inserts the package list INSTALLER_DEPS into
installer-user-data if OFFLINE is set to no, if OFFLINE is set to yes,
geninstaller chroots into rootfs and does apt-get install for everything in
INSTALLER_DEPS
- If geninstaller is run with -o or --offline, then during generate_img,
chroot into target and run apt-get install with all required packges for
subiquity.
- At the moment, cloud-init will still attempt to install packages when it
boots without network, then fail over to the next part of the init, and
eventually will run subiquity.
- While this is functional for an offline installer, it is preferrable to
tell cloud-init not to try to install packages, to avoid extra delays
and to keep errors out of the cloud-init log