From d47c8e5649c64ca814fc838d67263a1a6ba1870b Mon Sep 17 00:00:00 2001 From: Antoine Ginies Date: Mon, 31 Jan 2011 13:26:56 +0000 Subject: fix ka methog --- mdk-stage1/ka.c | 13 +++++++++---- mdk-stage1/modules.c | 2 +- mdk-stage1/params.c | 3 ++- mdk-stage1/stage1.c | 17 ++--------------- 4 files changed, 14 insertions(+), 21 deletions(-) diff --git a/mdk-stage1/ka.c b/mdk-stage1/ka.c index 7d8325084..670abe5af 100644 --- a/mdk-stage1/ka.c +++ b/mdk-stage1/ka.c @@ -1,5 +1,5 @@ /* - * Copyright 2005 Mandrakesoft + * Copyright 2005 Mandriva * * This software may be freely redistributed under the terms of the GNU * public license. @@ -44,14 +44,16 @@ static void my_pause(void) { static enum return_type ka_wait_for_stage2(int count) { char * ramdisk = "/dev/ram3"; /* warning, verify that this file exists in the initrd*/ - char * ka_launch[] = { "/ka/ka-d-client", "-w","-s","getstage2","-e","(cd /tmp/stage2; tar --extract --read-full-records --same-permissions --numeric-owner --sparse --file - )", NULL }; /* The command line for ka_launch */ - char * mkfs_launch[] = { "/sbin/mke2fs", ramdisk, NULL}; /* The mkfs command for formating the ramdisk */ + char * ka_launch[] = { "/ka/ka-d-client", "-w","-s","getstage2","-e","(cd /tmp/stage2; tar -x -f - )", NULL }; /* The command line for ka_launch */ + char * mkfs_launch[] = { "/sbin/mke2fs", "-m", "0", ramdisk, NULL}; /* The mkfs command for formating the ramdisk */ log_message("KA: Preparing to receive stage 2...."); + wait_message("Preparing to receive stage 2"); + int pida, wait_status; if (!(pida = fork())) { /* Forking current process for running mkfs */ - close(1); + //close(1); close(2); execv(mkfs_launch[0], mkfs_launch); /* Formating the ramdisk */ printf("KA: Can't execute %s\n\n", mkfs_launch[0]); @@ -59,10 +61,13 @@ static enum return_type ka_wait_for_stage2(int count) return KAERR_CANTFORK; } while (wait4(-1, &wait_status, 0, NULL) != pida) {}; /* Waiting the end of mkfs */ + remove_wait_message(); + wait_message("Mounting /dev/ram3 at %s", STAGE2_LOCATION); if (my_mount(ramdisk, STAGE2_LOCATION, "ext2", 1)) {/* Trying to mount the ramdisk */ return RETURN_ERROR; } + remove_wait_message(); log_message("KA: Waiting for stage 2...."); wait_message("Waiting for rescue from KA server (Try %d/%d)", count, KA_MAX_RETRY); diff --git a/mdk-stage1/modules.c b/mdk-stage1/modules.c index 5f02d2a6d..371c241dc 100644 --- a/mdk-stage1/modules.c +++ b/mdk-stage1/modules.c @@ -40,7 +40,7 @@ #include "modules.h" #define UEVENT_HELPER_FILE "/sys/kernel/uevent_helper" -#define UEVENT_HELPER_VALUE "/sbin/hotplug" +#define UEVENT_HELPER_VALUE "/hotplug" static char modules_directory[100]; static struct module_deps_elem * modules_deps = NULL; diff --git a/mdk-stage1/params.c b/mdk-stage1/params.c index 38ac94956..efce95115 100644 --- a/mdk-stage1/params.c +++ b/mdk-stage1/params.c @@ -81,7 +81,8 @@ void process_cmdline(void) if (!strcmp(name, "changedisk")) set_param(MODE_CHANGEDISK); if (!strcmp(name, "updatemodules") || !strcmp(name, "thirdparty")) set_param(MODE_THIRDPARTY); - if (!strcmp(name, "rescue")) set_param(MODE_RESCUE); + if (!strcmp(name, "rescue") || + !strcmp(name, "kamethod")) set_param(MODE_RESCUE); if (!strcmp(name, "keepmounted")) set_param(MODE_KEEP_MOUNTED); if (!strcmp(name, "noauto")) set_param(MODE_NOAUTO); if (!strcmp(name, "netauto")) set_param(MODE_NETAUTO); diff --git a/mdk-stage1/stage1.c b/mdk-stage1/stage1.c index 73f3fc4db..4d193046b 100644 --- a/mdk-stage1/stage1.c +++ b/mdk-stage1/stage1.c @@ -244,23 +244,10 @@ static void handle_pcmcia(void) } #endif -#ifndef ENABLE_NETWORK_STANDALONE -static void handle_hid(void) -{ - struct hid_entries entry_list; - unsigned int i; - - entry_list = hid_probe(); - for (i = 0; i < entry_list.nb; i++) { - if (entry_list.entries[i].module != NULL) - my_insmod(entry_list.entries[i].module, ANY_DRIVER_TYPE, NULL, 0); - } -} - - /************************************************************ */ +#ifndef ENABLE_NETWORK_STANDALONE static void method_select_and_prepare(void) { enum return_type results; @@ -439,7 +426,7 @@ int main(int argc __attribute__ ((unused)), char **argv __attribute__ ((unused)) if (!IS_NOAUTO) handle_pcmcia(); #endif - handle_hid(); +// handle_hid(); if (IS_CHANGEDISK) stg1_info_message("You are starting the installation with an alternate booting method. " -- cgit v1.2.1