summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2003-11-21 18:53:51 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2003-11-21 18:53:51 +0000
commit7dbd61df3b2430bfec54672e4e7e48dfa0656c15 (patch)
tree5058ed0f281253808d8c9f901d51eba7e945b31e
parent463c2e89e422bebfaf22f63b70b81d773d32faa9 (diff)
downloaddrakx-backup-do-not-use-7dbd61df3b2430bfec54672e4e7e48dfa0656c15.tar
drakx-backup-do-not-use-7dbd61df3b2430bfec54672e4e7e48dfa0656c15.tar.gz
drakx-backup-do-not-use-7dbd61df3b2430bfec54672e4e7e48dfa0656c15.tar.bz2
drakx-backup-do-not-use-7dbd61df3b2430bfec54672e4e7e48dfa0656c15.tar.xz
drakx-backup-do-not-use-7dbd61df3b2430bfec54672e4e7e48dfa0656c15.zip
allow formatting the virtual key with a commandline param, for easy mode-2 testing
-rw-r--r--move/move.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/move/move.pm b/move/move.pm
index e432436fa..ac2142a8e 100644
--- a/move/move.pm
+++ b/move/move.pm
@@ -43,11 +43,12 @@ sub handle_etcfiles {
}
sub handle_virtual_key {
- if (my ($device, $file) = cat_('/proc/cmdline') =~ /\bvirtual_key=(\S+),(\S+)/) {
- log::l("using device=$device file=$file as a virtual key");
+ if (my ($device, $file, $options) = cat_('/proc/cmdline') =~ /\bvirtual_key=([^,\s]+),([^,\s]+)(,\S+)?/) {
+ log::l("using device=$device file=$file as a virtual key with options $options");
my $dir = '/virtual_key_mount';
mkdir $dir;
run_program::run('mount', $device, $dir);
+ $options =~ /format/ and run_program::run('mkdosfs', "$dir$file");
require devices;
my $loop = devices::find_free_loop();
run_program::run('losetup', $loop, "$dir$file");