Commit Graph

45 Commits

Author SHA1 Message Date
Ryan Harper 2007d6401b add check for empty loopdev to geninstaller
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2016-06-22 13:30:27 -05:00
Ryan Harper 153f41c989 Fix installer to work with latest curtin
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>
2015-12-04 09:01:19 -06:00
Ryan Harper 50d859e866 Reduce size of rootfs layer and common mkfs and rsync options
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>
2015-10-28 09:56:09 -05:00
Ryan Harper f5eb8faef4 Switch to 1M alignment for partition calculations
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>
2015-10-27 15:35:05 -05:00
Ryan Harper 9361bdbd72 Calculate installer image partition sizes
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>
2015-10-27 10:12:28 -05:00
Ryan Harper eaa9926718 Install packages into overlay during build
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>
2015-10-27 10:12:28 -05:00
Ryan Harper bba193efba Install curtin as a deb into installer target
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>
2015-10-27 10:12:28 -05:00
Ryan Harper d048b58811 Fix install when using raid devices
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>
2015-10-27 10:12:28 -05:00
Ryan Harper fa1ed52195 Update geninstaller paths for tarball creation
We're no longer packaging curtin_wrap.sh so we don't need to
tar up the bin dir.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-10-20 16:57:49 -05:00
Ryan Harper 8cb8eddb19 geninstaller: try a bit harder to tar up subiquity installer
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>
2015-09-30 14:19:02 -05:00
Ryan Harper ac3fd86bb5 Remove offline mode for installer
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>
2015-09-30 12:58:11 -05:00
Ryan Harper 6fe10c0a1a Make sure we tar up either in-tree or installed subuiquity source
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>
2015-09-30 12:44:36 -05:00
Ryan Harper 8b228d05a8 Fix geninstaller to be runnable outside of source tree
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>
2015-09-29 09:56:47 -05:00
Ryan Harper 23d644037a Switch to single overlay dir
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>
2015-09-28 09:01:46 -05:00
Ryan Harper 4f344714f9 Use probert package from subiquity-dev ppa
Use the packaged version of probert.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-09-28 09:01:46 -05:00
Ryan Harper 46974cf398 Update comments on overlayfs check
Expand on overlayfs version check.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-09-23 09:49:24 -05:00
Ryan Harper 79f072ec43 geninstaller: Check overlayfs module version instead of Ubuntu release
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>
2015-09-23 09:46:22 -05:00
Ryan Harper 5f424963dc Add efi deps to installer/geninstaller
geninstaller should ensure it has all of the packages it needs to build.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-09-23 09:22:28 -05:00
Ryan Harper d85bb52a63 Finish enabling EFI boot mode
- 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>
2015-09-22 22:19:54 -05:00
Ryan Harper 522a546b5c Modify geninstaller for uefi booting
Switch image to use overlay partition and use uefi layout and boot loader
configuration.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-09-22 13:15:00 -05:00
Ryan Harper acab44c1ec Update dhclient apparmor profile under overlayroot
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>
2015-09-21 16:40:35 -05:00
Ryan Harper a16c301eed Drop python3-parted use
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>
2015-08-27 14:26:37 -05:00
Adam Stokes 1dbb837fd2 Add python3-tornado to geninstaller reqs
Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
2015-08-23 23:52:48 -04:00
Wesley Wiedenmeier f8e67e95bd Updated partitioning template to match new config:
- 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
2015-08-12 12:15:31 -05:00
Wesley Wiedenmeier 64ec2ae157 Merge branch 'master' of github.com:CanonicalLtd/subiquity into offline 2015-07-24 10:27:58 -05:00
Wesley Wiedenmeier c6ae4b1619 Fixed offline mode
- 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
2015-07-24 10:26:35 -05:00
Adam Stokes 0a9ba876bb Merge pull request #22 from CanonicalLtd/trivial-fixes
Some trivial fixes to help with initial development
2015-07-24 09:12:55 -04:00
Ryan Harper 65b9cb396a Add postinstall cleanup
Inject a postinstall config to curtin installer to cleanup cloud image
on target.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-07-23 14:57:42 -05:00
Diogo Matsubara f8e6622fb4 Merge branch 'master' into trivial-fixes 2015-07-23 16:34:47 -03:00
Diogo Matsubara 714a2d6d4f trivial fixes: devel dependencies, use git@github url instead of http to avoid password. 2015-07-23 13:23:00 -03:00
Wesley Wiedenmeier 20a2870d32 Finished offline mode setup
- 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
2015-07-22 15:59:23 -05:00
Wesley Wiedenmeier a93b4bbda5 Merge branch 'master' of github.com:CanonicalLtd/subiquity into offline 2015-07-22 13:30:12 -05:00
Wesley Wiedenmeier 411656ed99 Started adding support for offline installer image
- 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
2015-07-22 13:24:40 -05:00
Ryan Harper c121044808 Use mkdir -p for repeated runs and avoiding warnings.
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-07-21 19:05:33 -05:00
Wesley Wiedenmeier 7b374a1af7 Merge branch 'master' of github.com:CanonicalLtd/subiquity into grub2 2015-07-18 20:51:38 -05:00
Wesley Wiedenmeier 2cfe2ffe71 Added support for more advanced booting with grub2
- installer/geninstaller: when -b grub2 flag is given, installs grub2 using
   grub-install, copies installer/resources/grub/grub.cfg onto target
 - installer/resources/grub/grub.cfg: grub configuration that in addition to
   having a menuentry for the installer, scans all partitions on the system
   other than the one it is running from for linux installations and creates
   menuentries for the other installations as well, to deal with potential
   situations where the user reboots the system after installing but does not
   remove the installation disk
