Commit Graph

145 Commits

Author SHA1 Message Date
Christoph Heiss
17f3ff2268 add preliminary pdm support
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Co-authored-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-12-16 20:39:33 +01:00
Christoph Heiss
dc401eb3f0 country.pl: generate final structure as json at build time directly
Currently, we generate a custom-format `country.dat` at build time,
which we then ship with the installer. In the live environment, this
then gets parsed (via regexes) into another format and is finally
written out as JSON for e.g. the TUI and auto-installer to consume.

Instead, skip the intermediate format completely and just generate the
final data structure as JSON at build time.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2024-12-10 18:00:24 +01:00
Christoph Heiss
6784451d32 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>
2024-11-18 22:29:23 +01:00
Christoph Heiss
4be9eb381f 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>
2024-11-11 18:20:19 +01:00
Christoph Heiss
368a3215b6 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>
2024-11-10 19:44:36 +01:00
Thomas Lamprecht
d6b9b8ecee split out assistant CLI tool into own debian package
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-04-22 14:31:37 +02:00
Thomas Lamprecht
2721bd70eb rename proxmox-autoinst-helper to proxmox-auto-install-assistant
stay on the verbose side

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-04-22 14:31:37 +02:00
Aaron Lauterer
1e79b3f1a4 add proxmox-chroot utility
it is meant as a helper utility to prepare an installation for chroot
and clean up afterwards

It tries to determine the used FS from the previous installation, will
do what is necessary to mount/import the root FS to /target. It then
will set up all bind mounts.

Tested-by: Christoph Heiss <c.heiss@proxmox.com>
Reviewed-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-04-22 14:31:37 +02:00
Aaron Lauterer
eedc6521ce auto installer: factor out fetch-answer and autoinst-helper
Putting proxmox-fetch-answer into it's own crate, will keep the use of
OpenSSL localized to where we need it. Otherwise building other binaries
will always depend on OpenSSL as well, even without actually needing it.

Having a dedicated crate for the proxmox-autoinst-helper should make it
easier to build it independently to have it available outside of the
install environment.

The fetch plugins have been moved to the proxmox-fetch-answer crate,
except for the 'get_nic_list' function and 'sysinfo.rs'. Since both are
also needed by the proxmox-autoinst-helper, they are kept in the
proxmox-auto-installer crate.

Tested-by: Christoph Heiss <c.heiss@proxmox.com>
Reviewed-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-04-22 14:31:37 +02:00
Aaron Lauterer
9143507da2 auto-installer: add proxmox-autoinst-helper tool
It can parse an answer file to check against syntax errors, test match
filters against the current hardware and list properties of the current
hardware to match against.

Since this tool should be able to run outside of the installer
environment, it does not rely on the device information provided by the
low-level installer. It instead fetches the list of disks and NICs by
itself.
The rules when a device is ignored, should match how the low-level
installer handles it.

Tested-by: Christoph Heiss <c.heiss@proxmox.com>
Reviewed-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-04-22 14:31:37 +02:00
Aaron Lauterer
2949f82539 auto-installer: add fetch answer binary
it is supposed to be run first and fetch an answer file.

The initial implementation searches for a partition/filesystem called
'proxmoxinst' or 'PROXMOXINST' with an 'answer.toml' file in the root
directory.

Once it has an answer file, it will call the 'proxmox-auto-installer'
and pipe in the contents via stdin.

Tested-by: Christoph Heiss <c.heiss@proxmox.com>
Reviewed-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-04-22 14:31:37 +02:00
Aaron Lauterer
781f879edc auto-installer: add auto-installer binary
It expects the contents of an answer file via stdin. It will then be
parsed and the JSON for the low level installer is generated.

It then calls the low level installer directly.
The output of the installaton progress is kept rather simple for now.

If configured in the answer file, commands will be run pre and post the
low level installer.

It also logs everything to the logfile, currently
'/tmp/auto_installer.log'.

Tested-by: Christoph Heiss <c.heiss@proxmox.com>
Reviewed-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-04-22 14:31:37 +02:00
Aaron Lauterer
c7edc2e1d8 add auto-installer crate
The new auto-installer is intended for unattended installations and
should be especially helpful for users with frequent and/or big
installations.

The main idea is that a answer file is provided by some mechanism,
e.g., on the ISO itself, on a separate (USB pen drive) partition, or
the network, which holds a somewhat generic config in form of a TOML
file that also supports wildcard glob'ing for selecting, e.g., target
disks for flexibility.

This is a initial implementation that will be improved and extended
over the next commits.

The installation config is currently generated through a dedicated
function (parse_answer) instead of a From implementation. This is
because for now the source data is spread over several other structs
in comparison to one in the TUI installer.

Logging is done to both stdout and a dedicated log file.

