We generally expect /var/lib/snapd/modeenv to exist, but in case it does not,
fall back to picking up the mode from kernel command line (just like snapd does
it).
Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
The changes in 66e8222a09 and
f3043cde88 introduced established
/run/console-conf as the project runtime directory. Make sure that the wrapper
uses the same location.
Credits to @kubiko for introducing the changes in his core24 nucleus branch.
Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
Modify wrapper to consider consol-conf installed as snap.
Prepare sshd finger prints to be used by consol-conf snap.
Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
During TUI launch, turn systemd ShowStatus off. We don't want to do that
earlier, if we did then the easier path would be quiet boot or something
similar. This is done here so that service completion messages don't
overwrite the console.
This uses a kind of crazy approach where the hook script we get curtin
to run makes an API call to the server process to do the actual
configuration. I can't work out if this is genius or insane or both but
anyway it is only a step on to the way to doing the apt configuration
before we start curtin so it won't be around for long.
* adjust environment to set PYTHONPATH to pick up site-packages
* add more required packages
* add script for subiquity-server, and set PYTHONPATH there,
so that the PYTHONPATH takes effect
* Abstract resource file lookup relative to SNAP
Using SNAP to find the resource files is a bit of an odd requirement for
non-subiquity clients. Start abstracting that away so it's easier to
change later.
Also move loadkeys to lookup from this, since the previous solution is
still a problem for ubuntu-desktop-installer.
* Move loadkeys / configure-apt to bin
loadkeys / configure-apt are in usr/bin only when we specially put them
there by way of snapcraft, which makes things a little harder on
non-subiquity clients. Move them to bin, which is to say don't have
snapcraft put them in usr/bin.
The pool is loaded off the same media as the installer and the
filesystem being installed so there's no real loss of security doing
this and it makes it easier for people to master custom ISOs with extra
packages in the pool and systems with inaccurate clocks (that cannot
reach ntp.ubuntu.com).
Otherwise on a system without support for `snap routine console-conf-start`, console-conf will never actually run.
Thanks to @xnox for the suggestion.
Co-authored-by: Dimitri John Ledkov <19779+xnox@users.noreply.github.com>
After the user has pressed enter to being using console-conf, we should invoke
the snapd routine for console-conf, which currently does the following:
* Unconditionally delays refreshes for 20 minutes from when first invoked.
* Blocks waiting for all pending refreshes to complete, including if those
involve a reboot.
This is the first step towards a more integrated user story where console-conf
is a part of the first-boot process, and at least will minimize user confusion
where console-conf proceeds asking about network configuration and then just
hangs when snapd starts a refresh as soon as network is available.
The snap routine console-conf-start command was merged to snapd with
https://github.com/snapcore/snapd/pull/9418 and will be first available in snapd
2.48.
Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
Display the snapd journal while the system installs. This will
give us important clues what might go wrong during a install
and also gives the user some sense of progress.
For post-beta we need to think if we really want to display this
level of detail. OTOH we don't expect people to watch the console
during firstboot yet and if that will happen we need to also tweak
a bunch more (like kernel messages, systemd messages etc).
Once console-conf is started for recovery chooser, exit early when the recovery
chooser does not exist.
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
For now, we want to just block console-conf from doing anything in install mode,
i.e. allowing a user to login etc. but eventually we will probably want to show
more useful status information from snapd during the install mode process.
Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
Look for the marker file left by snapd recovery chooser user request detection
and attempt to run the chooser.
Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
This does a few things with the end goal of making simplifying and
making consistent tox and 'make' methods of test or check.
Things here:
* move python programs out of bin and into their own main. Use
entry_points to get scripts written for them. One gain here is
that we no longer have python programs that are not named .py.
flake8 and friends would not check those programs by default.
* install scripts in bin/ using the setup.py scripts and adjust
snapcraft.yaml and debian packaging for that.
* declare and use PYTHON in Makefile to avoid repeating 'python3'
* declare and use CHECK_DIRS in Makefile for list of dirs to check.
* no longer run 'flake8' from 'make check' by default.
* remove the old tests/ directory.