diff options
author | Eric Andersen <andersen@codepoet.org> | 1999-11-05 04:23:05 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 1999-11-05 04:23:05 +0000 |
commit | e18c75a563cf202a24effa8a4631dbf46bcc1575 (patch) | |
tree | dafe859ecf0224a7f7c6ce205296cc040c3a4b97 | |
parent | 99976859534bc320557586c8fa74ae3f0bd0b9dd (diff) | |
download | busybox-w32-e18c75a563cf202a24effa8a4631dbf46bcc1575.tar.gz busybox-w32-e18c75a563cf202a24effa8a4631dbf46bcc1575.tar.bz2 busybox-w32-e18c75a563cf202a24effa8a4631dbf46bcc1575.zip |
Fixed init so it won't hang on reboot...
-rw-r--r-- | init.c | 11 | ||||
-rw-r--r-- | init/init.c | 11 |
2 files changed, 12 insertions, 10 deletions
@@ -56,7 +56,7 @@ | |||
56 | static char *console = VT_CONSOLE; | 56 | static char *console = VT_CONSOLE; |
57 | static char *second_console = VT_SECONDARY; | 57 | static char *second_console = VT_SECONDARY; |
58 | static char *log = VT_LOG; | 58 | static char *log = VT_LOG; |
59 | 59 | static int kernel_version = 0; | |
60 | 60 | ||
61 | 61 | ||
62 | /* try to open up the specified device */ | 62 | /* try to open up the specified device */ |
@@ -350,9 +350,9 @@ static void shutdown_system(void) | |||
350 | waitfor(run( swap_off_cmd, console, FALSE)); | 350 | waitfor(run( swap_off_cmd, console, FALSE)); |
351 | waitfor(run( umount_cmd, console, FALSE)); | 351 | waitfor(run( umount_cmd, console, FALSE)); |
352 | sync(); | 352 | sync(); |
353 | message(CONSOLE, "Skipping bdflush\r\n"); | 353 | if (kernel_version > 0 && kernel_version <= 2 * 65536 + 2 * 256 + 11) { |
354 | if (get_kernel_revision() <= 2 * 65536 + 2 * 256 + 11) { | ||
355 | /* bdflush, kupdate not needed for kernels >2.2.11 */ | 354 | /* bdflush, kupdate not needed for kernels >2.2.11 */ |
355 | message(CONSOLE, "Flushing buffers.\r\n"); | ||
356 | bdflush(1, 0); | 356 | bdflush(1, 0); |
357 | sync(); | 357 | sync(); |
358 | } | 358 | } |
@@ -445,9 +445,10 @@ extern int init_main(int argc, char **argv) | |||
445 | 445 | ||
446 | 446 | ||
447 | /* Mount /proc */ | 447 | /* Mount /proc */ |
448 | if (mount ("proc", "/proc", "proc", 0, 0) == 0) | 448 | if (mount ("proc", "/proc", "proc", 0, 0) == 0) { |
449 | message(CONSOLE|LOG, "Mounting /proc: done.\n"); | 449 | message(CONSOLE|LOG, "Mounting /proc: done.\n"); |
450 | else | 450 | kernel_version = get_kernel_revision(); |
451 | } else | ||
451 | message(CONSOLE|LOG, "Mounting /proc: failed!\n"); | 452 | message(CONSOLE|LOG, "Mounting /proc: failed!\n"); |
452 | 453 | ||
453 | /* Make sure there is enough memory to do something useful. */ | 454 | /* Make sure there is enough memory to do something useful. */ |
diff --git a/init/init.c b/init/init.c index 87746ef86..bf97fe5d6 100644 --- a/init/init.c +++ b/init/init.c | |||
@@ -56,7 +56,7 @@ | |||
56 | static char *console = VT_CONSOLE; | 56 | static char *console = VT_CONSOLE; |
57 | static char *second_console = VT_SECONDARY; | 57 | static char *second_console = VT_SECONDARY; |
58 | static char *log = VT_LOG; | 58 | static char *log = VT_LOG; |
59 | 59 | static int kernel_version = 0; | |
60 | 60 | ||
61 | 61 | ||
62 | /* try to open up the specified device */ | 62 | /* try to open up the specified device */ |
@@ -350,9 +350,9 @@ static void shutdown_system(void) | |||
350 | waitfor(run( swap_off_cmd, console, FALSE)); | 350 | waitfor(run( swap_off_cmd, console, FALSE)); |
351 | waitfor(run( umount_cmd, console, FALSE)); | 351 | waitfor(run( umount_cmd, console, FALSE)); |
352 | sync(); | 352 | sync(); |
353 | message(CONSOLE, "Skipping bdflush\r\n"); | 353 | if (kernel_version > 0 && kernel_version <= 2 * 65536 + 2 * 256 + 11) { |
354 | if (get_kernel_revision() <= 2 * 65536 + 2 * 256 + 11) { | ||
355 | /* bdflush, kupdate not needed for kernels >2.2.11 */ | 354 | /* bdflush, kupdate not needed for kernels >2.2.11 */ |
355 | message(CONSOLE, "Flushing buffers.\r\n"); | ||
356 | bdflush(1, 0); | 356 | bdflush(1, 0); |
357 | sync(); | 357 | sync(); |
358 | } | 358 | } |
@@ -445,9 +445,10 @@ extern int init_main(int argc, char **argv) | |||
445 | 445 | ||
446 | 446 | ||
447 | /* Mount /proc */ | 447 | /* Mount /proc */ |
448 | if (mount ("proc", "/proc", "proc", 0, 0) == 0) | 448 | if (mount ("proc", "/proc", "proc", 0, 0) == 0) { |
449 | message(CONSOLE|LOG, "Mounting /proc: done.\n"); | 449 | message(CONSOLE|LOG, "Mounting /proc: done.\n"); |
450 | else | 450 | kernel_version = get_kernel_revision(); |
451 | } else | ||
451 | message(CONSOLE|LOG, "Mounting /proc: failed!\n"); | 452 | message(CONSOLE|LOG, "Mounting /proc: failed!\n"); |
452 | 453 | ||
453 | /* Make sure there is enough memory to do something useful. */ | 454 | /* Make sure there is enough memory to do something useful. */ |