2015-07-08 14:21:42 -05:00
Ryan Harper 2b06bdc1da Call curtin to complete install
- Use updated probert *Info class for accessing object data
- Add --dry-run parameter to prevent invoking curtin when testing
- Add new make target to run ui-view by default with --dry-run
- Use a template to write out curtin config file for installation
- Use virtio disks and multiple nics to test probing.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-07-06 12:34:24 -05:00
Ryan Harper fa80b0cabe Add probert to subiquity
Update subiquity welcome controller to call probert to extract
host information and present it to the user briefly before
invokin the curtin installer.

Add the install_src to git clone probert.  Pack this as a tarball
in the user-data like subiquity.

Update user-data package installs for new probert deps.

Modify boot parameters to handle systemd persistent nic naming;
we may not always have eth0 as a nic.  Subsequently update
user-data to use bootcmd to automatically attempt to bring up
nics during the boot before the installer.

Finally fix commandline parsing/output in geninstaller.
Implement version parameter and better caching of previous
maas ephemeral images.

Fix issue with removing cache after unpacking rootfs which is
now owned by root (add sudo to rm of cache).

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-06-25 21:12:42 -05:00
Ryan Harper d3c0b55dbe Call curtin installer from subiquity
Hacky method, but in welcome controller, use subprocess to
call a script which invokes curtin at a known location with
a specific set of parameters.

Modify the installer configuration and start-up scripts to
ensure Subiquity runs on tty1 and keeps the service running.

Upon hitting 'Confirm' Subiquity will exec curtin_wrap.sh
which calls the *real* curtin.  Cloud-init user-data has been
modified to unpack the curtin archive embedded.

When complete, the target.img file is bootable.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-06-17 15:47:23 -05:00
Ryan Harper 698e76127a syslinux binaries aren't standalone, so copy all .c32 files into extlinux target dir. 2015-06-17 13:09:21 -05:00
Ryan Harper eeadb43f93 add gdisk prereq for sgdisk command 2015-06-17 13:08:27 -05:00
Ryan Harper 4d73e1f27c make sure dldir exists before downloading things. 2015-06-17 13:07:56 -05:00
Ryan Harper 7d536c917a Fix issue 3
Install simplestreams package in the prereqs for building installer image.

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-06-17 08:38:12 -05:00
Ryan Harper fc269dff06 Use subiquity inside the install image
- Tar up the subiquity code and inject that into the user-data
 - Add support for encoding when adding binary files
 - Until we have a way to detect serial presence, run installer on tty1
 - Add power_state hook to shut machine off after subiquity exits
 - git status ignore image file in installer dir

Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-06-16 14:45:05 -05:00
Ryan Harper a2ad7bf8ed Initial import of installer image building
Signed-off-by: Ryan Harper <ryan.harper@canonical.com>
2015-06-15 14:38:51 -05:00