Commit Graph

1052 Commits

Author SHA1 Message Date
Thomas Lamprecht
bf0c8b1751 gtk: rework helper for creating labeled widget grid
A array of arrays makes using this now, and possibly extending it in
the future, quite a bit simpler.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-17 07:01:05 +01:00
Thomas Lamprecht
5130de4d7d get fqdn: code/naming style cleanups
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-17 06:34:33 +01:00
Stoiko Ivanov
a805423305 run env: do not store emtpy hostname
without this patch the hostname ends up as the empty string in
run-env-info.json, which results in a parse-error in the TUI code
(an empty string is not None, but still too short as hostname)

Minimally tested on a VM.

Fixes: bda1cdf ("run env: retrieve and store hostname from DHCP lease
 if available")
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2023-11-17 06:25:43 +01:00
Thomas Lamprecht
a837970613 bump version to 8.1.2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-16 19:21:13 +01:00
Stoiko Ivanov
e212e418a0 zfs: create /var/lib/vz only for PVE
the recent patch to create /var/lib/vz as dedicated dataset, did so
for all our products - but this is only needed/wanted for PVE

moved the creation of the root-dataset above the creation of
rpool/data, so that the pve-specifics can remain in one if block.

Fixes: dd19d40cea
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2023-11-16 19:20:20 +01:00
Thomas Lamprecht
0d97286cbf x: disable screen saver via blank time
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-16 17:54:37 +01:00
Thomas Lamprecht
f7acac0554 bump version to 8.1.1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-16 16:31:49 +01:00
Stoiko Ivanov
c4465c0890 zfs: set acltype=posix for root-dataset
journald as a core component tries setting a ACL on the journal files
for (non-root) users and fails on our ZFS installs.
Resulting in dmesg being spammed with messages from journald upon each
journal-rotation for each user upon their first login.

This is also suggested by OpenZFS in their Debian guide for root on
ZFS:
https://openzfs.github.io/openzfs-docs/Getting%20Started/Debian/Debian%20Bookworm%20Root%20on%20ZFS.html

Tested by setting this on a machine of mine, where this has been
bugging for quite a while.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2023-11-16 16:29:20 +01:00
Stoiko Ivanov
dd19d40cea fix #1410: zfs: create /var/lib/vz as separate dataset
this enables the users to set reservations on / separate from
/var/lib/vz - where backups, ISOs, and other data might fill the
complete pool.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2023-11-16 16:29:20 +01:00
Stoiko Ivanov
e2cbcc4ec6 unconfigured.sh: set serial to a number to prevent warning
caught me off-guard while debugging other things - the message:
` [: : integer expression expected`
made me look a bit too long at the wrong place.

Fixes: a31259b159
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2023-11-16 16:29:20 +01:00
Stoiko Ivanov
a02a78a865 fix #4747: pass kernel cmdline parameters to target system
Parameters needed for booting during installation are best preserved
in the target cmdline as well - e.g. if you need a particular
cmdline switch for your system to boot at all - not having to add it
for the first boot of the installed system and manually adding it to
the bootloader config is an improvement.

This additionally enables us to drop the console parameter handling
for serial consoles (it is just one of the parameters to pass along).

Finally it fixes the regular expressions for the installer settings we
read from the cmdline (swapsize, maxroot,...) which were broken if
added as last entry.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2023-11-16 16:29:20 +01:00
Stoiko Ivanov
c1279c8250 serial install: fix console parameter parsing
The regex matching in Proxmox::Install::Config was blindly copied from
above - so the other parameters are also likely to not get recognized
if they are the last on the cmdline

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2023-11-14 18:34:11 +01:00
Stoiko Ivanov
7377c99a00 d/control: add libgtk3-perl to B-D
With the first tests entering the installer in
9a0d66cb36

we now need libgtk3-perl during package-building with `make deb`

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2023-11-14 18:34:11 +01:00
Stoiko Ivanov
a31259b159 unconfigured.sh: set terminal size for serial install
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2023-11-12 19:28:54 +01:00
Stoiko Ivanov
4c1473ce32 pass optional console parameter from installer to target
If an installation needs to provide a dedicated console parameter
(e.g. because it runs on the serial console) the target system most
likely will need the parameter too.

This patch adds the parameter to the kernel-commandline (in case zfs
is used for both grub and systemd)

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2023-11-12 19:28:54 +01:00
Thomas Lamprecht
36a14a6197 bump version to 8.1.0
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-11 14:32:42 +01:00
Christoph Heiss
091c64a753 low-level, tui: count down auto-reboot timeout
The GUI installer already has the same functionality, with this the TUI
installer gains the same. It is a nice touch anyway, primarily to
indicate to the user that the installer is not frozen or similar.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-11 14:08:41 +01:00
Christoph Heiss
04b0033cd9 low-level: avoid open-coding config reading, parsing and merging
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-11 14:08:41 +01:00
Christoph Heiss
c0517345f6 tui: install_progress: handle errors in ui message loop more gracefully
This at least gives _some_ feedback to the user he can potentially
report or try to address, instead of a single, hardcoded message.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-11 14:08:41 +01:00
Christoph Heiss
4c808a1ba6 tui: install_progress: split out prompt logic into own function
No functional changes.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-11 14:08:41 +01:00
Christoph Heiss
7d09f0ab0d tui: install_progress: split out reboot handling into own function
No functional changes.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-11 14:08:41 +01:00
Christoph Heiss
923be7633c tui: install_progress: split out low-level installer spawing into own function
No functional changes.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-11 14:08:41 +01:00
Christoph Heiss
c59da6c816 tui: install_progress: move progress task into own function
No functional changes.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-11 14:08:41 +01:00
Christoph Heiss
dba905bfa5 tui: move install progress dialog into own view module
While at it, convert it to a proper `View`-impl, instead of a functional
component.

No functional changes.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-11 14:08:41 +01:00
Christoph Heiss
eda9fa0c6c fix #4856: tui: bootdisk: use correct defaults in advanced dialog
The size of the install disk was set to the size of the first disk,
regardless of what disk was selected. This only happened if the advanced
options dialog was never opened, and only a disk was selected in the
main bootdisk dialog.

Properly solving this involved restructuring the LVM advanced bootdisk
dialog, to also hold the selected disks, like the ZFS and Btrfs dialogs.
In addition to that, the `BootdiskOptionsRef` needs quite some passing
around, to cover all the cases, since the dialog also needs to be
"reentrant-safe".

I tested (among other things):
  * Only select disk, don't open the advanced dialog, go to summary,
    then back to the bootdisk dialog -> selected disk should be kept
  * Select disk, open advanced dialog but leave everything as is, go to
    summary, then go back again -> selected disk should be kept
  * Same as previous, but change the "Total size" for the disk, go to
    summary and back -> selected disk and size should be kept
  * Same as previous, but additionally change filesystem to XFS -> disk,
    filesystem and size should be kept
  * Same as previous, but then create a ZFS RAID, go to summary & back,
    ZFS RAID should be kept with all parameters
  * etc ..

Further I also verified that the correct disk size(s) get written into
the setup structure for the low-level installer.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-09 14:47:03 +01:00
Christoph Heiss
d81cffcbb4 tui: bootdisk: refactor Rc<RefCell<..>> type into custom type
Will be used/passed around quite a lot of times due to future changes,
so simplify it a bit.

No functional changes.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-09 14:47:03 +01:00
Christoph Heiss
4b4dfa12e0 low level: testmode: take path to disk image instead of using /dev/null
.. in exactly the same way GUI and TUI installer do, streamlining them.

Up until now, testing the TUI installer often involved hand-editing the
`run-env-info.json` to put some proper disk sizes > 0 in place. This
makes this process a lot easier.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-09 14:44:51 +01:00
Christoph Heiss
521dfff583 tui: bootdisk: expose arc_max ZFS option for PVE installations
To set the maximum value for arc_max accordingly, simply pass down
`RuntimeInfo` directly instead of the disks array to the views.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-07 16:40:15 +01:00
Christoph Heiss
13490d13b6 common: add ZFS arc_max installer setup option
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-07 16:40:15 +01:00
Christoph Heiss
9a0d66cb36 test: add tests for zfs_arc_max calculations
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-07 16:40:15 +01:00
Christoph Heiss
4c25372e50 proxinstall: expose arc_max ZFS option for PVE installations
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-07 16:40:15 +01:00
Christoph Heiss
e8103d4288 install: use correct variable names in zfs_setup_module_conf()
That's what happens when you do some last-minute variable renaming and
trust that nothing broke ..

Fixes: 42aa2fa ("fix #4829: install: add new ZFS `arc_max` setup option")
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-07 16:40:15 +01:00
Christoph Heiss
c8f6256dab run env: remove debug print
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-07 16:40:15 +01:00
Christoph Heiss
0f39ba9300 tui: fix same "Administrator" typo in password and summary view
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-07 16:39:35 +01:00
Stoiko Ivanov
f5ccbd946b install: install correct grub metapackage for the current boot-mode
grub packages in debian split between:

* meta-packages, which handles (among other things) the reinstalling
  grub to the actual device/ESP in case of a version upgrade (grub-pc,
  grub-efi-amd64)

* bin-packages, which contain the actual boot-loaders

The bin-packages can coexist on a system, but the meta-package
conflict with each other (didn't check why, but I don't see a hard
conflict on a quick glance)

Currently our ISO installs grub-pc unconditionally (and both bin
packages, since we install the legacy bootloader also on uefi-booted
systems). This results in uefi-systems not getting a new grub
installed automatically upon upgrade.

Reported in our community-forum from users who upgraded to PVE 8.0,
and still run into an issue fixed in grub for bookworm:
https://forum.proxmox.com/threads/.123512/

Reproduced and analyzed by Friedrich.

This patch changes the installer, to install the meta-package fitting
for the boot-mode.

We do not set the debconf variable install_devices, because the
'install_devices' variable is only defined for 'grub-pc', and thus
(still) only set for that package/namespace.

Reported-by: Friedrich Weber <f.weber@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Reviewed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-11-06 18:29:58 +01:00
Filip Schauer
d54381c74c Correct DNS IP check on management interface setup
Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
2023-11-06 17:40:16 +01:00
Christoph Heiss
42aa2fa7ef fix #4829: install: add new ZFS arc_max setup option
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-06 15:49:31 +01:00
Christoph Heiss
e8a7b9ba86 tui: bootdisk: simplify product handling by passing the config directly
No functional changes.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-06 15:48:18 +01:00
Christoph Heiss
801f5a283b tui: views: add optional suffix label for NumericEditViews
Most of the churn here is due to changing the inner view from an
`EditView` to a `LinearLayout`. Also prompted the introduction of two
small helpers .inner() and .inner_mut() to simplify things everywhere
else in the view.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-06 15:47:29 +01:00
Christoph Heiss
ed2b90a412 run env: add comment for query_total_memory()
This is mainly to explicitly document the unit of its return value.

No functional changes.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-03 13:00:40 +01:00
Christoph Heiss
5716113910 tui: fix clippy warning
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-03 12:52:56 +01:00
Christoph Heiss
feea90d471 tui, common: run rustfmt
While at it, move rustfmt.toml to the repo root, to share it with the
other crate.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-03 12:52:56 +01:00
Aaron Lauterer
c16d6893ec tui: remove unused read_json function
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-02 20:04:40 +01:00
Aaron Lauterer
9a8485808f tui: use installer_setup from common cate
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-02 20:04:38 +01:00
Aaron Lauterer
40b35db0f6 common: document installer_setup method
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-02 20:04:35 +01:00
Aaron Lauterer
1ac989e326 common: add installer_setup method
moved over from the TUI installer

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-02 20:04:33 +01:00
Aaron Lauterer
b2dfe0ba07 tui: remove now unused utils.rs
all it did moved to the common crate

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-02 20:04:30 +01:00
Aaron Lauterer
86c48f76f0 tui: switch to common crate
by switching dependencies and deleting doubled code to avoid ambiguities
within the same scope.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-02 20:04:26 +01:00
Aaron Lauterer
41f2a23371 tui-installer: add dependency for new common crate
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-02 20:04:24 +01:00
Aaron Lauterer
a83d1c96b2 common: disk_checks: make functions public
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-02 20:04:21 +01:00