$ENV{'LVM_SUPPRESS_FD_WARNINGS'} = '1';
-my $env = Proxmox::Install::ISOEnv::setup();
+my $iso_env = Proxmox::Install::ISOEnv::setup();
my $zfstestpool = "test_rpool";
my $zfspoolname = is_test_mode() ? $zfstestpool : 'rpool';
-my $zfsrootvolname = "$env->{product}-1";
+my $zfsrootvolname = "$iso_env->{product}-1";
my $storage_cfg_zfs = <<__EOD__;
dir: local
Proxmox::Log::init("/tmp/install.log");
-my $proxmox_libdir = $env->{locations}->{lib};
-my $proxmox_cddir = $env->{locations}->{iso};
+my $proxmox_libdir = $iso_env->{locations}->{lib};
+my $proxmox_cddir = $iso_env->{locations}->{iso};
my $proxmox_pkgdir = "${proxmox_cddir}/proxmox/packages/";
my $boot_type = -d '/sys/firmware/efi' ? 'efi' : 'bios';
$config_options->{minfree} = $1;
}
-if ($env->{product} eq 'pve') {
+if ($iso_env->{product} eq 'pve') {
if ($cmdline =~ m/maxvz=(\d+(\.\d+)?)[\s\n]/i) {
$config_options->{maxvz} = $1;
}
syscmd("zfs create $zfspoolname/ROOT") == 0 ||
die "unable to create zfs $zfspoolname/ROOT volume\n";
- if ($env->{product} eq 'pve') {
+ if ($iso_env->{product} eq 'pve') {
syscmd("zfs create $zfspoolname/data") == 0 ||
die "unable to create zfs $zfspoolname/data volume\n";
}
sub create_lvm_volumes {
my ($lvmdev, $os_size, $swap_size) = @_;
- my $vgname = $env->{product};
+ my $vgname = $iso_env->{product};
ask_existing_vg_rename_or_abort($vgname);
my $rootsize;
my $datasize = 0;
- if ($env->{product} eq 'pve') {
+ if ($iso_env->{product} eq 'pve') {
my $maxroot_mb;
if ($config_options->{maxroot}) {
syscmd("/sbin/lvconvert --yes --type thin-pool --poolmetadatasize ${metadatasize}K $vgname/data") == 0 ||
die "unable to create data thin-pool\n";
} else {
- if ($env->{product} eq 'pve' && !defined($config_options->{maxvz})) {
+ if ($iso_env->{product} eq 'pve' && !defined($config_options->{maxvz})) {
Proxmox::UI::message("Skipping auto-creation of LVM thinpool for guest data due to low space.");
}
$datadev = undef;
mkdir "$targetdir/var";
mkdir "$targetdir/var/lib";
- if ($env->{product} eq 'pve') {
+ if ($iso_env->{product} eq 'pve') {
mkdir "$targetdir/var/lib/vz";
mkdir "$targetdir/var/lib/pve";
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size) = stat ($basefile);
$ino || die "unable to open file '$basefile' - $!\n";
- my $files = file_read_firstline("${proxmox_cddir}/proxmox/$env->{product}-base.cnt") ||
+ my $files = file_read_firstline("${proxmox_cddir}/proxmox/$iso_env->{product}-base.cnt") ||
die "unable to read base file count\n";
my $per = 0;
my $ethdev = $ipconf->{ifaces}->{$ipconf->{selected}}->{name};
- if ($env->{cfg}->{bridged_network}) {
+ if ($iso_env->{cfg}->{bridged_network}) {
$ifaces .= "iface $ethdev $ntype manual\n";
$ifaces .=
}
# Note: keyboard-configuration/xbkb-keymap is used by console-setup
- my $xkmap = $env->{locales}->{kmap}->{$keymap}->{x11} // 'us';
+ my $xkmap = $iso_env->{locales}->{kmap}->{$keymap}->{x11} // 'us';
debconfig_set ($targetdir, <<_EOD);
locales locales/default_environment_locale select en_US.UTF-8
file_write_all("$targetdir/etc/timezone", "$timezone\n");
# set apt mirror
- if (my $mirror = $env->{locales}->{country}->{$country}->{mirror}) {
+ if (my $mirror = $iso_env->{locales}->{country}->{$country}->{mirror}) {
my $fn = "$targetdir/etc/apt/sources.list";
syscmd("sed -i 's/ftp\\.debian\\.org/$mirror/' '$fn'");
}
# allow ssh root login
syscmd(['sed', '-i', 's/^#\?PermitRootLogin.*/PermitRootLogin yes/', "$targetdir/etc/ssh/sshd_config"]);
- if ($env->{product} eq 'pmg') {
+ if ($iso_env->{product} eq 'pmg') {
# install initial clamav DB
my $srcdir = "${proxmox_cddir}/proxmox/clamav";
foreach my $fn ("main.cvd", "bytecode.cvd", "daily.cvd", "safebrowsing.cvd") {
die "unable to set owner for clamav database files\n";
}
- if ($env->{product} eq 'pve') {
+ if ($iso_env->{product} eq 'pve') {
# save installer settings
my $ucc = uc ($country);
debconfig_set($targetdir, "pve-manager pve-manager/country string $ucc\n");
run_command("chroot $targetdir /usr/sbin/chpasswd", undef,
"root:$octets\n");
- if ($env->{product} eq 'pmg') {
+ if ($iso_env->{product} eq 'pmg') {
# save admin email
file_write_all("$targetdir/etc/pmg/pmg.conf", "section: admin\n\temail ${mailto}\n");
- } elsif ($env->{product} eq 'pve') {
+ } elsif ($iso_env->{product} eq 'pve') {
# create pmxcfs DB
mkdir $tmpdir;
# write vnc keymap to datacenter.cfg
- my $vnckmap = $env->{locales}->{kmap}->{$keymap}->{kvm} || 'en-us';
+ my $vnckmap = $iso_env->{locales}->{kmap}->{$keymap}->{kvm} || 'en-us';
file_write_all("$tmpdir/datacenter.cfg", "keyboard: $vnckmap\n");
# save admin email
run_command("chroot $targetdir /usr/bin/create_pmxcfs_db /tmp/pve /var/lib/pve-cluster/config.db");
syscmd("rm -rf $tmpdir");
- } elsif ($env->{product} eq 'pbs') {
+ } elsif ($iso_env->{product} eq 'pbs') {
my $base_cfg_path = "/etc/proxmox-backup";
mkdir "$targetdir/$base_cfg_path";
my $vbox = Gtk3::Box->new('vertical', 0);
- my $logofn = "$env->{product}-banner.png";
+ my $logofn = "$iso_env->{product}-banner.png";
my $image = Gtk3::Image->new_from_file("${proxmox_libdir}/$logofn");
my $provider = Gtk3::CssProvider->new();
$gtk_state->{progress_bar} = Gtk3::ProgressBar->new();
$gtk_state->{progress_status} = Gtk3::Label->new('');
- Proxmox::UI::init_gtk($gtk_state, $env);
+ Proxmox::UI::init_gtk($gtk_state, $iso_env);
$window->show_all;
$window->present();
$vbox->pack_start($devicebox, 0, 0, 2);
- my $hn = $config->{fqdn} // "$env->{product}." . ($ipconf->{domain} // "example.invalid");
+ my $hn = $config->{fqdn} // "$iso_env->{product}." . ($ipconf->{domain} // "example.invalid");
my ($hostbox, $hostentry) = create_text_input($hn, 'Hostname (FQDN):');
$vbox->pack_start($hostbox, 0, 0, 2);
$vbox->pack_start($reboot_checkbox, 0, 0, 2);
my $ack_template = "${proxmox_libdir}/html/ack_template.htm";
- my $ack_html = "${proxmox_libdir}/html/$env->{product}/$steps[$step_number]->{html}";
+ my $ack_html = "${proxmox_libdir}/html/$iso_env->{product}/$steps[$step_number]->{html}";
my $html_data = file_read_all($ack_template);
my %config_values = (
__target_hd__ => join(' | ', @{$config_options->{target_hds}}),
__target_fs__ => $config_options->{filesys},
- __country__ => $env->{locales}->{country}->{$country}->{name},
+ __country__ => $iso_env->{locales}->{country}->{$country}->{name},
__timezone__ => $timezone,
__keymap__ => $keymap,
__mailto__ => $mailto,
my $ind;
my $def;
my $i = 0;
- my $kmaphash = $env->{locales}->{kmaphash};
+ my $kmaphash = $iso_env->{locales}->{kmaphash};
foreach my $layout (sort keys %$kmaphash) {
$def = $i if $kmaphash->{$layout} eq 'en-us';
$ind = $i if $kmap && $kmaphash->{$layout} eq $kmap;
$timezone = $cb->get_active_text();
});
- my ($cczones, $zones) = $env->{locales}->@{'cczones', 'zones'};
+ my ($cczones, $zones) = $iso_env->{locales}->@{'cczones', 'zones'};
my @available_zones = $cc && defined($cczones->{$cc}) ? keys %{$cczones->{$cc}} : keys %$zones;
my ($i, $selected_index) = (0, undef);
cleanup_view();
- my $locales = $env->{locales};
+ my $locales = $iso_env->{locales};
my $vbox2 = Gtk3::Box->new('vertical', 0);
$gtk_state->{inbox}->pack_start($vbox2, 1, 0, 0);
'zfs (RAIDZ-3)',
];
push @$fstype, 'btrfs (RAID0)', 'btrfs (RAID1)', 'btrfs (RAID10)'
- if $env->{cfg}->{enable_btrfs};
+ if $iso_env->{cfg}->{enable_btrfs};
my $tcount = 0;
foreach my $tmp (@$fstype) {
push @$hdsize_labeled_widgets, "swapsize", $entry_swapsize;
my $entry_maxroot = Gtk3::Entry->new();
- if ($env->{product} eq 'pve') {
+ if ($iso_env->{product} eq 'pve') {
$entry_maxroot->set_tooltip_text("maximum size (GB) for LVM root volume");
$entry_maxroot->signal_connect (key_press_event => \&check_float);
$entry_maxroot->set_text($config_options->{maxroot}) if $config_options->{maxroot};
push @$hdsize_labeled_widgets, "minfree", $entry_minfree;
my $entry_maxvz;
- if ($env->{product} eq 'pve') {
+ if ($iso_env->{product} eq 'pve') {
$entry_maxvz = Gtk3::Entry->new();
$entry_maxvz->set_tooltip_text("maximum size (GB) for LVM data volume");
$entry_maxvz->signal_connect (key_press_event => \&check_float);
if ($raid) {
my $msg = "<b>Note</b>: " . ($is_zfs
? "ZFS is not compatible with hardware RAID controllers, for details see the documentation."
- : "BTRFS integration in $env->{cfg}->{fullname} is a technology preview!"
+ : "BTRFS integration in $iso_env->{cfg}->{fullname} is a technology preview!"
);
$hw_raid_note->set_markup($msg);
}
my $tdir = is_test_mode() ? "target" : "/target";
mkdir $tdir;
- my $base = "${proxmox_cddir}/$env->{product}-base.squashfs";
+ my $base = "${proxmox_cddir}/$iso_env->{product}-base.squashfs";
eval { extract_data($base, $tdir); };
my $err = $@;
set_next("_Reboot", sub { app_quit(0); } );
my $success_transform = sub {
- my ($raw_html, $env) = @_;
+ my ($raw_html, $iso_env) = @_;
my $addr = $ipversion == 6 ? "[${ipaddress}]" : "$ipaddress";
$raw_html =~ s/__IPADDR__/$addr/g;
- $raw_html =~ s/__PORT__/$env->{cfg}->{port}/g;
+ $raw_html =~ s/__PORT__/$iso_env->{cfg}->{port}/g;
my $autoreboot_msg = $config_options->{autoreboot}
? "Automatic reboot scheduled in $autoreboot_seconds seconds."
if (int($total_memory) < 1024) {
Proxmox::UI::error("Less than 1 GiB of usable memory detected, installation will probably fail.\n\n".
- "See 'System Requirements' in the $env->{cfg}->{fullname} documentation.");
+ "See 'System Requirements' in the $iso_env->{cfg}->{fullname} documentation.");
}
- if ($env->{product} eq 'pve') {
+ if ($iso_env->{product} eq 'pve') {
my $cpuinfo = eval { file_read_all('/proc/cpuinfo') };
if (!$cpuinfo || $cpuinfo !~ /^flags\s*:.*(vmx|svm)/m) {
Proxmox::UI::error(
}
Proxmox::UI::display_html('license.htm', sub {
- my ($raw_html, $env) = @_;
+ my ($raw_html, $iso_env) = @_;
my $license = eval { decode('utf8', file_read_all("${proxmox_cddir}/EULA")) };
if (my $err = $@) {
$country = detect_country() if $ipconf->{default} || is_test_mode();
-if (!defined($env->{locales}->{country}->{$country})) {
+if (!defined($iso_env->{locales}->{country}->{$country})) {
log_warn("ignoring detected country '$country', invalid or unknown\n");
$country = undef;
}