--- /dev/null
+package Proxmox::Install::Env;
+
+use strict;
+use warnings;
+
+use base qw(Exporter);
+our @EXPORT = qw(is_test_mode);
+
+my $product_cfg = {
+ pve => {
+ fullname => 'Proxmox VE',
+ port => '8006',
+ enable_btrfs => 1,
+ bridged_network => 1,
+ },
+ pmg => {
+ fullname => 'Proxmox Mail Gateway',
+ port => '8006',
+ enable_btrfs => 0,
+ bridged_network => 0,
+ },
+ pbs => {
+ fullname => 'Proxmox Backup Server',
+ port => '8007',
+ enable_btrfs => 0,
+ bridged_network => 0,
+ },
+};
+
+sub setup {
+ my $cd_info = get_cd_info();
+ my $product = $cd_info->{product};
+
+ my $setup_info = $product_cfg->{$product};
+ die "unknown product '$product'\n" if !$setup_info;
+
+ $setup_info->{product} = $product;
+
+ return ($setup_info, $cd_info);
+}
+
+sub get_cd_info {
+ my $info_fn = '/.cd-info'; # default place in the ISO environment
+ if (!-f $info_fn && -f "cd-info.test") {
+ $info_fn = "cd-info.test"; # use from CWD for test mode
+ }
+
+ open(my $fh, '<', $info_fn) or die "Could not open CD info file '$info_fn' $!";
+
+ my $cd_info = {};
+ while (my $line = <$fh>) {
+ chomp $line;
+ if ($line =~ /^(\S+)=['"]?(.+?)['"]?$/) { # we control cd-info content, so good enough.
+ $cd_info->{lc($1)} = $2;
+ }
+ }
+ close ($fh);
+
+ die "CD-info is missing required key 'product'!\n" if !defined $cd_info->{product};
+
+ return $cd_info;
+}
+
+my $test_mode;
+sub enable_test_mode {
+ $test_mode = 1;
+}
+sub is_test_mode {
+ return !!$test_mode;
+}
+
+1;
+++ /dev/null
-package Proxmox::Install::Setup;
-
-use strict;
-use warnings;
-
-use base qw(Exporter);
-our @EXPORT = qw(is_test_mode);
-
-my $product_cfg = {
- pve => {
- fullname => 'Proxmox VE',
- port => '8006',
- enable_btrfs => 1,
- bridged_network => 1,
- },
- pmg => {
- fullname => 'Proxmox Mail Gateway',
- port => '8006',
- enable_btrfs => 0,
- bridged_network => 0,
- },
- pbs => {
- fullname => 'Proxmox Backup Server',
- port => '8007',
- enable_btrfs => 0,
- bridged_network => 0,
- },
-};
-
-sub setup {
- my $cd_info = get_cd_info();
- my $product = $cd_info->{product};
-
- my $setup_info = $product_cfg->{$product};
- die "unknown product '$product'\n" if !$setup_info;
-
- $setup_info->{product} = $product;
-
- return ($setup_info, $cd_info);
-}
-
-sub get_cd_info {
- my $info_fn = '/.cd-info'; # default place in the ISO environment
- if (!-f $info_fn && -f "cd-info.test") {
- $info_fn = "cd-info.test"; # use from CWD for test mode
- }
-
- open(my $fh, '<', $info_fn) or die "Could not open CD info file '$info_fn' $!";
-
- my $cd_info = {};
- while (my $line = <$fh>) {
- chomp $line;
- if ($line =~ /^(\S+)=['"]?(.+?)['"]?$/) { # we control cd-info content, so good enough.
- $cd_info->{lc($1)} = $2;
- }
- }
- close ($fh);
-
- die "CD-info is missing required key 'product'!\n" if !defined $cd_info->{product};
-
- return $cd_info;
-}
-
-my $test_mode;
-sub enable_test_mode {
- $test_mode = 1;
-}
-sub is_test_mode {
- return !!$test_mode;
-}
-
-1;
#PERL_MODULES=$(shell git ls-files . | grep '.pm$')
PERL_MODULES=\
- Install/Setup.pm \
+ Install/Env.pm \
Log.pm \
Sys/Command.pm \
Sys/File.pm \
use IO::Select;
use String::ShellQuote;
-use Proxmox::Install::Setup;
+use Proxmox::Install::Env;
use Proxmox::Log;
use base qw(Exporter);
use Time::HiRes;
use POSIX ":sys_wait_h";
-use Proxmox::Install::Setup;
+use Proxmox::Install::Env;
use Proxmox::Log;
use Proxmox::Sys::Command qw(run_command syscmd);
use Proxmox::Sys::File qw(file_read_firstline file_read_all file_write_all);
'test-image|t=s' => \$test_image
) or die "usage error\n";
-Proxmox::Install::Setup::enable_test_mode() if $test_image;
+Proxmox::Install::Env::enable_test_mode() if $test_image;
$ENV{'LVM_SUPPRESS_FD_WARNINGS'} = '1';
-my ($setup, $cd_info) = Proxmox::Install::Setup::setup();
+my ($setup, $cd_info) = Proxmox::Install::Env::setup();
my $zfstestpool = "test_rpool";
my $zfspoolname = is_test_mode() ? $zfstestpool : 'rpool';