summaryrefslogtreecommitdiffstats
path: root/tools/drakx-in-chroot
diff options
context:
space:
mode:
Diffstat (limited to 'tools/drakx-in-chroot')
-rw-r--r--tools/drakx-in-chroot22
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/drakx-in-chroot b/tools/drakx-in-chroot
index db521ca77..10ae26e27 100644
--- a/tools/drakx-in-chroot
+++ b/tools/drakx-in-chroot
@@ -11,6 +11,7 @@ my $STAGE2_LOCATION_ROOTED = '/tmp/stage2';
my $LIVE_LOCATION_REL = 'install/stage2/live/';
my $CLP_LOCATION_REL = 'install/stage2/';
my $CLP_FILE_REL = $CLP_LOCATION_REL . 'mdkinst.clp';
+my $AUTO_INSTALL_ROOTED = '/tmp/drakx-in-chroot.cfg.pl';
@ARGV >= 2 or die "usage: drakx-in-chroot <repository> <dir to install to> [options]\n";
@@ -36,6 +37,8 @@ mkdir_p("$SLASH_LOCATION$_") foreach '/dev', '/dev/usb', '/etc', '/var', '/proc'
sys("$sudo rm -rf $dir") if $ENV{CLEAN};
-e $dir or sys("$sudo mkdir -p $dir");
+copy_auto_install_files();
+
if (-d "$repository/$LIVE_LOCATION_REL") {
sys("$sudo mount -o bind $repository/$LIVE_LOCATION_REL $STAGE2_LOCATION");
} elsif (-e "$repository/$CLP_FILE_REL") {
@@ -129,3 +132,22 @@ sub umount_all() {
}
$err;
}
+
+sub copy_auto_install_files() {
+ my ($opt);
+ my ($auto_install, $defcfg);
+ each_index {
+ if ($opt eq 'auto_install' && -f $_) {
+ $auto_install = $_;
+ $_ = $AUTO_INSTALL_ROOTED;
+ } elsif ($opt eq 'defcfg' && -f $_) {
+ $defcfg = $_;
+ $ARGV[$::i-1] = $ARGV[$::i] = undef;
+ }
+ undef $opt;
+ /^--?(.*)/ and $opt = $1;
+ } @ARGV;
+ #- contatenate auto_install and defcfg files into a new auto_install file in install root
+ my @auto_inst = grep { -f $_ } $auto_install, $defcfg;
+ output($SLASH_LOCATION . $AUTO_INSTALL_ROOTED, cat_(@auto_inst)) if @auto_inst;
+}