summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/tools.c
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2000-12-12 21:05:30 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2000-12-12 21:05:30 +0000
commit2b2914cc04a93ca362e4eb3663061c3039aa4049 (patch)
tree3f8dbeae1bc114e58f3246cd76b9b0156392b720 /mdk-stage1/tools.c
parent7852f76ee05551c05a4f833f9a55bec15f44f85d (diff)
downloaddrakx-2b2914cc04a93ca362e4eb3663061c3039aa4049.tar
drakx-2b2914cc04a93ca362e4eb3663061c3039aa4049.tar.gz
drakx-2b2914cc04a93ca362e4eb3663061c3039aa4049.tar.bz2
drakx-2b2914cc04a93ca362e4eb3663061c3039aa4049.tar.xz
drakx-2b2914cc04a93ca362e4eb3663061c3039aa4049.zip
- add pci probing feature
- add listing of available modules and insmod'ing on user request - make rescue-stage2 working
Diffstat (limited to 'mdk-stage1/tools.c')
-rw-r--r--mdk-stage1/tools.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/mdk-stage1/tools.c b/mdk-stage1/tools.c
index 71516b354..930c1027f 100644
--- a/mdk-stage1/tools.c
+++ b/mdk-stage1/tools.c
@@ -94,10 +94,18 @@ void process_cmdline(void)
if (!strcmp(name, "cdrom")) set_param(MODE_CDROM);
if (!strcmp(name, "special_stage2")) set_param(MODE_SPECIAL_STAGE2);
}
- tmp_params[p].name = NULL;
+
+ if (IS_RESCUE) {
+ tmp_params[p].name = "special_stage2";
+ tmp_params[p].value = "rescue";
+ p++;
+ set_param(MODE_SPECIAL_STAGE2);
+ }
- params = (struct cmdline_elem *) malloc(sizeof(struct cmdline_elem) * (p+1));
- memcpy(params, tmp_params, sizeof(struct cmdline_elem) * (p+1));
+ tmp_params[p++].name = NULL;
+
+ params = (struct cmdline_elem *) malloc(sizeof(struct cmdline_elem) * p);
+ memcpy(params, tmp_params, sizeof(struct cmdline_elem) * p);
log_message("\tgot %d args", p);
}
@@ -184,7 +192,7 @@ enum return_type load_ramdisk(void)
{
char * img_name;
gzFile st2;
- char * ramdisk = "/dev/ram"; /* warning, verify that this file exists in the initrd (and actually is a ramdisk device file) */
+ char * ramdisk = "/dev/ram3"; /* warning, verify that this file exists in the initrd (and actually is a ramdisk device file) */
int ram_fd;
char buffer[4096];
char * stg2_name = get_param_valued("special_stage2");
@@ -194,6 +202,9 @@ enum return_type load_ramdisk(void)
if (!stg2_name)
stg2_name = "mdkinst";
+
+ if (IS_RESCUE)
+ stg2_name = "rescue";
img_name = malloc(strlen(begin_img) + strlen(stg2_name) + strlen(end_img) + 1);
strcpy(img_name, begin_img);
@@ -238,6 +249,9 @@ enum return_type load_ramdisk(void)
gzclose(st2);
close(ram_fd);
+ if (IS_RESCUE)
+ return RETURN_OK; /* fucksike, I lost several hours wondering why the kernel won't see the rescue if it is alreay mounted */
+
if (my_mount(ramdisk, "/tmp/stage2", "ext2"))
return RETURN_ERROR;