summaryrefslogtreecommitdiffstats
path: root/move/move.pm
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2003-11-19 13:25:50 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2003-11-19 13:25:50 +0000
commit5561bcb4759846772b736f299d04dea0a1a2a3ec (patch)
treec522ab34f72350e4fa0b8ec39afcd96e0f6bacf0 /move/move.pm
parent75dddab6c38081fc268cea01830d6e38bf9873ff (diff)
downloaddrakx-5561bcb4759846772b736f299d04dea0a1a2a3ec.tar
drakx-5561bcb4759846772b736f299d04dea0a1a2a3ec.tar.gz
drakx-5561bcb4759846772b736f299d04dea0a1a2a3ec.tar.bz2
drakx-5561bcb4759846772b736f299d04dea0a1a2a3ec.tar.xz
drakx-5561bcb4759846772b736f299d04dea0a1a2a3ec.zip
cleankey really does (doesn't look for i18n/user of other machines)
use a variable for /home/.sysconf
Diffstat (limited to 'move/move.pm')
-rw-r--r--move/move.pm13
1 files changed, 7 insertions, 6 deletions
diff --git a/move/move.pm b/move/move.pm
index 5ba5c0e9f..0d21e1bbf 100644
--- a/move/move.pm
+++ b/move/move.pm
@@ -14,6 +14,7 @@ use Digest::MD5 qw(md5_hex);
my @ALLOWED_LANGS = qw(en_US fr es it de);
our ($using_existing_user_config, $using_existing_host_config);
+my $key_sysconf = '/home/.sysconf';
sub symlinkf_short {
my ($dest, $file) = @_;
@@ -113,6 +114,7 @@ sub init {
system('sysctl -w kernel.hotplug="/sbin/hotplug"');
key_mount($o);
+ cat_('/proc/cmdline') =~ /\bcleankey\b/ and eval { rm_rf $key_sysconf };
key_installfiles('simple');
if (`getent passwd 501` =~ /([^:]+):/) {
$o->{users} = [ { name => $1 } ];
@@ -207,12 +209,11 @@ sub machine_ident {
sub key_installfiles {
my ($mode) = @_;
- mkdir '/home/.sysconf';
- my $sysconf = '/home/.sysconf/' . machine_ident();
+ mkdir $key_sysconf;
+ my $sysconf = "$key_sysconf/" . machine_ident();
- if (!-d $sysconf || cat_('/proc/cmdline') =~ /\bcleankey\b/) {
+ if (!-d $sysconf) {
if ($mode eq 'full') {
- eval { rm_rf $sysconf };
mkdir $sysconf;
foreach (chomp_(cat_('/image/move/keyfiles'))) {
my $target_dir = "$sysconf/" . dirname($_);
@@ -225,11 +226,11 @@ sub key_installfiles {
symlinkf("$sysconf$_", $_);
}
}
- system("cp /image/move/README.adding.more.files /home/.sysconf");
+ system("cp /image/move/README.adding.more.files $key_sysconf");
} else {
#- not in full mode and no host directory, grab user config from first existing host directory if possible
foreach (qw(/etc/passwd /etc/group /etc/sysconfig/i18n)) {
- my $first_available = first(glob("/home/.sysconf/*$_")) or next;
+ my $first_available = first(glob("$key_sysconf/*$_")) or next;
system("cp $first_available $_");
}
}