[pve-devel] [PATCH installer 3/5] proxinstall: use hostname from run env if available

Christoph Heiss c.heiss at proxmox.com
Fri Oct 20 11:46:46 CEST 2023


This now tries to use the hostname from the DHCP lease if it was set,
falling back to the product name as before.

Signed-off-by: Christoph Heiss <c.heiss at proxmox.com>
---
 proxinstall | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/proxinstall b/proxinstall
index 88f194f..4d61fa7 100755
--- a/proxinstall
+++ b/proxinstall
@@ -402,9 +402,11 @@ sub create_ipconf_view {
     $vbox->pack_start($devicebox, 0, 0, 2);
 
     my $fqdn = Proxmox::Install::Config::get_fqdn();
-    my $hn = $fqdn // "$iso_env->{product}." . ($ipconf->{domain} // "example.invalid");
+    my $hostname = $run_env->{network}->{hostname} || $iso_env->{product};
+    my $domain = $ipconf->{domain} || "example.invalid";
+    $fqdn //= "$hostname.$domain";
 
-    my ($hostbox, $hostentry) = create_text_input($hn, 'Hostname (FQDN):');
+    my ($hostbox, $hostentry) = create_text_input($fqdn, 'Hostname (FQDN):');
     $vbox->pack_start($hostbox, 0, 0, 2);
 
     $vbox->pack_start($cidr_box, 0, 0, 2);
-- 
2.42.0






More information about the pve-devel mailing list