]> git.proxmox.com Git - pve-installer.git/log
pve-installer.git
11 hours agobump version to 8.3.3 master
Thomas Lamprecht [Wed, 20 Nov 2024 18:50:40 +0000 (19:50 +0100)]
bump version to 8.3.3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 hours agocommon: make btrfs disk options uppercase for consistency
Daniel Kral [Wed, 20 Nov 2024 18:24:14 +0000 (19:24 +0100)]
common: make btrfs disk options uppercase for consistency

As XFS and ZFS are spelled in uppercase letters in the installer UI and
BTRFS is usually written in this way too, make the BTRFS string
uppercase too for consistency wrt to the other options.

Signed-off-by: Daniel Kral <d.kral@proxmox.com>
11 hours agocommon: allow lowercase and uppercase btrfs raid levels
Daniel Kral [Wed, 20 Nov 2024 18:24:13 +0000 (19:24 +0100)]
common: allow lowercase and uppercase btrfs raid levels

Allows the BTRFS RAID levels to be either lowercase or uppercase when
deserializing them from string values, i.e. currently only the config
value of `btrfs.raid` in auto-installer answer files.

Signed-off-by: Daniel Kral <d.kral@proxmox.com>
11 hours agocommon: allow lowercase and uppercase zfs raid levels
Daniel Kral [Wed, 20 Nov 2024 18:24:12 +0000 (19:24 +0100)]
common: allow lowercase and uppercase zfs raid levels

Allows the ZFS RAID levels to be either lowercase or uppercase when
deserializing them from string values, i.e. currently only the config
value of `zfs.raid` in auto-installer answer files.

This partly fixes a regression, where deserializing the `zfs.raid`
property in answer files were only possible with uppercase values for
the ZFS RAID Z-levels, opposed to only lowercase as in previous
versions. This breaks the user API, as users cannot use the same answer
files as before for ZFS RAID Z-levels (the prepare-iso command fails).

Fixes: 510b0c008fb1 ("common: simplifying filesystem type serializing & Display trait impl")
Signed-off-by: Daniel Kral <d.kral@proxmox.com>
36 hours agobump version to 8.3.2
Thomas Lamprecht [Tue, 19 Nov 2024 17:46:09 +0000 (18:46 +0100)]
bump version to 8.3.2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
36 hours agounconfigured: continue reboot after 30s if post-hook fails
Thomas Lamprecht [Tue, 19 Nov 2024 17:43:40 +0000 (18:43 +0100)]
unconfigured: continue reboot after 30s if post-hook fails

Wait some time to allow checking for any error output to determine why
the posthook might have failed but then continue with the reboot.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
38 hours agofirst-boot: multi-user: start after product-specific API proxy
Christoph Heiss [Tue, 19 Nov 2024 15:13:44 +0000 (16:13 +0100)]
first-boot: multi-user: start after product-specific API proxy

First of, multi-user.target does not seem to really provide any (strong)
ordering guarantee, it seems.

Instead, let the "fully-up" ordering from the auto-installer depend on
the product-specific API proxy instead.

That way, it is ensured that 1) the system really is fully up and 2)
that users could even use the API / CLI commands, or write files to
pmxcfs (in case of PVE).

After= and Wants= ignore non-existent units, so we can just specify all
three API proxy units here w/o any conditional.

Suggested-by: Shannon Sterz <s.sterz@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
38 hours agofetch-answer: encode unsafe characters in partition label
Filip Schauer [Tue, 19 Nov 2024 15:56:09 +0000 (16:56 +0100)]
fetch-answer: encode unsafe characters in partition label

Ensure potentially unsafe characters in the partition label are encoded,
preventing the installer from failing to find the answer partition when
the label contains whitespaces or !"$%&'()*,/;<>?[\]^`{|}~

The encoding is done according to `blkid_encode_string` [0] in the blkid
util, which is used by `/lib/udev/rules.d/60-persistent-storage.rules`
to create a symlink under `/dev/disk/by-label/`.

For example: "ANSWER PART" is encoded to "ANSWER\x20PART"

