From 13e551b64c1c3cd1c6a2025dd9328f908b9f3f39 Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Wed, 7 Feb 2001 20:18:21 +0000 Subject: - use description of network cards when you have to select between interfaces; has accuracy even in the case of multiple interface for a given kernel module - write down a small "shell" to change parameters on the fly (needs compile option SPAWN_INTERACTIVE) --- mdk-stage1/init.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'mdk-stage1/init.c') diff --git a/mdk-stage1/init.c b/mdk-stage1/init.c index fb33c7480..fc48c68f2 100644 --- a/mdk-stage1/init.c +++ b/mdk-stage1/init.c @@ -311,17 +311,6 @@ void unmount_filesystems(void) } } -int is_rescue() -{ - int fd, size; - char buf[512]; - if ((fd = open("/proc/cmdline", O_RDONLY, 0)) == -1) - fatal_error("could not open /proc/cmdline"); - size = read(fd, buf, sizeof(buf)); - buf[size-1] = 0; - close(fd); - return (strstr(buf, "rescue") != NULL); -} int main(int argc, char **argv) { @@ -420,13 +409,13 @@ int main(int argc, char **argv) end_stage2 = 1; } - if (!WIFEXITED(wait_status) || WEXITSTATUS(wait_status)) { + if (!WIFEXITED(wait_status) || (WEXITSTATUS(wait_status) != 0 && WEXITSTATUS(wait_status) != 1)) { printf("install exited abnormally :-( "); if (WIFSIGNALED(wait_status)) printf("-- received signal %d", WTERMSIG(wait_status)); printf("\n"); abnormal_termination = 1; - } else if (is_rescue()) { + } else if (WIFEXITED(wait_status) && WEXITSTATUS(wait_status) == 1) { kill(klog_pid, 9); printf("exiting stage1-initializer -- giving hand to rescue\n"); return 0; -- cgit v1.2.1