]> git.proxmox.com Git - pve-installer.git/log
pve-installer.git
12 months agotui: refactor `NetworkOptions` to have a `defaults_from()` function
Christoph Heiss [Wed, 25 Oct 2023 08:56:22 +0000 (10:56 +0200)]
tui: refactor `NetworkOptions` to have a `defaults_from()` function

This aligns it with the other constructors for options struct by
introducing a `::defaults_from()` function.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
13 months agotui: add some tests for `NetworkInfo` -> `NetworkOptions` conversion
Christoph Heiss [Fri, 20 Oct 2023 09:46:48 +0000 (11:46 +0200)]
tui: add some tests for `NetworkInfo` -> `NetworkOptions` conversion

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
 [ TL: merge fix for missing state member when declaring a Interface
   struct in a test on master ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
13 months agotui: use hostname from run env if available
Christoph Heiss [Fri, 20 Oct 2023 09:46:47 +0000 (11:46 +0200)]
tui: use hostname from run env if available

This now tries to use the hostname from the DHCP lease if it was set,
falling back to the product name as before.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
13 months agoproxinstall: use hostname from run env if available
Christoph Heiss [Fri, 20 Oct 2023 09:46:46 +0000 (11:46 +0200)]
proxinstall: use hostname from run env if available

This now tries to use the hostname from the DHCP lease if it was set,
falling back to the product name as before.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
13 months agorun env: retrieve and store hostname from DHCP lease if available
Christoph Heiss [Fri, 20 Oct 2023 09:46:45 +0000 (11:46 +0200)]
run env: retrieve and store hostname from DHCP lease if available

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
13 months agonet: move hostname/fqdn regexes into common code
Christoph Heiss [Fri, 20 Oct 2023 09:46:44 +0000 (11:46 +0200)]
net: move hostname/fqdn regexes into common code

Such that they can be re-used by other parts.
No functional changes.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
13 months agobuildsys: redirect stderr of TUI in check targets
Thomas Lamprecht [Thu, 19 Oct 2023 12:19:51 +0000 (14:19 +0200)]
buildsys: redirect stderr of TUI in check targets

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
13 months agotui: fix interface sorting
Thomas Lamprecht [Thu, 19 Oct 2023 12:19:06 +0000 (14:19 +0200)]
tui: fix interface sorting

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
13 months agotui: show interface UP state as filled circle
Thomas Lamprecht [Thu, 19 Oct 2023 11:37:04 +0000 (13:37 +0200)]
tui: show interface UP state as filled circle

like we do in the GTK UI since recently, there we also color the
filled circle green, but with current cursive crate version this
doesn't seem to be easy, at least not without breaking its theming a
bit (e.g., by just using ANSI escape codes), so just use the circle
for now.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
13 months agoadd interface state to run-time environment
Thomas Lamprecht [Thu, 19 Oct 2023 11:34:35 +0000 (13:34 +0200)]
add interface state to run-time environment

making this slowly compatible with our battle-proven ifaces entry..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
13 months agofix #4869: Show state in management interface ComboBox
Maximiliano Sandoval [Thu, 19 Oct 2023 08:35:31 +0000 (10:35 +0200)]
fix #4869: Show state in management interface ComboBox

This is a continuation of
https://lists.proxmox.com/pipermail/pve-devel/2023-August/058639.html.

Signed-off-by: Maximiliano Sandoval R <m.sandoval@proxmox.com>
Tested-by: Filip Schauer <f.schauer@proxmox.com>
14 months agosys: block: fix inverted check when detecting block size
Christoph Heiss [Thu, 21 Sep 2023 11:22:56 +0000 (13:22 +0200)]
sys: block: fix inverted check when detecting block size

We do actually want the block size if it is integer - currently, it is
always set to `undef` (and then `null` in the serialized JSON).

Fixes: 15b2cd7 ("sys: block: fix possible use of `undef`-value when detecting disk sizes")
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
14 months agotui: honor test mode flag when starting low-level install session
Christoph Heiss [Wed, 20 Sep 2023 11:39:35 +0000 (13:39 +0200)]
tui: honor test mode flag when starting low-level install session

Even if the installer is run in release mode, the test-mode flag should
be honored on whether to start a test-installation or not.

The test mode is always forced on in debug builds, so the cfg()
conditionals can be dropped.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
15 months agotui: fix search domain parsing from runtime environment info
Christoph Heiss [Mon, 21 Aug 2023 08:53:59 +0000 (10:53 +0200)]
tui: fix search domain parsing from runtime environment info

Commit 55dc67c ("tui: fix FQDN validation") mostly fixed FQDN
validation, but missed a case when the search domain only has one
component.

As Fqdn::from() requires at least two components to pass validation, the
search domain parsing from the runtime environment info provided by the
low-level installer failed. This resulted in that the network dialog
defaulted to "<product>.example.invalid" as FQDN, instead of
"<product>.<searchdomain>" as it should.

Fixes: 55dc67c ("tui: fix FQDN validation")
Reported-by: Aaron Lauterer <a.lauterer@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
15 months agotui: disallow legacy BIOS boot from 4Kn disks for all filesystems
Christoph Heiss [Thu, 10 Aug 2023 10:31:57 +0000 (12:31 +0200)]
tui: disallow legacy BIOS boot from 4Kn disks for all filesystems

The GUI installer already has the same rules in place, not allowing to
boot from 4Kn disks when booting in legacy BIOS mode. The TUI installer
currently only checks that for ZFS RAIDs, so extend that check to all
filesystem configurations.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
15 months agoraid setup: btrfs: do not allow legacy BIOS boot on 4Kn disks
Christoph Heiss [Thu, 10 Aug 2023 10:31:56 +0000 (12:31 +0200)]
raid setup: btrfs: do not allow legacy BIOS boot on 4Kn disks

This is already checked for LVM and ZFS setups, but not for Btrfs. Add
it there too, as it doesn't work anyway.

Tested by creating a block device with 4K sectorsize using
the following QEMU args:
  -device virtio-blk,drive=testdrive4k,logical_block_size=4096,physical_block_size=4096
  -drive file=/path/to/4k-testdisk.img,if=none,id=testdrive4k

The 4k-testdisk.img was created with:
  qemu-img create -f qcow2 /path/to/4k-testdisk.img 16G

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
15 months agotui: setup: handle missing disk block size gracefully
Christoph Heiss [Wed, 9 Aug 2023 13:44:25 +0000 (15:44 +0200)]
tui: setup: handle missing disk block size gracefully

As that value can indeed be undefined, handle that (edge-)case
gracefully. There is only one place where it is checked, in the ZFS RAID
setup dialog. Aligns it with how the low-level installer handles that
case too.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
15 months agosys: block: fix possible use of `undef`-value when detecting disk sizes
Christoph Heiss [Wed, 9 Aug 2023 13:44:24 +0000 (15:44 +0200)]
sys: block: fix possible use of `undef`-value when detecting disk sizes

`$size` and `$logical_bsize` might get unset if there invalid, but then
are unconditionally converted to an int - which throws an error.
This was reported on the forum by a user [0].

Fix it by changing the check a bit to skip the disk immediately if
detecting either of those two values are invalid or simply not present.
The fix for `$logical_bsize` simply avoids trying to convert to value to
an int if invalid.

tl;dr: Should have no impact at all, in the end. The same
`run-env-info.json` is generated w/ and w/o the patch if all disks are
fine. I then also hacked up the script a bit to actually have an invalid
size, this resulted in the "affected" disk simply missing from the disk
array - the expected behavior in this case.

[0] https://forum.proxmox.com/threads/error-installing-proxmox-8.131921/

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
15 months agotui: setup: fix disk size for 4Kn block devices
Christoph Heiss [Wed, 9 Aug 2023 13:44:23 +0000 (15:44 +0200)]
tui: setup: fix disk size for 4Kn block devices

This can be tested by creating a block device with 4K sectorsize using
the following QEMU args:
  -device virtio-blk,drive=testdrive4k,logical_block_size=4096,physical_block_size=4096
  -drive file=/path/to/4k-testdisk.img,if=none,id=testdrive4k

The 4k-testdisk.img was created with:
  qemu-img create -f qcow2 /path/to/4k-testdisk.img 16G

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
15 months agotui: network: select matching NIC for IP configuration
Christoph Heiss [Wed, 9 Aug 2023 13:44:22 +0000 (15:44 +0200)]
tui: network: select matching NIC for IP configuration

Instead of always just selecting an essentially random NIC (depending on
the enumeration), use the correct one for the rest of the
(DHCP-obtained) IP configuration.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
15 months agotui: password: include minimum password length in error message
Christoph Heiss [Wed, 9 Aug 2023 13:44:21 +0000 (15:44 +0200)]
tui: password: include minimum password length in error message

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
15 months agotui: drop some leftover, commented-out code
Christoph Heiss [Wed, 9 Aug 2023 13:44:20 +0000 (15:44 +0200)]
tui: drop some leftover, commented-out code

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
16 months agod/rules: enable dh_auto_test
Christoph Heiss [Mon, 24 Jul 2023 10:14:50 +0000 (12:14 +0200)]
d/rules: enable dh_auto_test

Since we now have a test suite (or, at least the TUI installer in this
case), we can enable dh_auto_test so that it will be run on package
builds.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
16 months agotui: add tests for RAID setup checks
Christoph Heiss [Mon, 24 Jul 2023 10:14:49 +0000 (12:14 +0200)]
tui: add tests for RAID setup checks

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
16 months agotui: add RAID setup checks for ZFS/Btrfs
Christoph Heiss [Mon, 24 Jul 2023 10:14:48 +0000 (12:14 +0200)]
tui: add RAID setup checks for ZFS/Btrfs

This adds early checks when setting up ZFS and Btrfs RAIDs, such as
minimum number of disks in the RAID, mirror sizes and legacy BIOS
compatibility.

The same rules as the GUI uses are applied, which unfortunaly means that
this logic is essentially duplicated between the GUI and TUI.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
16 months agotui: improve bootdisk dialog error handling
Christoph Heiss [Mon, 24 Jul 2023 10:14:47 +0000 (12:14 +0200)]
tui: improve bootdisk dialog error handling

Now we don't just fail silently, but instead give the user/developer
some indication what went wrong.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
16 months agotui: deserialize boot type and disk blocksize from runtime env info
Christoph Heiss [Mon, 24 Jul 2023 10:14:46 +0000 (12:14 +0200)]
tui: deserialize boot type and disk blocksize from runtime env info

This is needed later on to check whether a RAID setup is compatible with
BIOS and 4Kn disks, in particular ZFS.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
16 months agotui: simplify duplicate disk checking logic
Christoph Heiss [Mon, 24 Jul 2023 10:14:45 +0000 (12:14 +0200)]
tui: simplify duplicate disk checking logic

This reduces the logic from O(n^2) to O(n), which is always a good
thing.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
16 months agotui: fix small typo in error message
Christoph Heiss [Thu, 13 Jul 2023 09:49:26 +0000 (11:49 +0200)]
tui: fix small typo in error message

Fixes: 994c4ff ("tui: add better error handling to BootdiskOptions::get_values()")
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
16 months agogitignore: add cd-info.test
Christoph Heiss [Thu, 13 Jul 2023 09:49:25 +0000 (11:49 +0200)]
gitignore: add cd-info.test

It's a testfile and should thus be ignored.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
16 months agotui: fix FQDN validation
Christoph Heiss [Wed, 19 Jul 2023 16:31:30 +0000 (18:31 +0200)]
tui: fix FQDN validation

Add checks to ensure that:
 * It is actually has a hostname, not just a domain name
 * Properly check if the hostname is purely numeric, which was
   broken/different to how the GUI installer does it

The custom error type also allows for easier future adaptions, as the
changes can be entirely contained to the `Fqdn` type.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
16 months agotui: use EULA path from ISO info instead of hard-coding
Christoph Heiss [Fri, 14 Jul 2023 09:29:47 +0000 (11:29 +0200)]
tui: use EULA path from ISO info instead of hard-coding

.. in the same fashion as the GUI installer.
See also proxinstall:create_intro_view() for reference.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
16 months agodisk partitioning: fix checking answer for to-small-disk prompt
Philipp Hufnagl [Thu, 13 Jul 2023 09:38:53 +0000 (11:38 +0200)]
disk partitioning: fix checking answer for to-small-disk prompt

Currently there is a bug that you only can install < 8 GB when you NOT
accept the warning. This is wrong. A user should have to accept the
warning to install on small systems

Signed-off-by: Philipp Hufnagl <p.hufnagl@proxmox.com>
 [T: reword commit subject & fix typo there ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 months agotui: add "Deselect all" button to zfs/btrfs raid disk select
Christoph Heiss [Mon, 10 Jul 2023 13:26:26 +0000 (15:26 +0200)]
tui: add "Deselect all" button to zfs/btrfs raid disk select

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>
16 months agotui: fix clippy warnings
Christoph Heiss [Mon, 10 Jul 2023 13:26:25 +0000 (15:26 +0200)]
tui: fix clippy warnings

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
16 months agotui: don't abort install if min ram requirement is not met
Noel Ullreich [Mon, 10 Jul 2023 09:22:27 +0000 (11:22 +0200)]
tui: don't abort install if min ram requirement is not met

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>
16 months agotui: fix incorrect scrolling of form view contents
Christoph Heiss [Thu, 6 Jul 2023 12:27:50 +0000 (14:27 +0200)]
tui: fix incorrect scrolling of form view contents

See the inline comment for what & why.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
16 months agod/control: drop unused librust-proxmox-sys-dev build dependency
Christoph Heiss [Tue, 4 Jul 2023 08:27:23 +0000 (10:27 +0200)]
d/control: drop unused librust-proxmox-sys-dev build dependency

Since the TUI installer does not use it anymore, we can drop it from
here as well.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
16 months agotui: check hvm support through runtime env info instead of open-coding
Christoph Heiss [Mon, 3 Jul 2023 07:35:00 +0000 (09:35 +0200)]
tui: check hvm support through runtime env info instead of open-coding

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>
16 months agoproxinstall: check hvm support through runtime env info
Christoph Heiss [Mon, 3 Jul 2023 07:34:59 +0000 (09:34 +0200)]
proxinstall: check hvm support through runtime env info

As that info is now available through the runtime environment info, use
it and avoid duplicating logic.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
16 months agorun env: add hardware-accelerated virtualization support flag
Christoph Heiss [Mon, 3 Jul 2023 07:34:58 +0000 (09:34 +0200)]
run env: add hardware-accelerated virtualization support flag

Can later be used by the installer frontends, as well as nicely alinging
with the 'single source of truth' "policy".

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
16 months agobump version to 8.0.14
Thomas Lamprecht [Wed, 28 Jun 2023 16:39:44 +0000 (18:39 +0200)]
bump version to 8.0.14

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 months agoinstallation: disable clamav-clamonacc.service by default for PMG
Thomas Lamprecht [Wed, 28 Jun 2023 16:34:16 +0000 (18:34 +0200)]
installation: disable clamav-clamonacc.service by default for PMG

> On-Access [...] leverages a kernel api called fanotify to block
> processes from attempting to access malicious files. This
> prevention occurs in kernel-space, and thus offers stronger
> protection than a purely user-space solution.

This is not really useful for the PMG use case and requires user
configuration as otherwise it refuses to start. In fact, is the sole
unit marked as failed after a fresh installation:

> ERROR: Clamonacc: at least one of OnAccessExcludeUID,
> OnAccessExcludeUname, or OnAccessExcludeRootUID must be specified
> it is recommended you exclude the clamd instance UID or uname to
> prevent infinite event scanning loops.

So disable it by default, if a user really wants this, whyever that
would be, the can just configure it and enable it again via
systemctl.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 months agobump version to 8.0.13
Thomas Lamprecht [Tue, 27 Jun 2023 14:20:02 +0000 (16:20 +0200)]
bump version to 8.0.13

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 months agobump version to 8.0.12
Thomas Lamprecht [Tue, 27 Jun 2023 13:00:18 +0000 (15:00 +0200)]
bump version to 8.0.12

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 months agotui: persist disk selection for zfs and btrfs
Stefan Sterz [Tue, 27 Jun 2023 14:15:07 +0000 (16:15 +0200)]
tui: persist disk selection for zfs and btrfs

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>
16 months agotui: block & notify if same disk gets selected twice
Thomas Lamprecht [Tue, 27 Jun 2023 12:58:51 +0000 (14:58 +0200)]
tui: block & notify if same disk gets selected twice

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 months agotui: only show warning for missing hyper-visor CPU flags for PVE
Thomas Lamprecht [Tue, 27 Jun 2023 09:16:41 +0000 (11:16 +0200)]
tui: only show warning for missing hyper-visor CPU flags for PVE

that feature isn't useful for neither Proxmox Mail Gateway nor
Proxmox Backup Server

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 months agobump version to 8.0.11
Thomas Lamprecht [Mon, 26 Jun 2023 19:40:01 +0000 (21:40 +0200)]
bump version to 8.0.11

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 months agotui: hide max-vz and max-root inputs if product isn't PVE
Thomas Lamprecht [Mon, 26 Jun 2023 19:37:54 +0000 (21:37 +0200)]
tui: hide max-vz and max-root inputs if product isn't PVE

like we do in the GTK based installer

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 months agobuildsys: copy over .cargo config directory to build-dir
Thomas Lamprecht [Mon, 26 Jun 2023 17:23:26 +0000 (19:23 +0200)]
buildsys: copy over .cargo config directory to build-dir

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 months agobump version to 8.0.10
Thomas Lamprecht [Mon, 26 Jun 2023 17:10:06 +0000 (19:10 +0200)]
bump version to 8.0.10

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 months agotui: boot disks: filter out Btrfs if setup info disallows it
Thomas Lamprecht [Mon, 26 Jun 2023 17:08:01 +0000 (19:08 +0200)]
tui: boot disks: filter out Btrfs if setup info disallows it

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 months agobuildsys: add check-pbs-tui target
Thomas Lamprecht [Mon, 26 Jun 2023 17:06:58 +0000 (19:06 +0200)]
buildsys: add check-pbs-tui target

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 months agobuildsys: add check-pmg-tui target
Thomas Lamprecht [Mon, 26 Jun 2023 17:05:50 +0000 (19:05 +0200)]
buildsys: add check-pmg-tui target

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
16 months agotui: rustfmt
Wolfgang Bumiller [Mon, 26 Jun 2023 13:59:43 +0000 (15:59 +0200)]
tui: rustfmt

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
16 months agotui: use product for default hostname
Wolfgang Bumiller [Mon, 26 Jun 2023 13:59:39 +0000 (15:59 +0200)]
tui: use product for default hostname

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
16 months agotui: make ProxmoxProduct Copy
Wolfgang Bumiller [Mon, 26 Jun 2023 13:56:13 +0000 (15:56 +0200)]
tui: make ProxmoxProduct Copy

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
16 months agotui: add global 'setup_info'
Wolfgang Bumiller [Mon, 26 Jun 2023 13:52:28 +0000 (15:52 +0200)]
tui: add global 'setup_info'

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>
17 months agobump version to 8.0.9
Thomas Lamprecht [Thu, 22 Jun 2023 14:48:22 +0000 (16:48 +0200)]
bump version to 8.0.9

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agodisk selection: save both, order and disk id
Thomas Lamprecht [Thu, 22 Jun 2023 14:46:33 +0000 (16:46 +0200)]
disk selection: save both, order and disk id

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agofix space calculation for small disks for pve product
Stoiko Ivanov [Thu, 22 Jun 2023 13:57:13 +0000 (15:57 +0200)]
fix space calculation for small disks for pve product

The convoluted calculation logic in case the disks is 8GB leads to
datasize becoming 16EiB further down:
* after calculating and removing the rootsize from $rest, $rest becomes
  smaller than $space (which should be the minimal non-used space in the
  volume-group) - this leads to a negative value, which overflows in
  the `& ~0xFFF` opration.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
17 months agoalways align rootdisk size to 4 MiB
Fiona Ebner [Thu, 22 Jun 2023 14:18:34 +0000 (16:18 +0200)]
always align rootdisk size to 4 MiB

While this was already done in the $rest < 48 GiB cases, it wasn't yet
done for the else branch and also not if $maxroot_mb was assigned,
because of being smaller.

Second and last step towards fixing an issue reported in the community
forum [0] where using 250.00 hdsize, 250 maxroot and 0 minfree would
fail.

Turns out two extents would be missing because of lvcreate implicitly
rounding up, one of them for the root LV (the one for metadata was
already handled in the previous commit).

[0]: https://forum.proxmox.com/threads/129320/post-566375

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
17 months agoalign metadatasize to 4 MiB
Fiona Ebner [Thu, 22 Jun 2023 14:18:33 +0000 (16:18 +0200)]
align metadatasize to 4 MiB

First step towards fixing an issue reported in the community forum [0]
where using 250.00 hdsize, 250 maxroot and 0 minfree would fail.

Turns out two extents would be missing because of lvcreate implicitly
rounding up, one of them for the metadata.

[0]: https://forum.proxmox.com/threads/129320/post-566375

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
17 months agogtk: raid disk selector: separate UI state from config state
Thomas Lamprecht [Thu, 22 Jun 2023 14:22:10 +0000 (16:22 +0200)]
gtk: raid disk selector: separate UI state from config state

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agosys block: fix id for test disks
Thomas Lamprecht [Thu, 22 Jun 2023 14:20:41 +0000 (16:20 +0200)]
sys block: fix id for test disks

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agotui: do not auto reboot on failures
Maximiliano Sandoval [Thu, 22 Jun 2023 13:08:40 +0000 (15:08 +0200)]
tui: do not auto reboot on failures

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>
17 months agotui: add some info to uknown UI messages
Thomas Lamprecht [Thu, 22 Jun 2023 13:18:40 +0000 (15:18 +0200)]
tui: add some info to uknown UI messages

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agotui: disable automatic text wrapping for form labels
Christoph Heiss [Thu, 22 Jun 2023 09:56:17 +0000 (11:56 +0200)]
tui: disable automatic text wrapping for form labels

This just causes weird layouts; such that labels and inputs do not line
up anymore.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
17 months agotui: wrap multi-disk selection in scrollable view
Christoph Heiss [Thu, 22 Jun 2023 09:56:16 +0000 (11:56 +0200)]
tui: wrap multi-disk selection in scrollable view

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>
17 months agotui: switch to `f64` for disk sizes
Stefan Sterz [Thu, 22 Jun 2023 09:20:38 +0000 (11:20 +0200)]
tui: switch to `f64` for disk sizes

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>
17 months agobump version to 8.0.8
Thomas Lamprecht [Thu, 22 Jun 2023 08:48:18 +0000 (10:48 +0200)]
bump version to 8.0.8

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agoRevert "critic: lazily read directories via <> glob"
Thomas Lamprecht [Thu, 22 Jun 2023 08:45:59 +0000 (10:45 +0200)]
Revert "critic: lazily read directories via <> glob"

Perl definitively acts very different with the while variant, it
seems it keeps the file handle open and reuses it in future calls,
even if the directory base of the glob is different

This reverts commit 90fb3d7615a76803b9ff0376827782903a2d3342.

17 months agobump version to 8.0.7
Thomas Lamprecht [Thu, 22 Jun 2023 05:39:23 +0000 (07:39 +0200)]
bump version to 8.0.7

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agocritic: drop useless return undefined
Thomas Lamprecht [Thu, 22 Jun 2023 05:38:05 +0000 (07:38 +0200)]
critic: drop useless return undefined

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agocritic: lazily read directories via <> glob
Thomas Lamprecht [Thu, 22 Jun 2023 05:37:22 +0000 (07:37 +0200)]
critic: lazily read directories via <> glob

the for/foreach ones read everything in to build a list and then
iterate that, the while one is lazy and needs less memory.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agocritic: avoid $a, $b special package variables
Thomas Lamprecht [Thu, 22 Jun 2023 05:35:37 +0000 (07:35 +0200)]
critic: avoid $a, $b special package variables

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agofix checking the now boolean prompt response
Thomas Lamprecht [Thu, 22 Jun 2023 05:16:12 +0000 (07:16 +0200)]
fix checking the now boolean prompt response

When the prompt abstraction got added in bc05a8f ("add basic UI
plugin infrastructure") it also inlined the check for the answer, as
that can be differently structured for each user interface, and
returns bool. But when switching over to this new infra, two sites
weren't updated to the simpler bool check and still checked with the
previous "equals 'ok'", which now was always false.

Fixes: 72bea99 ("switch prompt, error and message calls to new UI infra")
Reported-by: Alexander Zeidler <a.zeidler@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agobump version to 8.0.6
Thomas Lamprecht [Wed, 21 Jun 2023 16:42:34 +0000 (18:42 +0200)]
bump version to 8.0.6

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agotui: avoid actively focusing start-install button on summary
Thomas Lamprecht [Wed, 21 Jun 2023 16:39:28 +0000 (18:39 +0200)]
tui: avoid actively focusing start-install button on summary

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>
17 months agotui: focus next button by default
Dominik Csapak [Wed, 21 Jun 2023 14:48:13 +0000 (16:48 +0200)]
tui: focus next button by default

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>
17 months agotui: improve ipv6 handling
Stefan Hanreich [Wed, 21 Jun 2023 14:16:49 +0000 (16:16 +0200)]
tui: improve ipv6 handling

* fix detection of ipv6 addresses
* change input for CIDR to allow integers up until 128

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
17 months agoadd some more logging, especially at start up
Thomas Lamprecht [Wed, 21 Jun 2023 14:56:35 +0000 (16:56 +0200)]
add some more logging, especially at start up

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agolog: record when and that the log got initialized
Thomas Lamprecht [Wed, 21 Jun 2023 14:39:33 +0000 (16:39 +0200)]
log: record when and that the log got initialized

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agobuildsys: dump environment in all test cases
Thomas Lamprecht [Wed, 21 Jun 2023 14:34:17 +0000 (16:34 +0200)]
buildsys: dump environment in all test cases

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agorun env: re-used cached version to speed up GUI installer start
Thomas Lamprecht [Wed, 21 Jun 2023 14:33:10 +0000 (16:33 +0200)]
run env: re-used cached version to speed up GUI installer start

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agomove location of runtome env file into ISO env
Thomas Lamprecht [Wed, 21 Jun 2023 14:25:38 +0000 (16:25 +0200)]
move location of runtome env file into ISO env

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agofix duplicate deserialize_invalid_value_as_none
Thomas Lamprecht [Wed, 21 Jun 2023 13:16:22 +0000 (15:16 +0200)]
fix duplicate deserialize_invalid_value_as_none

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agotui: verify email with basic regex
Dominik Csapak [Wed, 21 Jun 2023 12:30:32 +0000 (14:30 +0200)]
tui: verify email with basic regex

regex copied from perl gui installer

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
 [T: add missing librust-regex-1+default-dev B-D ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agotui: always use mail@example.invalid as default email address
Dominik Csapak [Wed, 21 Jun 2023 12:30:31 +0000 (14:30 +0200)]
tui: always use mail@example.invalid as default email address

like the gui installer

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
17 months agotui: forward stray messages from low-level installer to stderr
Christoph Heiss [Wed, 21 Jun 2023 11:31:09 +0000 (13:31 +0200)]
tui: forward stray messages from low-level installer to stderr

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>
17 months agotui: implement auto-reboot after installation
Christoph Heiss [Wed, 21 Jun 2023 11:17:15 +0000 (13:17 +0200)]
tui: implement auto-reboot after installation

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
17 months agotui: do not fail completely on invalid domain names
Christoph Heiss [Wed, 21 Jun 2023 09:40:44 +0000 (11:40 +0200)]
tui: do not fail completely on invalid domain names

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>
17 months agotui: fix ability to type commas
Wolfgang Bumiller [Wed, 21 Jun 2023 12:57:29 +0000 (14:57 +0200)]
tui: fix ability to type commas

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
17 months agotui: clamp max LVM disk size to size of selected disk
Christoph Heiss [Wed, 21 Jun 2023 12:21:44 +0000 (14:21 +0200)]
tui: clamp max LVM disk size to size of selected disk

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
17 months agotui: remove underline-effect from advanced disk setup titles
Christoph Heiss [Wed, 21 Jun 2023 12:04:09 +0000 (14:04 +0200)]
tui: remove underline-effect from advanced disk setup titles

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>
17 months agobump version to 8.0.5
Thomas Lamprecht [Wed, 21 Jun 2023 11:46:36 +0000 (13:46 +0200)]
bump version to 8.0.5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
17 months agotui: implement auto-reboot after installation
Christoph Heiss [Wed, 21 Jun 2023 11:15:12 +0000 (13:15 +0200)]
tui: implement auto-reboot after installation

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
17 months agotui: rename `reboot` option to `autoreboot`, to better align with GUI
Christoph Heiss [Wed, 21 Jun 2023 11:13:14 +0000 (13:13 +0200)]
tui: rename `reboot` option to `autoreboot`, to better align with GUI

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
17 months agolow level: simulate reboot in test session
Christoph Heiss [Wed, 21 Jun 2023 11:12:37 +0000 (13:12 +0200)]
low level: simulate reboot in test session

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>