[0] https://github.com/util-linux/util-linux/blob/master/libblkid/src/encode.c

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
Tested-by: Christoph Heiss <c.heiss@proxmox.com>
40 hours agobump version to 8.3.1
Thomas Lamprecht [Tue, 19 Nov 2024 13:30:51 +0000 (14:30 +0100)]
bump version to 8.3.1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
40 hours agoLVM creation: note size boundary in hint and fix code line-wrap
Thomas Lamprecht [Tue, 19 Nov 2024 13:26:57 +0000 (14:26 +0100)]
LVM creation: note size boundary in hint and fix code line-wrap

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
40 hours agoLVM creation: warn about skipping data LV create if maxvz is set <= 4 GiB
Mira Limbeck [Tue, 19 Nov 2024 11:12:41 +0000 (12:12 +0100)]
LVM creation: warn about skipping data LV create if maxvz is set <= 4 GiB

If it is set and 0, don't warn.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
 [ TL: adapt subject ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
41 hours agocommon: fix deserialization of install config
Christoph Heiss [Tue, 19 Nov 2024 11:08:44 +0000 (12:08 +0100)]
common: fix deserialization of install config

We serialize it as an integer for perl compatibility, so we need to also
deserialize it as such .. the latter is used in proxmox-chroot.

Otherwise, an auto-installation will fail at the end, when a
post-installation webhook is configured, while trying to run the
proxmox-chroot tool.

Reported-by: Timothy Nicholson <t.nicholson@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
43 hours agolicense: Improve "For more information" paragraph
Maximiliano Sandoval [Tue, 19 Nov 2024 10:30:33 +0000 (11:30 +0100)]
license: Improve "For more information" paragraph

The sentence is phrased in a way which is not completely clear.

This matches the Backup Server license more closely:

        For more information, visit <b>www.proxmox.com</b>
        or the Proxmox Backup Server project page.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2 days agobump version to 8.3.0
Thomas Lamprecht [Mon, 18 Nov 2024 21:38:52 +0000 (22:38 +0100)]
bump version to 8.3.0

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 days agofix #5579: install: setup proxmox-first-boot service if enabled
Christoph Heiss [Mon, 18 Nov 2024 12:38:41 +0000 (13:38 +0100)]
fix #5579: install: setup proxmox-first-boot service if enabled

The auto-installer will place an executable file named
`proxmox-first-boot` in the installer runtime-directory if the user set
up.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2 days agofix #5579: auto-installer: add optional first-boot hook script
Christoph Heiss [Mon, 18 Nov 2024 12:38:40 +0000 (13:38 +0100)]
fix #5579: auto-installer: add optional first-boot hook script

Users can specifying an optional file - either fetched from an URL or
backed into the ISO - to execute on the first boot after the
installation, using the 'proxmox-first-boot' oneshot service.

Essentially adds an (optional) `[first-boot]` section to the answer
file. If specified, the `source` key must be at least set, which gives
the location of the hook script.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2 days agofix #5579: auto-install-assistant: enable baking in first-boot script
Christoph Heiss [Mon, 18 Nov 2024 12:38:39 +0000 (13:38 +0100)]
fix #5579: auto-install-assistant: enable baking in first-boot script

Adds a new parameter `--on-first-boot` to the `prepare-iso` command, to
specify a file to bake into the ISO.

To later use it with the auto-installer, the following must be set in
the answer file:

  [first-boot]
  source = "from-iso"

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2 days agofix #5579: setup: introduce 'first_boot' low-level installer options
Christoph Heiss [Mon, 18 Nov 2024 12:38:38 +0000 (13:38 +0100)]
fix #5579: setup: introduce 'first_boot' low-level installer options

.. to enable the setup of the 'proxmox-first-boot' service, as well as
optionally setting the ordering.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2 days agofix #5579: first-boot: add initial service packaging
Christoph Heiss [Mon, 18 Nov 2024 12:38:37 +0000 (13:38 +0100)]
fix #5579: first-boot: add initial service packaging

While there is the `systemd-first-boot.service`, it uses the
non-existence of `/etc/machine-id` as condition to run. As we already
set up that file in the installer ourselves, we cannot use that.

Instead our service depends on a custom flag file in
/var/lib/proxmox-first-boot and will only run if that is present.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
3 days agobump version to 8.2.8
Thomas Lamprecht [Sun, 17 Nov 2024 16:56:09 +0000 (17:56 +0100)]
bump version to 8.2.8

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 days agofetch-answer, post-hook: rename $format-info to $schema
Christoph Heiss [Fri, 15 Nov 2024 16:28:18 +0000 (17:28 +0100)]
fetch-answer, post-hook: rename $format-info to $schema

'schema' describes the purpose the of this object better and is a more
"industry-standard" term.

Changes it for both locations where we currently have such an object.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
5 days agoinstall: zfs: rename pre-existing `rpool` also if in degraded state
Christian Ebner [Fri, 15 Nov 2024 15:35:00 +0000 (16:35 +0100)]
install: zfs: rename pre-existing `rpool` also if in degraded state

If a subset of disks associated with a pre-existing ZFS pool are
selected for installation, the pool might still be importable
(required for the rename) but will be in a `degraded` state.
Currently, only pools in `online` state will be considered for
renameing, leading a possibly clashing pool named `rpool` behind.
Therefore, a reboot after installation will fail because of the
duplicate names.

To partially fix this behaviour, also rename `rpool` in `degraded`
state.

Note:
This however does not cover the case when a pool can no longer be
imported because the number of required replicas is not available.
Renaming by zpool import is not possible for that case.

Partially-fixes: 43591049 ("low-level: install: check for already-existing `rpool` on install")
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
5 days agoinstall: ask for patience when making system bootable
Christian Ebner [Fri, 15 Nov 2024 12:43:18 +0000 (13:43 +0100)]
install: ask for patience when making system bootable

Making the system bootable can take some time if many disks are used
for installation, which could be misinterpreted as a hanging
installer. Add a please be patient output when more than 3 disks are
used.

Output changes from `make system bootable` to
`make system bootable (please be patient)`

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
 [ TL: include hint for why user needs to be patient ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 days agoauto-installer: fix: add default value for partition-label
Christoph Heiss [Fri, 15 Nov 2024 10:32:34 +0000 (11:32 +0100)]
auto-installer: fix: add default value for partition-label

This ensure backwards-compatibility of older version of
proxmox-auto-install-assistant and newer ISOs/auto-installer version.

Otherwise, it fails with a "missing key `partition_label`" error on
start.

While proxmox-auto-install-assistant writes out that field by default
now, it will be missing for ISOs prepared with older versions of that
tool.

Fix it by providing a default label, such that it always has a sensible
value.

Fixes: 2e89c07 ("auto-install-assistant: add new parameter to specify partition label")
Reported-by: Timothy Nicholson <t.nicholson@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
6 days agobump version to 8.2.7
Thomas Lamprecht [Thu, 14 Nov 2024 20:57:07 +0000 (21:57 +0100)]
bump version to 8.2.7

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 days agoauto-install: rename 'posthook' to 'post-installation-webhook'
Thomas Lamprecht [Thu, 14 Nov 2024 20:53:48 +0000 (21:53 +0100)]
auto-install: rename 'posthook' to 'post-installation-webhook'

Webhooks are nowadays pretty clear in what they do generally, so the
updated name should paint a clearer picture about what this is about
and avoid confusion with a under-development feature that executes a
admin provided program after the installation on the target system,
which could be also seen as "posthook".

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 days agocommon: add function for issuing HTTP GET requests
Christoph Heiss [Wed, 13 Nov 2024 13:59:03 +0000 (14:59 +0100)]
common: add function for issuing HTTP GET requests

Factors out the user-agent building into a separate function and then
re-uses that for get().

This has the side-effect that now for all requests issued by post() a
timeout of 60s is applied. Previously, this was only done when an
explicit fingerprint was given. Minute change and shouldn't effect
anything.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 days agofetch-answer, post-hook: normalize key for meta info to '$format-info'
Thomas Lamprecht [Thu, 14 Nov 2024 20:01:20 +0000 (21:01 +0100)]
fetch-answer, post-hook: normalize key for meta info to '$format-info'

This is something that we should not change, and it might be good to
use similar semantics and naming for similar things, so use a generic
"$format-info" property to save the schema/meta information.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 days agofetch-answer: add `$fetchinfo` meta-field to HTTP POST payload
Christoph Heiss [Wed, 13 Nov 2024 09:06:36 +0000 (10:06 +0100)]
fetch-answer: add `$fetchinfo` meta-field to HTTP POST payload

This adds a metadata-field `$fetchinfo` containing a single key
`version` (for now) to the POST payload json, indicating which schema
version (and thus structure) this document uses.

The version field follows the format "<major>.<minor>" and applies
semantic versioning meaning for both the major and minor number. A patch
version is left out here, as it doesn't make much sense in this context.

Works in the same manner as the post-hook does it [0]. Useful to have it
for this too, as we might change/expand this structure too in the
future.

In the resulting JSON, this will look like this:
{
    "$fetchinfo": {
"version": "1.0"
    },
    "product": ..,
    ..
}

[0] https://lore.proxmox.com/pve-devel/20241112145405.929194-1-c.heiss@proxmox.com/

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
6 days agoassistant: avoid regex for simple prefix matching
Christoph Heiss [Thu, 14 Nov 2024 14:15:28 +0000 (15:15 +0100)]
assistant: avoid regex for simple prefix matching

udev properties are very easy to parse and can be done by doing a
line-based scan and matching the prefix, splitting once for properties.
Avoids the use of regexes and signicantly reduces binary size by about
-46%(!).

Tested by comparing the output of `proxmox-auto-install-assistant
device-info`, running it before and after the changes.

Stripped binary size for release builds:

  before: 3869304 bytes ~ 3.69MiB
  after:  2091608 bytes ~ 1.99MiB

   text    data     bss     dec     hex filename
3580692  280920     545 3862157  3aee8d assistant-before
2031252   52336     505 2084093  1fccfd assistant-after

No functional changes.

Reviewed-By: Aaron Lauterer <a.lauterer@proxmox.com>
Tested-By: Aaron Lauterer <a.lauterer@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
6 days agotree-wide: run rustfmt, fix clippy warnings
Christoph Heiss [Thu, 14 Nov 2024 14:15:27 +0000 (15:15 +0100)]
tree-wide: run rustfmt, fix clippy warnings

No functional changes.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
8 days agoassistant: pre-compile ignored block device patterns
Christoph Heiss [Mon, 13 May 2024 09:49:11 +0000 (11:49 +0200)]
assistant: pre-compile ignored block device patterns

No functional changes.

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>
8 days agopost-hook: add doc-comment to note versioning of struct
Thomas Lamprecht [Tue, 12 Nov 2024 15:54:02 +0000 (16:54 +0100)]
post-hook: add doc-comment to note versioning of struct

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 days agopost-hook: add `$hook` field describing document schema version
Christoph Heiss [Tue, 12 Nov 2024 14:53:59 +0000 (15:53 +0100)]
post-hook: add `$hook` field describing document schema version

This adds a metadata-field `$hook` containing a single key `version`
(for now) to the post-hook json, indicating which schema version (and
thus structure) this document uses.

In the resulting JSON, this will look like this:
{
    "$hook": {
"version": "1.0"
    },
    "debian-version": ..,
    ..
}

The field follows the format "<major>.<minor>" and applies semantic
versioning meaning for both the major and minor number. A patch version
is left out here, as it doesn't make much sense in this context.

This was suggested by Thomas when originally introducing the post-hook
functionality in [0].

[0] https://lore.proxmox.com/pve-devel/00019f8d-e4f2-420e-892a-b89e8b886748@proxmox.com/

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
8 days agotree-wide: add serde `derive` where actually needed
Christoph Heiss [Tue, 12 Nov 2024 12:49:08 +0000 (13:49 +0100)]
tree-wide: add serde `derive` where actually needed

Fixes building each crate on their own.

In a full build (e.g. `make deb`), everything pulls in serde with the
`derive` feature anyway and thus does not exihibit any build failures.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
8 days agotui: tests: fix reading ui messages from low-level installer
Christoph Heiss [Tue, 12 Nov 2024 12:48:17 +0000 (13:48 +0100)]
tui: tests: fix reading ui messages from low-level installer

This actually broke with commit 723afe2 - this patch was quite old
(18.10.2023) and these tests were introduced some time after sending it,
thus is not adjusted for it.

Fix itself is pretty simple, simply ignore non-JSON/invalid message from
the low-level installer, much like the actual progression code does it.

Fixes: 723afe2 ("run env: always re-create run env file in test mode")
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
9 days agorun env: always re-create run env file in test mode
Christoph Heiss [Wed, 18 Oct 2023 08:17:19 +0000 (10:17 +0200)]
run env: always re-create run env file in test mode

When debugging or otherwise deliberately running the `dump-env`
low-level installer command in test mode, chances are that you'd want
the run env file to be re-created as well.

No impact on the normal installation flow.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
9 days agounconfigured.sh: run proxmox-post-hook after successful auto-install
Christoph Heiss [Mon, 11 Nov 2024 13:15:08 +0000 (14:15 +0100)]
unconfigured.sh: run proxmox-post-hook after successful auto-install

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
9 days agofix #5536: post-hook: add utility for sending notifications after auto-install
Christoph Heiss [Mon, 11 Nov 2024 13:15:07 +0000 (14:15 +0100)]
fix #5536: post-hook: add utility for sending notifications after auto-install

This utility can be called with the low-level install config after a
successful installation to send a notification via a HTTP POST request,
if the user has configured an endpoint for that in the answer file.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
9 days agofix #5536: auto-installer: answer: add `posthook` section
Christoph Heiss [Mon, 11 Nov 2024 13:15:06 +0000 (14:15 +0100)]
fix #5536: auto-installer: answer: add `posthook` section

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
9 days agoauto-installer: udevinfo: introduce type alias for udev properties
Christoph Heiss [Mon, 11 Nov 2024 13:15:05 +0000 (14:15 +0100)]
auto-installer: udevinfo: introduce type alias for udev properties

Makes handling & passing them around a bit more convenient. Will be used
in the upcoming proxmox-post-hook utility.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
9 days agoauto-installer: answer: factor out answer file reading into function
Christoph Heiss [Mon, 11 Nov 2024 13:15:04 +0000 (14:15 +0100)]
auto-installer: answer: factor out answer file reading into function

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
9 days agoauto-installer: move `SystemDMI` struct to common crate
Christoph Heiss [Mon, 11 Nov 2024 13:15:03 +0000 (14:15 +0100)]
auto-installer: move `SystemDMI` struct to common crate

This functionality will be reused by the post-hook, which sends this
data as part of its information set.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
9 days agoauto-installer: tests: replace `PathBuf` parameters with `AsRef<Path>`
Christoph Heiss [Mon, 11 Nov 2024 13:15:02 +0000 (14:15 +0100)]
auto-installer: tests: replace `PathBuf` parameters with `AsRef<Path>`

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
9 days agoauto-installer: tests: simplify empty disks check
Christoph Heiss [Mon, 11 Nov 2024 13:15:01 +0000 (14:15 +0100)]
auto-installer: tests: simplify empty disks check

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
9 days agoauto-install-assistant: replace `PathBuf` parameters with `AsRef<Path>`
Christoph Heiss [Mon, 11 Nov 2024 13:15:00 +0000 (14:15 +0100)]
auto-install-assistant: replace `PathBuf` parameters with `AsRef<Path>`

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
9 days agotree-wide: convert some more crates to use workspace dependencies
Christoph Heiss [Mon, 11 Nov 2024 13:14:59 +0000 (14:14 +0100)]
tree-wide: convert some more crates to use workspace dependencies

No functional changes.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
9 days agofetch-answer: move http-related code to gated module in installer-common
Christoph Heiss [Mon, 11 Nov 2024 13:14:58 +0000 (14:14 +0100)]
fetch-answer: move http-related code to gated module in installer-common

This enable reusage of this code in other crates. Needed esp. by the
upcoming post-installation notification hook functionality.

No functional changes overall.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
9 days agodebian: strip unused library dependencies
Christoph Heiss [Mon, 11 Nov 2024 13:14:57 +0000 (14:14 +0100)]
debian: strip unused library dependencies

Rust links in some dynamic libraries even if only used by a disabled
feature gate.

This will be needed due to moving http-related code into the
proxmox-installer-common crate and thus pulling it in at more places.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
9 days agotest: add test for kernel commandline parsing
Christoph Heiss [Mon, 11 Nov 2024 11:05:17 +0000 (12:05 +0100)]
test: add test for kernel commandline parsing

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
9 days agolow level: config: filter out all installer-related kernel arguments
Christoph Heiss [Mon, 11 Nov 2024 11:05:16 +0000 (12:05 +0100)]
low level: config: filter out all installer-related kernel arguments

For one, include the auto-installer arguments, which weren't filtered
out before. Secondly, include the aliases as introduced in [0].

[0] de7f779 ("unconfigured: accept more telling boot cmdline option names")

Reported-by: Friedrich Weber <f.weber@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
9 days agolow level: config: filter out kernel cmdline on word boundaries
Christoph Heiss [Mon, 11 Nov 2024 11:05:15 +0000 (12:05 +0100)]
low level: config: filter out kernel cmdline on word boundaries

Otherwise, substrings might get replaced, e.g. the replacement
`proxmox-start-auto-installer` -> `pxmox-start-auto-installer` would be
done.

Fixes: a02a78a ("fix #4747: pass kernel cmdline parameters to target system")
Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
10 days agoproxinstall: expose arc size setting for zfs bootdisks for all products
Christoph Heiss [Wed, 14 Aug 2024 13:25:41 +0000 (15:25 +0200)]
proxinstall: expose arc size setting for zfs bootdisks for all products

For non-PVE products, simply use the ZFS defaults (aka. 50%) and leave
unset, if the user never touches that setting.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
10 days agotui: expose arc size setting for zfs bootdisks for all products
Christoph Heiss [Wed, 14 Aug 2024 13:25:40 +0000 (15:25 +0200)]
tui: expose arc size setting for zfs bootdisks for all products

For non-PVE products, simply use the ZFS defaults (aka. 50%) and leave
unset, if the user never touches that setting.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
10 days agotui: NumericEditView: add optional placeholder value
Christoph Heiss [Wed, 14 Aug 2024 13:25:39 +0000 (15:25 +0200)]
tui: NumericEditView: add optional placeholder value

Enables to add an optional placeholder value to `NumericEditView`, which
will be displayed in a different (darker) color and not returned by
`.get_content*()`.

Can be used for having default values in the TUI, but with different
handling in the back.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
10 days agotest: ui2-stdio: fix multi-process testing
Christoph Heiss [Thu, 16 May 2024 13:39:31 +0000 (15:39 +0200)]
test: ui2-stdio: fix multi-process testing

Previously, if something failed in the child, the overall test would
still be successful and exit with `0`.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
10 days agobuildsys: run lintian on auto-install-assistant package
Christoph Heiss [Fri, 16 Aug 2024 16:05:24 +0000 (18:05 +0200)]
buildsys: run lintian on auto-install-assistant package

Seems like this was simply forgotten when that package was introduced.
Rectify that.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
10 days agofix #5250: auto-installer: expose new btrfs `compress` option
Christoph Heiss [Tue, 13 Aug 2024 16:15:34 +0000 (18:15 +0200)]
fix #5250: auto-installer: expose new btrfs `compress` option

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
10 days agofix #5250: tui: expose new btrfs `compress` option
Christoph Heiss [Tue, 13 Aug 2024 16:15:33 +0000 (18:15 +0200)]
fix #5250: tui: expose new btrfs `compress` option

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
10 days agofix #5250: proxinstall: expose new btrfs `compress` option
Christoph Heiss [Tue, 13 Aug 2024 16:15:32 +0000 (18:15 +0200)]
fix #5250: proxinstall: expose new btrfs `compress` option

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
10 days agofix #5250: install: write btrfs `compress` option to fstab
Christoph Heiss [Tue, 13 Aug 2024 16:15:31 +0000 (18:15 +0200)]
fix #5250: install: write btrfs `compress` option to fstab

`compress` instead of `compress-force` is used, as the latter can have
unindented (performance) implications, as the name implies. That would
be neither expected by users nor should such a decision made without the
user explicitly opting for it.

Others do the same, e.g. the installer for RedHat/Fedora systems (aka.
Anaconda) opts for `compress` too.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
10 days agofix #5250: install: config: add new `btrfs_opts` with `compress` config option
Christoph Heiss [Tue, 13 Aug 2024 16:15:30 +0000 (18:15 +0200)]
fix #5250: install: config: add new `btrfs_opts` with `compress` config option

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
10 days agocommon: setup: serialize `target_hd` as string explicitly
Christoph Heiss [Wed, 21 Aug 2024 09:40:07 +0000 (11:40 +0200)]
common: setup: serialize `target_hd` as string explicitly

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
10 days agocommon: simplify filesystem type serializing & Display trait impl
Christoph Heiss [Wed, 21 Aug 2024 09:40:06 +0000 (11:40 +0200)]
common: simplify filesystem type serializing & Display trait impl

Implements the proper de-/serializer directly on the type and then
use serde_plain::derive_display_from_serialize where applicable, instead
of separate serializer functions somewhere else.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
10 days agocommon: http: pass url by reference
Christoph Heiss [Wed, 21 Aug 2024 09:40:10 +0000 (11:40 +0200)]
common: http: pass url by reference

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
10 days agocommon: setup: deserialize `secure_boot` property from runtime env
Christoph Heiss [Wed, 21 Aug 2024 09:40:09 +0000 (11:40 +0200)]
common: setup: deserialize `secure_boot` property from runtime env

Needed for the post-hook functionality, which sends this information as
part of its information set.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
10 days agocommon: split out installer setup files loading functionality
Christoph Heiss [Wed, 21 Aug 2024 09:40:08 +0000 (11:40 +0200)]
common: split out installer setup files loading functionality

This allows re-using this piece of code in e.g. the post hook, instead
of having to open-code it there.

No functional changes.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
10 days agolow level: run env: ensure `secure_boot` property is dumped as int
Christoph Heiss [Wed, 21 Aug 2024 09:40:05 +0000 (11:40 +0200)]
low level: run env: ensure `secure_boot` property is dumped as int

Previously, in the "false" case, it would serialize to an empty string.
In the future this property will be deserialized by (type-safe) Rust
code.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
10 days agofetch-answer: partition: fix clippy warning
Christoph Heiss [Wed, 21 Aug 2024 09:40:04 +0000 (11:40 +0200)]
fetch-answer: partition: fix clippy warning

warning: the borrowed expression implements the required traits
  --> proxmox-fetch-answer/src/fetch_plugins/partition.rs:34:44
   |
34 |     let path = Path::new(search_path).join(&file_name);
   |                                            ^^^^^^^^^^ help: change this to: `file_name`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
   = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
10 days agotree-wide: fix some typos
Christoph Heiss [Wed, 21 Aug 2024 09:40:03 +0000 (11:40 +0200)]
tree-wide: fix some typos

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
10 days agofetch-answer: use partition label from fetch config instead of hardcoded
Christoph Heiss [Fri, 8 Nov 2024 13:05:36 +0000 (14:05 +0100)]
fetch-answer: use partition label from fetch config instead of hardcoded

This has been requested by at least one user one user [0] and definitely
makes sense, esp. for BMCs/IPMIs where one might not be able to control
the partition label.

[0] https://forum.proxmox.com/threads/proxmox-ais-question-request.153043/post-695689

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Tested-By: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-By: Aaron Lauterer <a.lauterer@proxmox.com>
10 days agofetch-answer: partition: also search for exact-matching partition label
Christoph Heiss [Fri, 8 Nov 2024 13:05:35 +0000 (14:05 +0100)]
fetch-answer: partition: also search for exact-matching partition label

While some filesystems - such as FAT(32) - might not supported/allow
mixed-case labels, some implementations still handle them correctly,
such as Linux. Thus, also search for that variant.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Tested-By: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-By: Aaron Lauterer <a.lauterer@proxmox.com>
10 days agofetch-answer: refactor cli argument parsing
Christoph Heiss [Fri, 8 Nov 2024 13:05:34 +0000 (14:05 +0100)]
fetch-answer: refactor cli argument parsing

Clean up the actual parsing a bit to make it more easily extensible, and
add a proper help menu.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Tested-By: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-By: Aaron Lauterer <a.lauterer@proxmox.com>
10 days agoauto-install-assistant: add new parameter to specify partition label
Christoph Heiss [Fri, 8 Nov 2024 13:05:33 +0000 (14:05 +0100)]
auto-install-assistant: add new parameter to specify partition label

.. for the 'partition' fetch method.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Tested-By: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-By: Aaron Lauterer <a.lauterer@proxmox.com>
10 days agoinstaller-common: do not drop nomodeset from target kernel cmdline
Stoiko Ivanov [Wed, 30 Oct 2024 09:59:24 +0000 (10:59 +0100)]
installer-common: do not drop nomodeset from target kernel cmdline

dropping the `nomodeset` here makes little sense:
* currently users need to explicitly add it when booting the kernel,
  which is probably only done when the system needs it to show any
  output when booting
* it was originally removed, because the installer had a grub-entry
  that explicitly disabled it - and the reasoning was to remove
  everything installer-specific - but I assume that it should cause
  less problems to keep it in place in all cases.

This was also partially pointed to in:
https://bugzilla.proxmox.com/show_bug.cgi?id=4230#c38

Fixes: a02a78a865fc37f7bdea077a4421319b84c635c9
Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
10 days agoproxinstall: use email regex from HTML specification for validation
Christoph Heiss [Wed, 2 Oct 2024 12:27:28 +0000 (14:27 +0200)]
proxinstall: use email regex from HTML specification for validation

That regex should be a lot more accurate in what it allows - if it's
good enough for the HTML spec, it should be for us too.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
10 days agoauto-installer: validate `global.mailto` answer option
Christoph Heiss [Wed, 2 Oct 2024 12:27:27 +0000 (14:27 +0200)]
auto-installer: validate `global.mailto` answer option

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
10 days agotui: use email regex from HTML specification for validation
Christoph Heiss [Wed, 2 Oct 2024 12:27:26 +0000 (14:27 +0200)]
tui: use email regex from HTML specification for validation

That regex should be a lot more accurate in what it allows - if it's
good enough for the HTML spec, it should be for us too.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
10 days agoauto-installer: print full anyhow message on failure
Christoph Heiss [Wed, 2 Oct 2024 12:27:25 +0000 (14:27 +0200)]
auto-installer: print full anyhow message on failure

Otherwise, context info is simply lost -- which might contain valuable
information for the user.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
10 days agoauto-installer: drop some unneeded `pub` modifiers
Christoph Heiss [Wed, 2 Oct 2024 12:27:24 +0000 (14:27 +0200)]
auto-installer: drop some unneeded `pub` modifiers

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
10 days agotui: fix new clippy lint
Christoph Heiss [Wed, 2 Oct 2024 12:27:23 +0000 (14:27 +0200)]
tui: fix new clippy lint

warning: unnecessary hashes around raw string literal
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_raw_string_hashes
   = note: `#[warn(clippy::needless_raw_string_hashes)]` on by default

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
10 days agocargo: convert `anyhow` to workspace dependency
Christoph Heiss [Wed, 2 Oct 2024 12:27:22 +0000 (14:27 +0200)]
cargo: convert `anyhow` to workspace dependency

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
3 weeks agoinstaller-common: throw setup error if no network interfaces were found
Christoph Heiss [Thu, 24 Oct 2024 09:00:43 +0000 (11:00 +0200)]
installer-common: throw setup error if no network interfaces were found

We do that check already in the GUI, so add it for TUI (and by
extension, the auto-installer) too.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Tested-By: Aaron Lauterer <a.lauterer@proxmox.com>
3 weeks agotui: show background header on fatal setup error
Christoph Heiss [Thu, 24 Oct 2024 09:00:42 +0000 (11:00 +0200)]
tui: show background header on fatal setup error

This was missing, as it was only applied for the main installation UI -
the setup error has its own screen setup codepath entirely.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Tested-By: Aaron Lauterer <a.lauterer@proxmox.com>
3 months agodebian: bump cursive to 0.21
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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
3 months 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>
4 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>
4 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>
4 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>
4 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>