diff options
author | Guillaume Cottenceau <gc@mandriva.com> | 2003-11-14 18:55:35 +0000 |
---|---|---|
committer | Guillaume Cottenceau <gc@mandriva.com> | 2003-11-14 18:55:35 +0000 |
commit | 81daab12665e715c0fbc26b285b3494f8767da66 (patch) | |
tree | 0f49b0db365a7d9e8726e6624f63d6d56ca088f7 /move/move.pm | |
parent | f10db1d5174ebebc678a0fb1bbdae85beb53f31e (diff) | |
download | drakx-81daab12665e715c0fbc26b285b3494f8767da66.tar drakx-81daab12665e715c0fbc26b285b3494f8767da66.tar.gz drakx-81daab12665e715c0fbc26b285b3494f8767da66.tar.bz2 drakx-81daab12665e715c0fbc26b285b3494f8767da66.tar.xz drakx-81daab12665e715c0fbc26b285b3494f8767da66.zip |
preliminary support for saving system configuration data on usb key
Diffstat (limited to 'move/move.pm')
-rw-r--r-- | move/move.pm | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/move/move.pm b/move/move.pm index 2dc8779d6..a9fee7412 100644 --- a/move/move.pm +++ b/move/move.pm @@ -10,6 +10,7 @@ use fsedit; use run_program; use log; use lang; +use Digest::MD5 qw(md5_hex); my @ALLOWED_LANGS = qw(en_US fr es it de); @@ -185,7 +186,7 @@ sub keys_parts { my @keys = grep { $_->{usb_media_type} && index($_->{usb_media_type}, 'Mass Storage|') == 0 && $_->{media_type} eq 'hd' } @{$o->{all_hds}{hds}}; map_index { $_->{mntpoint} = $::i ? "/mnt/key$::i" : '/home'; - $_->{options} = 'umask=077,uid=501,gid=501'; + $_->{options} = 'umask=077,uid=501,gid=501,shortname=mixed'; $_; } fsedit::get_fstab(@keys); } @@ -203,6 +204,11 @@ sub install2::handleMoveKey { fs::mount_part($_) foreach keys_parts($o); } +sub machine_ident { + #- , c::get_hw_address('eth0'); before detect of network :( + md5_hex(join '', (map { (split)[1] } cat_('/proc/bus/pci/devices'))); +} + sub install2::verifyKey { my ($o) = $::o; @@ -246,6 +252,26 @@ unplug it, remove write protection, and then plug it again.")), } close F; unlink '/home/.touched'; + + my $wait = $o->wait_message(N("Setting up USB key"), N("Please wait, setting up system configuration files on USB key...")); + mkdir '/home/.sysconf'; + my $sysconf = '/home/.sysconf/' . machine_ident(); + if (!-d $sysconf) { + mkdir $sysconf; + foreach (chomp_(cat_('/image/move/keyfiles'))) { + mkdir_p("$sysconf/" . dirname($_)); + system("cp $_ $sysconf$_"); + symlinkf("$sysconf$_", $_); + } + system("cp /image/move/README.adding.more.files /home/.sysconf"); + } else { + foreach (chomp_(`find $sysconf -type f`)) { + my ($path) = /^\Q$sysconf\E(.*)/; + mkdir_p(dirname($path)); + symlinkf($_, $path); + } + } + $wait = undef; } sub install2::startMove { |