summaryrefslogtreecommitdiffstats
path: root/move
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-07-29 05:42:03 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-07-29 05:42:03 +0000
commitbfa93035dd1ca93131b2b0dd86303cf0f8cc9ea1 (patch)
tree3fd5cd530e46d27bf844a093690d010b61eb5e53 /move
parent75efa17c93eb8aca76d38821e375e2088a468102 (diff)
downloaddrakx-backup-do-not-use-bfa93035dd1ca93131b2b0dd86303cf0f8cc9ea1.tar
drakx-backup-do-not-use-bfa93035dd1ca93131b2b0dd86303cf0f8cc9ea1.tar.gz
drakx-backup-do-not-use-bfa93035dd1ca93131b2b0dd86303cf0f8cc9ea1.tar.bz2
drakx-backup-do-not-use-bfa93035dd1ca93131b2b0dd86303cf0f8cc9ea1.tar.xz
drakx-backup-do-not-use-bfa93035dd1ca93131b2b0dd86303cf0f8cc9ea1.zip
handle formatkey which clean_partition_table_and_format_key
Diffstat (limited to 'move')
-rw-r--r--move/move.pm31
1 files changed, 29 insertions, 2 deletions
diff --git a/move/move.pm b/move/move.pm
index f59c22a60..9c4749ec2 100644
--- a/move/move.pm
+++ b/move/move.pm
@@ -206,8 +206,14 @@ sub init {
install_steps::setupSCSI($o);
run_program::run('sysctl', '-w', 'kernel.hotplug=/sbin/hotplug');
- key_mount($o);
- cat_('/proc/cmdline') =~ /\bcleankey\b/ and eval { rm_rf $key_sysconf, glob_('/home/.mdkmove*') };
+ if (cat_('/proc/cmdline') =~ /\bformatkey\b/) {
+ #- waiting until X is launched
+ } else {
+ key_mount($o);
+ }
+ if (cat_('/proc/cmdline') =~ /\bcleankey\b/) {
+ eval { rm_rf $key_sysconf, glob_('/home/.mdkmove*') };
+ }
key_installfiles('simple');
setup_userconf($o);
if (-f '/etc/X11/X') {
@@ -280,6 +286,22 @@ sub handleI18NClp {
lomount_clp("always_$clp_name", '/usr');
}
+sub clean_partition_table_and_format_key {
+ my ($in) = @_;
+ my @keys = grep { detect_devices::isKeyUsb($_) } detect_devices::getSCSI();
+ my $key = $in->ask_from_listf('', "Which key?",
+ sub { "$_->{usb_description} ($_->{device})" },
+ \@keys);
+ $key->{prefix} ||= $key->{device};
+ add2hash_($key, partition_table::raw::get_geometry($key->{file} = devices::make($key->{device})));
+ partition_table::raw::zero_MBR($key);
+ my ($part) = partition_table::get_normal_parts_and_holes($key);
+ $part->{type} = 0xb;
+ partition_table::add($key, $part);
+ partition_table::write($key);
+ fs::real_format_part($part);
+}
+
sub key_parts {
my ($o) = @_;
@@ -479,6 +501,11 @@ sub install2::verifyKey {
log::l("automatic transparent key support is disabled"), return if $key_disabled;
+ if (cat_('/proc/cmdline') =~ /\bformatkey\b/) {
+ clean_partition_table_and_format_key($o);
+ key_mount($o, 'reread');
+ }
+
check_key($o) or return;
my $_wait = $using_existing_host_config