From 7d6d36ce2d6c5fc460a0b5114db60d5b39c1fb10 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Tue, 22 Nov 2005 14:38:57 +0000 Subject: contatenate auto_install and defcfg files into a new auto_install file in install root --- tools/drakx-in-chroot | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'tools/drakx-in-chroot') 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 [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; +} -- cgit v1.2.1