Another puzzle piece in the quest to align the TUI installer more to
its GUI counterpart.
Like the GUI installer, it will only be shown if >3 disks are
detected on the system.
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
If the minimum requirements are not met, the TUI installer will create a
popup notifying you that the install might not work and then exits the
installer.
While the GUI also creates such a popup, it will not exit the installer.
This patch adapts the behavior of the GUI: the TUI creates a popup
warning you that min spec is not met but doesn't abort the install.
Signed-off-by: Noel Ullreich <n.ullreich@proxmox.com>
Reviewed-by: Christoph Heiss <c.heiss@proxmox.com>
Tested-by: Christoph Heiss <c.heiss@proxmox.com>
[T: fix conflict in context and drop intermediate variable ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
As the runtime environment now exports that info, use it. In turn, this
allows us to drop the dependency on `proxmox-sys`, as that check was its
only user.
The dependency graph drops from 107 to 88 crates from this, which
definitively is a nice change.
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
previously the disk selection was reset if the advanced options
dialogue was re-opened. this commit adapts the behavior to restore
the previous selection.
Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This is basically "installer information" and will is used
for things such as default values for which we do not want
to pass around all the data.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Otherwise the user only has 5 seconds to see the error message before
the machine reboots.
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
If lots of disks are present and the available screen size is rather
small, it might be impossible for users to properly set all disks as
they want.
Fix it by making the view scrollable.
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
previously the tui used `u64` internally to represent the disk size.
since the perl-based installer expects GiB as floats and that is also
what is displayed in the tui that meant a lot of converting back and
forth. it also lead to an error where the disk sizes that were set
seemed to not have been persisted, even though the sizes were
correctly set. this commit refactors the installer to convert the size
once in the beginning and then stick to `f64`.
Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
Reviewed-by: Christoph Heiss <c.heiss@proxmox.com>
Tested-by: Christoph Heiss <c.heiss@proxmox.com>
it's just safer to make the user look at the summary and avoid that a
stray enter hits of the installation.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
except the password dialog, since the user must provide input
to do that, we have to set the focus index on all relevant views
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
After eaa7d41 - which directs all stderr from the TUI to tty2 - this can
be safely done without interrupting the TUI.
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Since we already handly non-present domain names, invalid names can be
handled the same way, as not to completely fail the installation.
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
While this might look at it should it terminal emulators, in a raw tty
this can have different effects; e.g. being a bright blue/green and
nearly unreadable. For now, just remove the effect completely, the
semantics are still very much clear.
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Since we already handly non-present domain names, invalid names can be
handled the same way, as not to completely fail the installation.
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Otherwise, the user would be blocked from continuing the the installer,
instead just being presented with an error.
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Similar to our actual battle proven get_ip_config, but as the TUI
uses this one, and switching to it rather more risk, make just
addresses optional, add skip for "lo" loopback and don't skip ifaces
that aren't UP in the current helper.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
with this you can type without removing the decimal places, but if
you type inside the decimal places it'll just move the cursor to the
end and do nothing
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
If, for some reason, the network is not properly configured (due to
e.g. no DHCP server being present on the network), there will be no
routes in the runtime environment as well. So do not depend on that,
otherwise the installer fails at the start.
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Since the cargo lockfile was removed from the repo in 74e3a21, this
became useless.
Fixes: 74e3a21 ("tui: remove cargo lockfile")
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Since the TUI was put into a top-level workspace, the `target` folder
and lockfile exist too on that level.
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Using the product is actually fine, but we should derive it from the
ISO env, not hard-coding "pve", but for now ok enough.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Currently the installer depends on the index to derive the selected
disks, so use that instead of a wishing-how-it-could-be approach.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
The proxinstall takes a GB float here and multiplies it up to KB for
most parts, which is then passed to various tools, passing bytes here
makes this go bonkers and try to create a 4 EiB swap partition.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
If, one would need to write the full product name, and as that is
already written in the "inner" dialogue header, lets just drop it
from the outer.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This was accidentally removed with below commit.
Fixes: 4532cff ("run env: replace lsblk with hd_list but fix it up a bit")
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Instead of lsblk we use the original `hd_list` to be closer
to what we originally had.
However, from the PVE codebase I copied over the use of the
`E: DEVNAME` property to find the `/dev` node like (since
some weird devices can have '!' in /sys with '/' in /dev),
drop the check for `/sys/block/$d/dev`, and provide both the
`/dev` and `/sys/block` path in the output array.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
The JSON deserializer always expects to return an owned string.
Fixes: 7762d12 ("tui: directly parse domain name from runtime env info")
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
This was broken when adding the usage caveats at the top of the advanced
dialog; the wrong child views were selected.
Fixes: 7f27373 ("tui: add notices for zfs/btrfs bootdisk and their caveats")
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Otherwise, clippy (correctly) complains that you should always implement
both if you implement one.
Fixes: 86dac56 ("tui: use whole keyboard mapping in select view as value")
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Thus all its values can easily be used later on. Involves making
`KeyboardMapping` partial-orderable, just use the human-readable name
here (as that's what displayed to the user).
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Until now, if the user navigated back and then forward again, the screen
would be constructed & added again to the stack. This would result in
missing values and broken "Previous" button behaviour.
Fix it by tracking their screen ids and simply switch to them as needed.
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
This also reworks the whole installer state. The main type is now
`InstallerData`, which holds info about the machine (such as info about
the disks), as well as all the user options.
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>