]> git.proxmox.com Git - pve-installer.git/log
pve-installer.git
5 weeks agodebian: bump cursive to 0.21 master
Christoph Heiss [Fri, 9 Aug 2024 12:08:36 +0000 (14:08 +0200)]
debian: bump cursive to 0.21

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
5 weeks agotui: switch cursive to crossterm backend
Christoph Heiss [Tue, 13 Aug 2024 10:53:19 +0000 (12:53 +0200)]
tui: switch cursive to crossterm backend

Development of crossterm seems to be more active, has more frequent
releases and is also the default backend for cursive - so overall also
probably better supported/tested.

Additionally, it feels a bit more snappier/less flickery, probably due
to buffering writes to the TTY layer unlike termion.

As this effects only the way cursive talks to the TTY, this has no
visible change on the TUI itself.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
5 weeks agodebian: bump ureq to 2.10
Christoph Heiss [Fri, 9 Aug 2024 12:04:40 +0000 (14:04 +0200)]
debian: bump ureq to 2.10

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
5 weeks agodebian: bump rusttls to 0.21
Christoph Heiss [Fri, 9 Aug 2024 12:04:03 +0000 (14:04 +0200)]
debian: bump rusttls to 0.21

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
5 weeks agodebian: bump toml to 0.8
Christoph Heiss [Fri, 9 Aug 2024 12:02:56 +0000 (14:02 +0200)]
debian: bump toml to 0.8

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
5 weeks agoauto-installer: tests: fix wrong option name in expected output
Christoph Heiss [Tue, 23 Jul 2024 09:24:57 +0000 (11:24 +0200)]
auto-installer: tests: fix wrong option name in expected output

The name of this configuration option has been changed with commit
0e1d973 [0]. The patch of the commit introducing this tests [1] was
posted earlier and wasn't rebased properly before applying.

[0] 0e1d973 ("install: config: rename option lvm_auto_rename -> existing_storage_auto_rename")
[1] 89314a4 ("auto-installer: add test for hashed root password option")

Fixes: 89314a4 ("auto-installer: add test for hashed root password option")
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
8 weeks agoauto-installer: add test for hashed root password option
Christoph Heiss [Mon, 15 Jul 2024 07:56:06 +0000 (09:56 +0200)]
auto-installer: add test for hashed root password option

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Tested-by: Theodor Fumics <theodor.fumics@gmx.net>
8 weeks agoauto-installer: add new `global.root_password_hashed` answer option
Christoph Heiss [Mon, 15 Jul 2024 07:56:05 +0000 (09:56 +0200)]
auto-installer: add new `global.root_password_hashed` answer option

This allows user to specify the root password in a hashed format,
generated using e.g. mkpasswd(1), instead of plaintext.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Tested-by: Theodor Fumics <theodor.fumics@gmx.net>
8 weeks ago{auto, tui}-installer: adapt to new `root_password` plain/hashed setup option
Christoph Heiss [Mon, 15 Jul 2024 07:56:04 +0000 (09:56 +0200)]
{auto, tui}-installer: adapt to new `root_password` plain/hashed setup option

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Tested-by: Theodor Fumics <theodor.fumics@gmx.net>
8 weeks agolow-level: change root password option to contain either plaintext or hash
Christoph Heiss [Mon, 15 Jul 2024 07:56:03 +0000 (09:56 +0200)]
low-level: change root password option to contain either plaintext or hash

A hashed password can be created e.g. using the `mkpasswd(1)`.
This then will allow the auto-installer to pass along a
already-hashed password from the user, instead of simple plaintext.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Tested-by: Theodor Fumics <theodor.fumics@gmx.net>
8 weeks agotui-installer: remove `Debug` implementation for password options
Christoph Heiss [Mon, 15 Jul 2024 07:56:02 +0000 (09:56 +0200)]
tui-installer: remove `Debug` implementation for password options

So we never accidentally show/log the password somewhere. Need to drop
it from `InstallerOptions` in turn too, but it's never used currently
anyway.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Tested-by: Theodor Fumics <theodor.fumics@gmx.net>
8 weeks agocommon: move `PasswordOptions` type to tui crate
Christoph Heiss [Mon, 15 Jul 2024 07:56:01 +0000 (09:56 +0200)]
common: move `PasswordOptions` type to tui crate

