]> git.proxmox.com Git - pve-installer.git/log
pve-installer.git
3 months agobuildsys: handle installing multiple executables to /usr/bin
Aaron Lauterer [Tue, 23 Jan 2024 17:00:39 +0000 (18:00 +0100)]
buildsys: handle installing multiple executables to /usr/bin

Otherwise the build will fail once we define more than one USR_BIN
file.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
3 months agoui: stdio: log error if display_html() is called on stdio backend
Christoph Heiss [Wed, 6 Dec 2023 11:34:51 +0000 (12:34 +0100)]
ui: stdio: log error if display_html() is called on stdio backend

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
3 months agolow-level: align wording of finish message
Christoph Heiss [Wed, 6 Dec 2023 11:34:50 +0000 (12:34 +0100)]
low-level: align wording of finish message

The other case uses "Installation finished [..]", thus use the same
wording here too.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
3 months agoproxinstall, common: remove "off" as zfs checksum option
Christoph Heiss [Tue, 6 Feb 2024 13:12:26 +0000 (14:12 +0100)]
proxinstall, common: remove "off" as zfs checksum option

See also the thread at [0] for the initial discussion/idea.

Disabling checksums is considered an "extraordinarily bad idea" [1] (for
pretty obvious reason) and nobody should really ever use it.

Thus remove the option completely; just so that users cannot simply
disable checksum "for performance reasons" without knowing about the
implications of this.

As pointed out by Thomas, it can still be set to "off" after the
installation using the `zfs` tool, if really wanted.

[0] https://lists.proxmox.com/pipermail/pve-devel/2023-December/061188.html
[1] https://openzfs.github.io/openzfs-docs/Basic%20Concepts/Checksums.html#disabling-checksums

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
3 months agoproxinstall, common: remove deprecated fletcher2 as zfs checksum algorithm
Christoph Heiss [Fri, 22 Dec 2023 10:52:24 +0000 (11:52 +0100)]
proxinstall, common: remove deprecated fletcher2 as zfs checksum algorithm

Fletcher-2 has long been deprecated and should not be used anymore
[0][1], so we probably should not offer it anymore too. It's been
deprecated since at least over 3 years, beyond that it's hard to find
an exact date.

[0]: https://openzfs.github.io/openzfs-docs/Basic%20Concepts/Checksums.html#checksum-algorithms
[1]: https://people.freebsd.org/~asomers/fletcher.pdf

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
5 months agobump version to 8.1.7
Thomas Lamprecht [Thu, 23 Nov 2023 10:11:27 +0000 (11:11 +0100)]
bump version to 8.1.7

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agosource interfaces.d snippets by default
Thomas Lamprecht [Thu, 23 Nov 2023 10:11:01 +0000 (11:11 +0100)]
source interfaces.d snippets by default

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agobump version to 8.1.6
Thomas Lamprecht [Wed, 22 Nov 2023 12:30:13 +0000 (13:30 +0100)]
bump version to 8.1.6

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agogrub: install all efi binaries in fallback/default dir
Fabian Grünbichler [Wed, 22 Nov 2023 12:19:27 +0000 (13:19 +0100)]
grub: install all efi binaries in fallback/default dir

else this fails with secureboot, where the entry point must be shim and not
grub.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
5 months agobump version to 8.1.5
Thomas Lamprecht [Tue, 21 Nov 2023 13:22:35 +0000 (14:22 +0100)]
bump version to 8.1.5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agoZFS: detect and handle secure boot
Fabian Grünbichler [Tue, 21 Nov 2023 13:13:19 +0000 (14:13 +0100)]
ZFS: detect and handle secure boot

and switch the ESP to grub if it is enabled.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
5 months agozfs: create dataset var-lib-vz for /var/lib/vz
Stoiko Ivanov [Tue, 21 Nov 2023 13:11:18 +0000 (14:11 +0100)]
zfs: create dataset var-lib-vz for /var/lib/vz

Creating rpool/var/lib/vz and all intermediate datasets causes a
service-failure of `var.mount` upon shutdown.

creating the dataset for /var/lib/vz directly at the rpool and setting
its mountpoint property seems the most robust way to address this.

The alternative approach of setting `canmount=off` on the `var`
dataset seems a bit dangerous (users setting a zfs property and
suddenly hiding their /var contents).

