Commit Graph

12 Commits

Author SHA1 Message Date
Aaron Lauterer
74e54c4d8d low-level: add dump-udev command
Fetches UDEV device properties prepended with 'E:' for NICs and disks.
The result is stored in its own JSON file.

This information is needed to filter for specific devices. Mainly for
the auto-installer for now.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Co-authored-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
 [ TL: rework Udev module to avoid external dependencies, keep those
   in the Sys modules ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-04-22 14:31:37 +02:00
Thomas Lamprecht
07b8e08370 sys/net: drop module path from local FQDN regex variable
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-04-22 14:31:37 +02:00
Christoph Heiss
f6bea065f7 fix #5230: sys: net: properly escape FQDN regex
Due to interpolation, the \. sequence must be double-escaped.
Previously, this would result in a non-escaped dot, thus matching much
more liberally than it should.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
 [ TL: fix bug # reference in code comments ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-02-23 17:28:54 +01:00
Christoph Heiss
1a5665378b sys: net: do not allow overlong FQDNs as per RFCs and Debian spec
Debian limits labels to 63 characters each and the total length to 253
characters [0].

[0] https://manpages.debian.org/stable/manpages/hostname.7.en.html

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2024-02-23 16:40:04 +01:00
Christoph Heiss
93892c0188 proxinstall: avoid open-coding FQDN sanity check
.. by moving it into its own subroutine. Makes the whole thing quite a
bit neater and easier to maintain.

No functional changes.

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

Minimally tested on a VM.

Fixes: bda1cdf ("run env: retrieve and store hostname from DHCP lease
 if available")
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2023-11-17 06:25:43 +01:00
Christoph Heiss
bda1cdf699 run env: retrieve and store hostname from DHCP lease if available
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-10-20 12:31:22 +02:00
Christoph Heiss
18f58123e8 net: move hostname/fqdn regexes into common code
Such that they can be re-used by other parts.
No functional changes.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-10-20 12:31:22 +02:00
Thomas Lamprecht
7d53c80701 critic: avoid $a, $b special package variables
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-22 07:35:56 +02:00
Thomas Lamprecht
fe06d7e94f move ipconf into run-env
This adds some duplication there, but much safer than restructuring
stuff at this point in time, we can deal with unification later.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-20 16:00:47 +02:00
Thomas Lamprecht
625e8f60ee factor out network parser and sys-info helpers
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-09 09:36:58 +02:00