It's only used internally there anyway, so make it slightly less
confusing.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Tested-by: Theodor Fumics <theodor.fumics@gmx.net>
2 months agolow-level: install: check for already-existing `rpool` on install
Christoph Heiss [Tue, 16 Jul 2024 08:18:10 +0000 (10:18 +0200)]
low-level: install: check for already-existing `rpool` on install

.. much in the same manner as the detection for LVM works.

zpools can only be renamed by importing them with a new name, so
unfortunately the import-export dance is needed.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Reviewed-by: Aaron Lauterer <a.lauterer@proxmox.com>
Tested-by: Aaron Lauterer <a.lauterer@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoinstall: config: rename option lvm_auto_rename -> existing_storage_auto_rename
Christoph Heiss [Tue, 16 Jul 2024 08:18:09 +0000 (10:18 +0200)]
install: config: rename option lvm_auto_rename -> existing_storage_auto_rename

As this is an internal option for the low-level installer anyway, no
real functional changes here.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Reviewed-by: Aaron Lauterer <a.lauterer@proxmox.com>
Tested-by: Aaron Lauterer <a.lauterer@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoproxmox: add zfs module for retrieving importable zpool info
Christoph Heiss [Tue, 16 Jul 2024 08:18:07 +0000 (10:18 +0200)]
proxmox: add zfs module for retrieving importable zpool info