The only small downside to this approach is that the setting of the
mountpoint happens quite a bit after extracting the data - but this
would probably be better addressed with a refactoring of the
lowlevel-installer code (setting the zfs-pool up under /target and
getting rid of a few special cases)

Fixes: dd19d40ceac179ba18652f1d6c3e4c23f246af00
Suggested-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 months agoserial installer: add serial config for grub to target system
Stoiko Ivanov [Tue, 21 Nov 2023 11:09:59 +0000 (12:09 +0100)]
serial installer: add serial config for grub to target system

Matching if a serial will be needed for grub is based on the target
commandline - the speed is also read from there. The unit is based
on the ttyS device - although I'd assume that this might not always
match up.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 months agocommon: enforce even number of disks for ZFS RAID-10
Christoph Heiss [Tue, 21 Nov 2023 10:45:51 +0000 (11:45 +0100)]
common: enforce even number of disks for ZFS RAID-10

An uneven number of disks otherwise causes a panic due to an
out-of-bounds array access in the loop below.

Reported-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
5 months agotui: add missing argument for low-level installer test-session
Christoph Heiss [Tue, 21 Nov 2023 10:45:50 +0000 (11:45 +0100)]
tui: add missing argument for low-level installer test-session

This broke running the TUI installer in debug mode, does not effect
release builds in any way.

Fixes: 4b4dfa1 ("low level: testmode: take path to disk image instead of using /dev/null")
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
5 months agotui: preserve autoreboot checkbox state when switching views
Christoph Heiss [Tue, 21 Nov 2023 10:45:49 +0000 (11:45 +0100)]
tui: preserve autoreboot checkbox state when switching views

Instead of reading the checkbox when continuing to the next screen, save
its toggle status to the installer state instead on change.

Reported-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
5 months agotui: do not center EULA text
Christoph Heiss [Tue, 21 Nov 2023 10:45:48 +0000 (11:45 +0100)]
tui: do not center EULA text

Brings it in line with the GUI installer.

Reported-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
6 months agobump version to 8.1.4
Thomas Lamprecht [Fri, 17 Nov 2023 18:35:23 +0000 (19:35 +0100)]
bump version to 8.1.4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agotui: fix interface sort order
Stoiko Ivanov [Fri, 17 Nov 2023 17:30:23 +0000 (18:30 +0100)]
tui: fix interface sort order

Currently, when multiple NICs are present in a system the TUI
sometimes selects the wrong interface (not the one that has the
default gateway/dhcp lease)