Tested-by: Christoph Heiss <c.heiss@proxmox.com>
Reviewed-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
 [ TL: Squash initial "build-up" patches ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-04-22 14:31:37 +02:00
Christoph Heiss
126379f614 build: run shellcheck as part of test step
Especially unconfigured.sh is worth checking consistently.

Running shellcheck also does not really have any notable impact on build
time, so no downside there either.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2024-03-22 11:38:50 +01:00
Christoph Heiss
0fb71c2c21 buildsys: setup proper test environment for testsuite
Some test to come will need a proper environment.

`prepare-test-env` can also be generally useful while developing to
quickly set up a new test environment as needed.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2024-02-24 18:00:17 +01:00
Aaron Lauterer
1458d7a203 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>
2024-02-06 15:27:11 +01:00
Christoph Heiss
4b4dfa12e0 low level: testmode: take path to disk image instead of using /dev/null
.. in exactly the same way GUI and TUI installer do, streamlining them.

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

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-09 14:44:51 +01:00
Christoph Heiss
9a0d66cb36 test: add tests for zfs_arc_max calculations
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-11-07 16:40:15 +01:00
Aaron Lauterer
2f65a616d3 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>
2023-11-02 20:04:02 +01:00
Thomas Lamprecht
9ed182696c buildsys: redirect stderr of TUI in check targets
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-10-19 14:19:51 +02:00
Christoph Heiss
a199276f6a d/rules: enable dh_auto_test
Since we now have a test suite (or, at least the TUI installer in this
case), we can enable dh_auto_test so that it will be run on package
builds.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-07-25 11:19:31 +02:00
Thomas Lamprecht
0a48c149be buildsys: copy over .cargo config directory to build-dir
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-26 19:23:26 +02:00
Thomas Lamprecht
ce76d4c0a1 buildsys: add check-pbs-tui target
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-26 19:06:58 +02:00
Thomas Lamprecht
7e569bd6cd buildsys: add check-pmg-tui target
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-26 19:05:50 +02:00
Thomas Lamprecht
63fb95ea37 buildsys: dump environment in all test cases
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-21 16:38:49 +02:00
Thomas Lamprecht
2630cca401 write out install config as json on ack step for debugging
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-20 12:04:02 +02:00
Thomas Lamprecht
5a947984a5 buildsys: fix clean target
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-20 07:54:31 +02:00
Thomas Lamprecht
0889f35dcf buildsys: add prerequisites to compiled binaries target
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-19 15:08:03 +02:00
Thomas Lamprecht
63ce0b1a09 buildsys: avoid copying over build dir and debs on test-deb target
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-19 15:08:03 +02:00
Thomas Lamprecht
0190a2994a buildsys: add DSC & sbuild convenience target
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-19 15:08:03 +02:00
Thomas Lamprecht
59597871f7 buildsys: use better defined clean target
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-19 15:08:03 +02:00
Thomas Lamprecht
2d5382e86a buildsys: expand clean target
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-19 15:08:03 +02:00
Thomas Lamprecht
99f0b52331 makefile: convert to use simple parenthesis
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-19 14:18:14 +02:00
Thomas Lamprecht
0cf4be7de4 buildsys: add check-pve-tui target
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-19 13:38:56 +02:00
Thomas Lamprecht
6ec8d1636a use separate faster and incremental DEB build for check targets
Faster as lintian isn't called on the resulting package and
incremental, as the no-pre-clean (-nc) flag is passed to build
package.

This is mostly relevant since the rust based TUI prototype got added
to packaging, as those needs quite a bit longer compared to copying
perl module files.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-19 12:19:37 +02:00
Thomas Lamprecht
aee9344c83 package rust based TUI installer prototype
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-19 12:19:37 +02:00
Thomas Lamprecht
9cdfeefcb1 buildsys: use full DEB_VERSION
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-19 12:19:37 +02:00
Wolfgang Bumiller
497be1a7ff Merge remote-tracking branch 'cheiss/tui-installer' into tui 2023-06-16 11:50:13 +02:00
Thomas Lamprecht
413ca90b02 buildsys: create complete cd-info for test
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-16 07:48:27 +02:00
Christoph Heiss
e70f1b2fed tui: pass Cursive instance to installer view constructors
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-06-14 10:39:56 +02:00
Thomas Lamprecht
29f3240613 buildsys: allow generating cd-info.test file without check targets too
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-14 10:27:59 +02:00
Thomas Lamprecht
e23aeee4fa buildsys: derive upload dist automatically
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-09 09:36:58 +02:00
Thomas Lamprecht
f352163314 buildsys: depend on full known-to-git file list for installer sources
basically only used for change-tracking on what targets to rebuild,
so avoid the need to have the list here duplicated, most files known
to git are installer files

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-09 09:36:58 +02:00
Thomas Lamprecht
fc2c6d3e63 buildsys: make country.dat generation atomic
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-09 09:36:58 +02:00
Thomas Lamprecht
ab97da2c0d move ProxmoxInstallerSetup to Proxmox::Install::Setup
in preparation of splitting out more code

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-09 09:36:58 +02:00
Thomas Lamprecht
4a96f4720c buildsys: multi disk check: add bigger fifth disk
to allow testing heterogeneous setups more easily.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-04-20 13:10:57 +02:00
Thomas Lamprecht
bb2c578e35 buildsys: make package also depend on ProxmoxInstallerSetup module
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-23 14:39:49 +02:00
Thomas Lamprecht
cac97de3d6 buildsys: fix upload targets package variable
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-15 15:08:16 +02:00
Thomas Lamprecht
029fde309b restructure html in repo and installed package
placing the common stuff top-level and the per-product stuff one
directory-level down allows to access all used resources (css,
images) from a common base path without hacking to much around.

Per-product files are always preferred.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-25 19:49:39 +02:00
Thomas Lamprecht
c9b46f9001 buildsys: better clean
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-25 19:49:39 +02:00