Will be used for prompting the user to rename existing "rpool" ZFS
pools, similar to what we do for an existing LVM "pve" volume group.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Reviewed-by: Aaron Lauterer <a.lauterer@proxmox.com>
Tested-by: Aaron Lauterer <a.lauterer@proxmox.com>
 [ TL: added a bit context for what this will be used and merge in the
   tests into this preparatory commit ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agotree-wide: collect hardcoded installer runtime directory strings into constant
Christoph Heiss [Wed, 10 Jul 2024 13:27:42 +0000 (15:27 +0200)]
tree-wide: collect hardcoded installer runtime directory strings into constant

No functional changes.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Tested-By: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-By: Stefan Hanreich <s.hanreich@proxmox.com>
2 months agotree-wide: fix some typos
Christoph Heiss [Wed, 10 Jul 2024 13:27:41 +0000 (15:27 +0200)]
tree-wide: fix some typos

No functional changes.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Tested-By: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-By: Stefan Hanreich <s.hanreich@proxmox.com>
2 months agochroot: print full anyhow message
Christoph Heiss [Wed, 10 Jul 2024 13:27:40 +0000 (15:27 +0200)]
chroot: print full anyhow message

This forces anyhow to give more context to the stringified error, which
helps tremendously when trying to make sense of these messages.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Tested-By: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-By: Stefan Hanreich <s.hanreich@proxmox.com>
2 months agoauto-installer: fix answer-request charset
Fabian Grünbichler [Fri, 26 Apr 2024 08:12:55 +0000 (10:12 +0200)]
auto-installer: fix answer-request charset

'utf-' is a typo, and can trip up some servers that do strict
checking/matching.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Reviewed-by: Christoph Heiss <c.heiss@proxmox.com>
2 months agotui: add missing lifetime annotation for constant string reference
Thomas Lamprecht [Thu, 4 Jul 2024 09:26:48 +0000 (11:26 +0200)]
tui: add missing lifetime annotation for constant string reference

This produces as warning that will become a hard-error in the future.
See also: https://github.com/rust-lang/rust/issues/115010

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agotui: bootdisk: use tabbed view for disk options on small screens
Christoph Heiss [Thu, 13 Jun 2024 11:53:13 +0000 (13:53 +0200)]
tui: bootdisk: use tabbed view for disk options on small screens

It's currently only activated for small (<=80 columns) displays, to make
disk selection a lot more usable in these cases. This mostly affects
serial console installation, but possibly also installations using a
virtual screen via IPMI/BMC.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
Tested-by: Max Carrara <m.carrara@proxmox.com>
2 months agotui: views: add new TabbedView component
Christoph Heiss [Thu, 13 Jun 2024 11:53:12 +0000 (13:53 +0200)]
tui: views: add new TabbedView component

Add a tabbed view component, for usage in the advanced disk options
dialog when selecting ZFS or Btrfs (for now). Works pretty much the same
as its GUI counterpart, as much as that is possible.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
Tested-by: Max Carrara <m.carrara@proxmox.com>
2 months agotui: bootdisk: align btrfs dialog interface with zfs equivalent
Christoph Heiss [Thu, 13 Jun 2024 11:53:11 +0000 (13:53 +0200)]
tui: bootdisk: align btrfs dialog interface with zfs equivalent

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
Tested-by: Max Carrara <m.carrara@proxmox.com>
2 months agotui: fix some comment typos
Christoph Heiss [Thu, 13 Jun 2024 11:53:10 +0000 (13:53 +0200)]
tui: fix some comment typos

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
Tested-by: Max Carrara <m.carrara@proxmox.com>
2 months agobuild: force debug symbols in release build
Fabian Grünbichler [Thu, 20 Jun 2024 10:36:36 +0000 (12:36 +0200)]
build: force debug symbols in release build

they then get stripped into their own package anyway, but without this we don't
get debug symbols at all with rustc >= 1.77

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 months agobump version to 8.2.6
Thomas Lamprecht [Wed, 8 May 2024 14:04:33 +0000 (16:04 +0200)]
bump version to 8.2.6

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoassistant: use single dash for xorriso parameter
Aaron Lauterer [Tue, 30 Apr 2024 10:46:09 +0000 (12:46 +0200)]
assistant: use single dash for xorriso parameter

while it works with two, one is what is shown in the man page and what
we already use for the other paramters.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Tested-by: Stoiko Ivanov <s.ivanov@proxmox.com>
4 months agoassistant: keep prepared iso bootable on uefi with flash drives
Aaron Lauterer [Tue, 30 Apr 2024 10:46:08 +0000 (12:46 +0200)]
assistant: keep prepared iso bootable on uefi with flash drives

By mapping files into the ISO, the UUID for the partitions change as
they depend on the timestamp. The result is, that grub cannot find its
partition anymore and the user ends up on the grub shell.

This only happens when booting from a blockdev in UEFI mode. E.g. a USB
flash drive. Alternatively one can `dd` the ISO to a small (2GiB) VM
disk and mark it as the first boot device.

When booting in legacy mode or via CDROM (e.g. pass through via IPMI),
it worked.

Xorriso can report the commands needed to recreate the source ISO. The
'-volume_date uuid' is the one needed to override the same UUIDs. We
therefore read it first from the source iso and pass it as parameter
whenever we inject a file into the iso.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Tested-by: Stoiko Ivanov <s.ivanov@proxmox.com>
4 months agoinstall module: getters: correctly use plural in error messages
Alexander Zeidler [Thu, 25 Apr 2024 08:40:21 +0000 (10:40 +0200)]
install module: getters: correctly use plural in error messages

Signed-off-by: Alexander Zeidler <a.zeidler@proxmox.com>
4 months agoassistant: fix spelling and precise text in help usage output
Alexander Zeidler [Thu, 25 Apr 2024 08:40:22 +0000 (10:40 +0200)]
assistant: fix spelling and precise text in help usage output

Signed-off-by: Alexander Zeidler <a.zeidler@proxmox.com>
4 months agobump version to 8.2.5
Thomas Lamprecht [Wed, 24 Apr 2024 11:11:45 +0000 (13:11 +0200)]
bump version to 8.2.5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agofetch answer: really try lower-case variant of label too
Thomas Lamprecht [Wed, 24 Apr 2024 10:37:39 +0000 (12:37 +0200)]
fetch answer: really try lower-case variant of label too

Reported-by: Friedrich Weber <f.weber@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agobump version to 8.2.4
Thomas Lamprecht [Wed, 24 Apr 2024 08:55:09 +0000 (10:55 +0200)]
bump version to 8.2.4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoanswer: replace custom display impl with derived one from serde plain
Thomas Lamprecht [Wed, 24 Apr 2024 09:24:10 +0000 (11:24 +0200)]
answer: replace custom display impl with derived one from serde plain

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoanswer: perform basic input validation for keyboard
Christian Ebner [Wed, 24 Apr 2024 08:48:50 +0000 (10:48 +0200)]
answer: perform basic input validation for keyboard

Currently it is possible to validate and create an iso with an
invalid keyboad layout, only failing later during installation.

Add a basic check for correct keyboard layout by defining an enum
with allowed variants.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoassistant: updated remaining error messages to reworked CLI
Thomas Lamprecht [Wed, 24 Apr 2024 09:12:55 +0000 (11:12 +0200)]
assistant: updated remaining error messages to reworked CLI

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoassistant: fix newline before ':' in help usage output
Dominik Csapak [Wed, 24 Apr 2024 09:02:09 +0000 (11:02 +0200)]
assistant: fix newline before ':' in help usage output

this belongs after the ':' otherwise the output looks weird:

  [..] can be
  : * integrated into [..]
  * needs to be [..]

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agofetch answer: refactor code to find partition path
Thomas Lamprecht [Wed, 24 Apr 2024 08:50:04 +0000 (10:50 +0200)]
fetch answer: refactor code to find partition path

to avoid some repetition

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoauto-installer: shorten partition label to fit in 11 characters for FAT
Thomas Lamprecht [Wed, 24 Apr 2024 08:23:43 +0000 (10:23 +0200)]
auto-installer: shorten partition label to fit in 11 characters for FAT

(v)FAT is still the most popular FS on removable medias like USB pen
drives, so we need to cope with its legacy..

So, rename the label that we look for again to PROXMOX-AIS, as that
still should allow admins to better recognize what this might be for
by having the "Proxmox" context and the rest is just hard to get
sensible meaning in, so do not bother to invent elaborate explanations
of why AIS is a good choice, it isn't but it's about the best thing
that one can do in these constraints.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agobump version to 8.2.3
Thomas Lamprecht [Tue, 23 Apr 2024 22:16:39 +0000 (00:16 +0200)]
bump version to 8.2.3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoalso skip proxmox-grub if not booted in EFI mode
Thomas Lamprecht [Tue, 23 Apr 2024 22:11:28 +0000 (00:11 +0200)]
also skip proxmox-grub if not booted in EFI mode

This would effectively pull in grub-efi-amd64, which we skip a line
above this if not in EFI mode..

The builder now adds this always to the packages due to the
proxmox-secure-boot-support meta package being present there, at least
that's my current educated guess (confirmed in practice).

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agobump version to 8.2.2
Thomas Lamprecht [Tue, 23 Apr 2024 19:30:40 +0000 (21:30 +0200)]
bump version to 8.2.2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agounconfigured: start debug shell if auto-installation is enabled without config
Thomas Lamprecht [Tue, 23 Apr 2024 19:13:53 +0000 (21:13 +0200)]
unconfigured: start debug shell if auto-installation is enabled without config

Allows the user to fetch a configuration manually, we might even do
this in a loop, but for now this is better than nothing.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agofetch answer: allow to override fetch-from mode through CLI arguments
Thomas Lamprecht [Tue, 23 Apr 2024 19:02:47 +0000 (21:02 +0200)]
fetch answer: allow to override fetch-from mode through CLI arguments

Allow the user to pass a fetch-from mode also through CLI arguments.

This can be useful for debugging or if the GRUB boot entry from the
advanced menu is used with a ISO that did not (yet) got prepared for
automatic installation.

This is done in a quite crudely way, probably still beats most C
programs though. Only real bigger ugliness the user will notice is
that it exits with a failure code when the user asking for help
through passing `-h` or `--help`.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agofetch answer: split main for easier error handling
Thomas Lamprecht [Tue, 23 Apr 2024 18:51:06 +0000 (20:51 +0200)]
fetch answer: split main for easier error handling

Making the top-level main a simple match around a result allows us to
use normal rust error handling inside the actual do_main code, making
it much more ergonomic.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoassistant: collapse nested if
Thomas Lamprecht [Tue, 23 Apr 2024 18:50:06 +0000 (20:50 +0200)]
assistant: collapse nested if

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agofetch answer: drop unused clap dependency from cargo toml
Thomas Lamprecht [Tue, 23 Apr 2024 18:24:31 +0000 (20:24 +0200)]
fetch answer: drop unused clap dependency from cargo toml

before someone starts to use this complexity pile here too..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agolow level installer: only log about creating SWAP if there's any
Thomas Lamprecht [Tue, 23 Apr 2024 17:22:01 +0000 (19:22 +0200)]
low level installer: only log about creating SWAP if there's any

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agolow level installer: avoid undef warning in progress log when using ZFS
Thomas Lamprecht [Tue, 23 Apr 2024 17:16:05 +0000 (19:16 +0200)]
low level installer: avoid undef warning in progress log when using ZFS

The $rootdev variable is not set in the ZFS branch, and ZFS is not
mounted here, so just move the progress update inside the non-ZFS
branch.

Reported-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoauto installer: report every progress update and include text
Thomas Lamprecht [Tue, 23 Apr 2024 16:57:16 +0000 (18:57 +0200)]
auto installer: report every progress update and include text

now that we do not print about extracting every package through stderr
we can explicitly log progress output without duplicating lots of
information

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agolow level installer: drop printing about extracting deb packages to stderr
Thomas Lamprecht [Tue, 23 Apr 2024 16:53:05 +0000 (18:53 +0200)]
low level installer: drop printing about extracting deb packages to stderr

we already log that and printing that to stderr does not provides that
much extra value and is also not done for similar actions like the
configuration of packages.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoassistant: fix mentioning outdated fetch-from mode in error
Thomas Lamprecht [Tue, 23 Apr 2024 16:26:55 +0000 (18:26 +0200)]
assistant: fix mentioning outdated fetch-from mode in error

... and unify the branches for non-http mode.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoassistant: rework prepare-iso doc comment to recent changes
Thomas Lamprecht [Tue, 23 Apr 2024 16:26:20 +0000 (18:26 +0200)]
assistant: rework prepare-iso doc comment to recent changes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoassistant: prepare iso: s/direct/included to match current naming
Alexander Zeidler [Tue, 23 Apr 2024 09:00:26 +0000 (11:00 +0200)]
assistant: prepare iso: s/direct/included to match current naming

Signed-off-by: Alexander Zeidler <a.zeidler@proxmox.com>
4 months agoassistant: error out on set network config for dhcp
Stoiko Ivanov [Tue, 23 Apr 2024 15:18:06 +0000 (17:18 +0200)]
assistant: error out on set network config for dhcp

potentially will not happen too often in practice if the sample files
always contain the right source. Still having settings in an answer
file that get ignored does not seem right.

tested with `validate-answer` on a file without `source` in the
network section (which initially caused confusion for me)

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
4 months agoauto-installer: move ssh keys setup to low-level installer
Christoph Heiss [Tue, 23 Apr 2024 14:44:29 +0000 (16:44 +0200)]
auto-installer: move ssh keys setup to low-level installer

.. thereby, also fixing a accidental shell injection.

Since run_cmd{,s}() is nowhere else used anymore, they can be removed
too.

Also mostly reverts commit

  5878dc4ae "auto-installer: handle auto-reboot info messages directly"

in the process too.

Reported-by: Friedrich Weber <f.weber@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
4 months agorun cargo fmt
Thomas Lamprecht [Tue, 23 Apr 2024 14:08:43 +0000 (16:08 +0200)]
run cargo fmt

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agotui: update screen during installation only when necessary
Christoph Heiss [Tue, 23 Apr 2024 13:23:39 +0000 (15:23 +0200)]
tui: update screen during installation only when necessary

This can significantly reduces CPU load and even speed up the
installation a lot on single-core machines. While the latter may not be
a realistic target for obvious reasons, lowering overall CPU usage is
always a good thing.

Also helps with flickering during the installation process quite a bit
too.

E.g. a test installation on a single-core VM goes down from 47:35 min
w/o the patch to 2:26 min w/ the patch, a ~94%(!) decrease in time.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
4 months agoskip proxmox-secure-boot-support if secureboot is not enabled
Fabian Grünbichler [Tue, 23 Apr 2024 12:27:54 +0000 (14:27 +0200)]
skip proxmox-secure-boot-support if secureboot is not enabled

while it doesn't hurt to be installed, it also doesn't help in any fashion on
such systems.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 months agomove secure boot state to RunEnv
Fabian Grünbichler [Tue, 23 Apr 2024 12:27:53 +0000 (14:27 +0200)]
move secure boot state to RunEnv

as preparation for using it in more than one place.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 months agoauto installer: rename fetch mode type and included variant
Thomas Lamprecht [Tue, 23 Apr 2024 13:11:11 +0000 (15:11 +0200)]
auto installer: rename fetch mode type and included variant

This is not a installation mode but rather tells us where to fetch the
answer file from.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoauto installer: rework the default filename suffix addded to the prepared iso
Thomas Lamprecht [Tue, 23 Apr 2024 13:10:36 +0000 (15:10 +0200)]
auto installer: rework the default filename suffix addded to the prepared iso

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoauto installer: fetch mode: move http settings into own struct
Thomas Lamprecht [Tue, 23 Apr 2024 13:09:45 +0000 (15:09 +0200)]
auto installer: fetch mode: move http settings into own struct

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoassistant: default to output directory for tmp iso file on prepare
Thomas Lamprecht [Tue, 23 Apr 2024 13:06:37 +0000 (15:06 +0200)]
assistant: default to output directory for tmp iso file on prepare

The directory where the input ISO is on might be read-only and so it
makes more sense to use the output directory to derive the default tmp
directory from.

Note that by default the output directory is the same as the one from
the input file, so this commit won't have a change for those that do
not override the output file explicitly.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoassistant: rework prepare-iso command line interface
Thomas Lamprecht [Tue, 23 Apr 2024 13:03:10 +0000 (15:03 +0200)]
assistant: rework prepare-iso command line interface

Use input and output for the input and output files, drop various
short options, we can always re-add them later and forcing the use of
the more telling long options is a UX gift to sites with multiple
admins working on this stuff.

Further rename the "install-mode" to "fetch-from" as the option does
not changes the installation mode but rather the mode where the answer
file is fetched from.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoauto installer: drop fetch-from auto mode
Thomas Lamprecht [Tue, 23 Apr 2024 12:43:52 +0000 (14:43 +0200)]
auto installer: drop fetch-from auto mode

It simpler to force the user to chose, as then they will always know
where an ISO pulls the answer file from without any complex automatic
fallback logic, which might be also undesired, especially in
environments where one has not full control (trust) over the network.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agomake auto install source mode use a singular name
Thomas Lamprecht [Tue, 23 Apr 2024 10:37:47 +0000 (12:37 +0200)]
make auto install source mode use a singular name

A enum is always only one specific variant, not multiple.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoauto-installer: support UTC as timezone
Christoph Heiss [Tue, 23 Apr 2024 11:29:50 +0000 (13:29 +0200)]
auto-installer: support UTC as timezone

Reported-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoremaining clippy fixes
Wolfgang Bumiller [Tue, 23 Apr 2024 08:08:20 +0000 (10:08 +0200)]
remaining clippy fixes

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agocargo clippy --fix
Wolfgang Bumiller [Tue, 23 Apr 2024 08:01:02 +0000 (10:01 +0200)]
cargo clippy --fix

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agoanyhow usage consistency
Wolfgang Bumiller [Tue, 23 Apr 2024 07:59:37 +0000 (09:59 +0200)]
anyhow usage consistency

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agodrop glob helper and tests
Wolfgang Bumiller [Mon, 22 Apr 2024 09:19:47 +0000 (11:19 +0200)]
drop glob helper and tests

The tests weren't testing our code, but the glob crate itself, which
is not really our job...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agocleanup unnecessary clones
Wolfgang Bumiller [Mon, 22 Apr 2024 08:06:43 +0000 (10:06 +0200)]
cleanup unnecessary clones

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agosimplify some code
Wolfgang Bumiller [Tue, 23 Apr 2024 07:51:23 +0000 (09:51 +0200)]
simplify some code

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agodowngrade internal doc comment to regular comment
Wolfgang Bumiller [Mon, 22 Apr 2024 07:52:07 +0000 (09:52 +0200)]
downgrade internal doc comment to regular comment

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agouse qr// for regex variable
Wolfgang Bumiller [Mon, 22 Apr 2024 07:45:40 +0000 (09:45 +0200)]
use qr// for regex variable

and don't wrap it within `m//` when using it...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agoless strict regex for matching udev env variables
Wolfgang Bumiller [Mon, 22 Apr 2024 07:42:43 +0000 (09:42 +0200)]
less strict regex for matching udev env variables

looking through /usr/lib/udev/rules.d there are at least some which
also have digits (eg. `IEEE1394_...`), so let's just match [^=]+ for
the variable name.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agobump resolver to 2
Wolfgang Bumiller [Tue, 23 Apr 2024 08:02:04 +0000 (10:02 +0200)]
bump resolver to 2

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agorename .cargo/config to .cargo/config.toml
Wolfgang Bumiller [Tue, 23 Apr 2024 08:00:39 +0000 (10:00 +0200)]
rename .cargo/config to .cargo/config.toml

as the old name is deprecated and newer rust compilers warn about it

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agoauto-installer: move `system.root_ssh_keys` option to `global` section
Christoph Heiss [Mon, 22 Apr 2024 17:47:37 +0000 (19:47 +0200)]
auto-installer: move `system.root_ssh_keys` option to `global` section

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
4 months agoauto-installer: rename `global.password` option to `global.root_password`
Christoph Heiss [Mon, 22 Apr 2024 17:47:36 +0000 (19:47 +0200)]
auto-installer: rename `global.password` option to `global.root_password`

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
4 months agogitignore: sort and ignore package build-directory
Thomas Lamprecht [Mon, 22 Apr 2024 15:56:44 +0000 (17:56 +0200)]
gitignore: sort and ignore package build-directory

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agobump version to 8.2.1
Thomas Lamprecht [Mon, 22 Apr 2024 15:51:34 +0000 (17:51 +0200)]
bump version to 8.2.1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agod/control: recommend xorriso for assistant package
Thomas Lamprecht [Mon, 22 Apr 2024 15:49:39 +0000 (17:49 +0200)]
d/control: recommend xorriso for assistant package

Not all commands require it, so do not make it a hard-dependency, but
a recommend fits quite well here.

Reported-by: Mira Limbeck <mira.limbeck@gmail.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoassistant: prepare iso: avoid an useless intermediate copy of the answer file
Thomas Lamprecht [Mon, 22 Apr 2024 14:48:39 +0000 (16:48 +0200)]
assistant: prepare iso: avoid an useless intermediate copy of the answer file

This fixes a bug for the case where the answer file was named
"answer.toml", as then the code tried to copy the file to itself,
which just caused the file being truncated.

This was quite confusing for the user, as the validation of the answer
file happened before the copy step, so one would see that it got
correctly validated only to then turn up empty inside the ISO..

While this was introduced through a14a934 ("assistant: perpare-iso
avoid separate directory and make less verbose"), copying the answer
file before injecting it into the ISO was never required, so just use
the source file directly.

Note that this is still a bit racy w.r.t. validation and inserting
into the ISO, to fix that we'd need to pass around empty files or
write the content directly, both not worth it for now.

Fixes: a14a934
Reported-by: Stefan Hanreich <s.hanreich@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoauto-installer: use new `lvm_auto_rename` option to avoid prompt
Christoph Heiss [Mon, 22 Apr 2024 12:46:43 +0000 (14:46 +0200)]
auto-installer: use new `lvm_auto_rename` option to avoid prompt

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
4 months agolow-level install: add option to automatically rename LVM volumes
Christoph Heiss [Mon, 22 Apr 2024 12:46:42 +0000 (14:46 +0200)]
low-level install: add option to automatically rename LVM volumes

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
4 months agobump version to 8.2.0
Thomas Lamprecht [Thu, 18 Apr 2024 20:37:07 +0000 (22:37 +0200)]
bump version to 8.2.0

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoadd fixme comment to move ssh-key setup over to installer
Thomas Lamprecht [Mon, 22 Apr 2024 12:31:31 +0000 (14:31 +0200)]
add fixme comment to move ssh-key setup over to installer

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoauto-installer: handle auto-reboot info messages directly
Christoph Heiss [Mon, 22 Apr 2024 12:11:07 +0000 (14:11 +0200)]
auto-installer: handle auto-reboot info messages directly

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoauto-installer: add new `system.root_ssh_keys` answer option
Christoph Heiss [Mon, 22 Apr 2024 12:11:06 +0000 (14:11 +0200)]
auto-installer: add new `system.root_ssh_keys` answer option

.. for declaratively adding SSH keys to the installed system. This is a
list of SSH public keys added to `/root/.ssh/authorized_keys` after the
installation has finished.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoauto install: rename network config source
Thomas Lamprecht [Mon, 22 Apr 2024 06:12:07 +0000 (08:12 +0200)]
auto install: rename network config source

A use_dhcp boolean implies that the network config is set to always
use DHCP, not that the installer uses the info that it got from DHCP
to write out a static network config.

Use a source field that allows to cleanly separate the two possible
options.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoauto install: drop post/pre command execution for now
Thomas Lamprecht [Mon, 22 Apr 2024 06:00:58 +0000 (08:00 +0200)]
auto install: drop post/pre command execution for now

This can be quite a bit dangerous w.r.t. prepared ISOs as attack
vector or copy cats, we rather should implement the common use cases,
like adding a SSH auth key, as explicit, declarative defined config
option.

Such a overly general command execution might be something to add at a
later stage, but not for the initial MVP.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoassistant: improve check if xorriso is installed
Thomas Lamprecht [Fri, 19 Apr 2024 17:20:03 +0000 (19:20 +0200)]
assistant: improve check if xorriso is installed

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoassistant: rename identifiers command to system-info
Thomas Lamprecht [Fri, 19 Apr 2024 16:33:15 +0000 (18:33 +0200)]
assistant: rename identifiers command to system-info

better fits to what it does and to the device-info sibling command.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoassistant: rustify getting sysinfo
Thomas Lamprecht [Fri, 19 Apr 2024 16:33:02 +0000 (18:33 +0200)]
assistant: rustify getting sysinfo

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoprint paths directly with debug, not display
Thomas Lamprecht [Fri, 19 Apr 2024 16:06:14 +0000 (18:06 +0200)]
print paths directly with debug, not display

A debug print is not only shorter code but also quotes the path
correctly, making it nicer for the user to copy (e.g., if the path is
at the end of a sentence the trailing dot could be misinterpreted as
being part of the path otherwise)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoassistant: perpare-iso avoid separate directory and make less verbose
Thomas Lamprecht [Fri, 19 Apr 2024 15:52:34 +0000 (17:52 +0200)]
assistant: perpare-iso avoid separate directory and make less verbose

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agofetch answers: rename partition search label
Thomas Lamprecht [Fri, 19 Apr 2024 13:14:27 +0000 (15:14 +0200)]
fetch answers: rename partition search label

The new one is far from perfect either, but labels can be at max 16
characters, so that's what we have to work with.

It now is slightly easier to read due to the hyphen separation and
contains the following relevant info:
- proxmox spelled out in full, so anybody seeing that label has a good
  chance to narrow down what it could do already by a lot
- inst is a bit cryptic, but that Proxmox has a installer is a easy to
  find out fact
- src should hopefully relay that this is the source of
  (configuration) for something related to a installer by proxmox

But yeah, please don't limit IDs or names to less than 32, ideally
even 64, characters, that's the bare minimum to get some expressive
names that can have actual meaning..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agofetch answers: avoid utils module
Thomas Lamprecht [Fri, 19 Apr 2024 12:52:33 +0000 (14:52 +0200)]
fetch answers: avoid utils module

utils/helpers/tools are all modules with a way to generic name and
will be misused as dumping ground for basically everything.

Just move the helper to where they are used and drop some bogus
methods like get_answer_file, which neither searches nor gets an
answer file (type) but just is a plain and slightly over engineered
std::fs::read_to_string

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>