I assume this is due to HashMap's values yielding an iterator in
arbitrary order

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Co-authored-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
 [ TL: avoid intermediate vector, reuse the SelectView's iter()]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agotui: bootdisk zfs config: add a maximum value to the `copies` option
Stefan Sterz [Fri, 17 Nov 2023 16:32:18 +0000 (17:32 +0100)]
tui: bootdisk zfs config: add a maximum value to the `copies` option

according to `man zfsprops` the copies option can only be 1, 2, or 3.
limit the field to 3 just like we do for the GTK based UI, as setting
higher options can't work anyway.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
 [ TL: fleece in note that we already limit this in the GTK UI ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agotui: install progress: use ok/cancel as button text for installer prompt
Christoph Heiss [Fri, 17 Nov 2023 13:45:27 +0000 (14:45 +0100)]
tui: install progress: use ok/cancel as button text for installer prompt

The GTK installer/UI module in the low-level installer does the same.
Messages used with this are worded for this, using yes/no instead can be
quite confusing (e.g.
Proxmox::Install::ask_existing_vg_rename_or_abort())

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
6 months agoui: stdio: replace newlines with whitespaces in prompt messages
Christoph Heiss [Fri, 17 Nov 2023 13:45:26 +0000 (14:45 +0100)]
ui: stdio: replace newlines with whitespaces in prompt messages

The line-based protocol currently used cannot handle this properly, so
introduce this as a stop-gap measure - otherwise messages might be cut
off.

This makes it work for now, and the text is wrapped correctely for the
screen width in the TUI anyway - which is the only user of this so far.

Will be reworked properly later on.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
 [ TL: add fix-me comment ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agotui: fix changing between non-LVM and LVM filesystem in bootdisk chooser
Christoph Heiss [Fri, 17 Nov 2023 12:12:18 +0000 (13:12 +0100)]
tui: fix changing between non-LVM and LVM filesystem in bootdisk chooser

Happens due to a force-unwrap() under the false assumption that the
disk for LVM configurations always exists when switching to a LVM
filesystem.
This fails spectacularly with a panic when switching from e.g. Btrfs to
ext4 in the filesystem chooser.

Fixes: eda9fa0 ("fix #4856: tui: bootdisk: use correct defaults in advanced dialog")
Reported-by: Christian Ebner <c.ebner@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
6 months agobump version to 8.1.3
Thomas Lamprecht [Fri, 17 Nov 2023 06:39:27 +0000 (07:39 +0100)]
bump version to 8.1.3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agogtk: show the unit for disk related options
Thomas Lamprecht [Fri, 17 Nov 2023 06:36:32 +0000 (07:36 +0100)]
gtk: show the unit for disk related options

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agogtk: labeled widget grid: allow adding optional suffix label
Thomas Lamprecht [Fri, 17 Nov 2023 06:35:42 +0000 (07:35 +0100)]
gtk: labeled widget grid: allow adding optional suffix label

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agogtk: rework helper for creating labeled widget grid
Thomas Lamprecht [Fri, 17 Nov 2023 06:01:04 +0000 (07:01 +0100)]
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>
6 months agoget fqdn: code/naming style cleanups
Thomas Lamprecht [Fri, 17 Nov 2023 05:34:33 +0000 (06:34 +0100)]
get fqdn: code/naming style cleanups

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agorun env: do not store emtpy hostname
Stoiko Ivanov [Thu, 16 Nov 2023 19:59:47 +0000 (20:59 +0100)]
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>
6 months agobump version to 8.1.2
Thomas Lamprecht [Thu, 16 Nov 2023 18:21:13 +0000 (19:21 +0100)]
bump version to 8.1.2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agozfs: create /var/lib/vz only for PVE
Stoiko Ivanov [Thu, 16 Nov 2023 17:12:26 +0000 (18:12 +0100)]
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: dd19d40ceac179ba18652f1d6c3e4c23f246af00
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
6 months agox: disable screen saver via blank time
Thomas Lamprecht [Thu, 16 Nov 2023 16:54:37 +0000 (17:54 +0100)]
x: disable screen saver via blank time

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agobump version to 8.1.1
Thomas Lamprecht [Thu, 16 Nov 2023 07:33:40 +0000 (08:33 +0100)]
bump version to 8.1.1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agozfs: set acltype=posix for root-dataset
Stoiko Ivanov [Thu, 16 Nov 2023 15:00:41 +0000 (16:00 +0100)]
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>
6 months agofix #1410: zfs: create /var/lib/vz as separate dataset
Stoiko Ivanov [Thu, 16 Nov 2023 15:00:40 +0000 (16:00 +0100)]
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>
6 months agounconfigured.sh: set serial to a number to prevent warning
Stoiko Ivanov [Thu, 16 Nov 2023 15:00:39 +0000 (16:00 +0100)]
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: a31259b1597447a0b431cd5c81a6db2bc80f1ddf
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
6 months agofix #4747: pass kernel cmdline parameters to target system
Stoiko Ivanov [Thu, 16 Nov 2023 15:00:38 +0000 (16:00 +0100)]
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>
6 months agoserial install: fix console parameter parsing
Stoiko Ivanov [Tue, 14 Nov 2023 17:31:48 +0000 (18:31 +0100)]
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>
6 months agod/control: add libgtk3-perl to B-D
Stoiko Ivanov [Tue, 14 Nov 2023 17:31:47 +0000 (18:31 +0100)]
d/control: add libgtk3-perl to B-D

With the first tests entering the installer in
9a0d66cb36d395a1186904132aed1d5dc33a0937

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

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
6 months agounconfigured.sh: set terminal size for serial install
Stoiko Ivanov [Thu, 22 Jun 2023 20:14:45 +0000 (22:14 +0200)]
unconfigured.sh: set terminal size for serial install

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
6 months agopass optional console parameter from installer to target
Stoiko Ivanov [Thu, 22 Jun 2023 20:08:48 +0000 (22:08 +0200)]
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>
6 months agobump version to 8.1.0
Thomas Lamprecht [Sat, 11 Nov 2023 13:32:42 +0000 (14:32 +0100)]
bump version to 8.1.0

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agolow-level, tui: count down auto-reboot timeout
Christoph Heiss [Fri, 10 Nov 2023 14:17:26 +0000 (15:17 +0100)]
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>
6 months agolow-level: avoid open-coding config reading, parsing and merging
Christoph Heiss [Fri, 10 Nov 2023 14:17:25 +0000 (15:17 +0100)]
low-level: avoid open-coding config reading, parsing and merging

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
6 months agotui: install_progress: handle errors in ui message loop more gracefully
Christoph Heiss [Fri, 10 Nov 2023 14:17:24 +0000 (15:17 +0100)]
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>
6 months agotui: install_progress: split out prompt logic into own function
Christoph Heiss [Fri, 10 Nov 2023 14:17:23 +0000 (15:17 +0100)]
tui: install_progress: split out prompt logic into own function

No functional changes.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
6 months agotui: install_progress: split out reboot handling into own function
Christoph Heiss [Fri, 10 Nov 2023 14:17:22 +0000 (15:17 +0100)]
tui: install_progress: split out reboot handling into own function

No functional changes.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
6 months agotui: install_progress: split out low-level installer spawing into own function
Christoph Heiss [Fri, 10 Nov 2023 14:17:21 +0000 (15:17 +0100)]
tui: install_progress: split out low-level installer spawing into own function

No functional changes.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
6 months agotui: install_progress: move progress task into own function
Christoph Heiss [Fri, 10 Nov 2023 14:17:20 +0000 (15:17 +0100)]
tui: install_progress: move progress task into own function

No functional changes.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
6 months agotui: move install progress dialog into own view module
Christoph Heiss [Fri, 10 Nov 2023 14:17:19 +0000 (15:17 +0100)]
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>
6 months agofix #4856: tui: bootdisk: use correct defaults in advanced dialog
Christoph Heiss [Thu, 9 Nov 2023 09:40:56 +0000 (10:40 +0100)]
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>
6 months agotui: bootdisk: refactor Rc<RefCell<..>> type into custom type
Christoph Heiss [Thu, 9 Nov 2023 09:40:55 +0000 (10:40 +0100)]
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>
6 months agolow level: testmode: take path to disk image instead of using /dev/null
Christoph Heiss [Thu, 9 Nov 2023 09:47:56 +0000 (10:47 +0100)]
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>
6 months agotui: bootdisk: expose `arc_max` ZFS option for PVE installations
Christoph Heiss [Tue, 7 Nov 2023 12:20:54 +0000 (13:20 +0100)]
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>
6 months agocommon: add ZFS `arc_max` installer setup option
Christoph Heiss [Tue, 7 Nov 2023 12:20:53 +0000 (13:20 +0100)]
common: add ZFS `arc_max` installer setup option

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
6 months agotest: add tests for zfs_arc_max calculations
Christoph Heiss [Tue, 7 Nov 2023 12:20:52 +0000 (13:20 +0100)]
test: add tests for zfs_arc_max calculations

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
6 months agoproxinstall: expose `arc_max` ZFS option for PVE installations
Christoph Heiss [Tue, 7 Nov 2023 12:20:51 +0000 (13:20 +0100)]
proxinstall: expose `arc_max` ZFS option for PVE installations

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
6 months agoinstall: use correct variable names in zfs_setup_module_conf()
Christoph Heiss [Tue, 7 Nov 2023 12:20:50 +0000 (13:20 +0100)]
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>
6 months agorun env: remove debug print
Christoph Heiss [Tue, 7 Nov 2023 12:20:49 +0000 (13:20 +0100)]
run env: remove debug print

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
6 months agotui: fix same "Administrator" typo in password and summary view
Christoph Heiss [Tue, 7 Nov 2023 12:23:40 +0000 (13:23 +0100)]
tui: fix same "Administrator" typo in password and summary view

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
6 months agoinstall: install correct grub metapackage for the current boot-mode
Stoiko Ivanov [Thu, 28 Sep 2023 14:05:33 +0000 (16:05 +0200)]
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>
6 months agoCorrect DNS IP check on management interface setup
Filip Schauer [Mon, 16 Oct 2023 10:20:06 +0000 (12:20 +0200)]
Correct DNS IP check on management interface setup

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
6 months agofix #4829: install: add new ZFS `arc_max` setup option
Christoph Heiss [Tue, 31 Oct 2023 12:10:56 +0000 (13:10 +0100)]
fix #4829: install: add new ZFS `arc_max` setup option

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
6 months agotui: bootdisk: simplify product handling by passing the config directly
Christoph Heiss [Tue, 31 Oct 2023 12:10:55 +0000 (13:10 +0100)]
tui: bootdisk: simplify product handling by passing the config directly

No functional changes.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
6 months agotui: views: add optional suffix label for `NumericEditView`s
Christoph Heiss [Tue, 31 Oct 2023 12:10:54 +0000 (13:10 +0100)]
tui: views: add optional suffix label for `NumericEditView`s

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>
6 months agorun env: add comment for query_total_memory()
Christoph Heiss [Tue, 31 Oct 2023 12:10:53 +0000 (13:10 +0100)]
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>
6 months agotui: fix clippy warning
Christoph Heiss [Fri, 3 Nov 2023 09:49:37 +0000 (10:49 +0100)]
tui: fix clippy warning

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
6 months agotui, common: run rustfmt
Christoph Heiss [Fri, 3 Nov 2023 09:49:36 +0000 (10:49 +0100)]
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>
6 months agotui: remove unused read_json function
Aaron Lauterer [Wed, 25 Oct 2023 16:00:11 +0000 (18:00 +0200)]
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>
6 months agotui: use installer_setup from common cate
Aaron Lauterer [Wed, 25 Oct 2023 16:00:10 +0000 (18:00 +0200)]
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>
6 months agocommon: document installer_setup method
Aaron Lauterer [Wed, 25 Oct 2023 16:00:09 +0000 (18:00 +0200)]
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>
6 months agocommon: add installer_setup method
Aaron Lauterer [Wed, 25 Oct 2023 16:00:08 +0000 (18:00 +0200)]
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>
6 months agotui: remove now unused utils.rs
Aaron Lauterer [Wed, 25 Oct 2023 16:00:07 +0000 (18:00 +0200)]
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>
6 months agotui: switch to common crate
Aaron Lauterer [Wed, 25 Oct 2023 16:00:06 +0000 (18:00 +0200)]
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>
6 months agotui-installer: add dependency for new common crate
Aaron Lauterer [Wed, 25 Oct 2023 16:00:05 +0000 (18:00 +0200)]
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>
6 months agocommon: disk_checks: make functions public
Aaron Lauterer [Wed, 25 Oct 2023 16:00:04 +0000 (18:00 +0200)]
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>
6 months agocommon: make InstallZfsOption public
Aaron Lauterer [Wed, 25 Oct 2023 16:00:03 +0000 (18:00 +0200)]
common: make InstallZfsOption 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>
6 months agocommon: utils: add dependency for doc test
Aaron Lauterer [Wed, 25 Oct 2023 16:00:02 +0000 (18:00 +0200)]
common: utils: add dependency for doc test

Was probably missed because it used to be in a binary crate where doc
tests aren't run automatically.

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>
6 months agocommon: copy common code from tui-installer
Aaron Lauterer [Wed, 25 Oct 2023 16:00:01 +0000 (18:00 +0200)]
common: copy common code from tui-installer

Copy code that is common to its own 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>
6 months agoadd proxmox-installer-common crate
Aaron Lauterer [Wed, 25 Oct 2023 16:00:00 +0000 (18:00 +0200)]
add proxmox-installer-common crate

It will be used for code shared among the different crates in the
installer. For now between the TUI installer and the upcoming auto
installer.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
 [TL: fold in Christoph's buildsys fix ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agotui: remove obsolete, global `SetupInfo` state
Christoph Heiss [Wed, 25 Oct 2023 08:56:24 +0000 (10:56 +0200)]
tui: remove obsolete, global `SetupInfo` state

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
6 months agotui: bootdisk: pass down product info to advanced dialog
Christoph Heiss [Wed, 25 Oct 2023 08:56:23 +0000 (10:56 +0200)]
tui: bootdisk: pass down product info to advanced dialog

Enables the advanced and LVM dialog to determine what options (max
root/data size and Btrfs RAIDs) by itself, without needing to resort to
the global `setup_info()` function.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
6 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>