tty3 creation

waiting /dev/disk added
This commit is contained in:
Anton V. Boyarshinov 2010-11-20 19:20:08 +03:00
parent 2853f29c59
commit 3d2e77074f
5 changed files with 21 additions and 10 deletions

View File

@ -123,8 +123,17 @@ enum return_type cdrom_prepare(void)
char * choice; char * choice;
int i, count = 0; int i, count = 0;
enum return_type results; enum return_type results;
int timeout=60;
update_splash(); update_splash();
fprintf(stderr,"%c[1A",27);
for(i=0; i<timeout; i++) {
sleep(1);
if(opendir("/dev/disk/"))break;
fprintf(stderr,"\rwaiting for /dev/disk/ %d...",i);
}
get_medias(CDROM, &medias, &medias_models); get_medias(CDROM, &medias, &medias_models);
ptr = medias; ptr = medias;

7
disk.c
View File

@ -329,7 +329,14 @@ enum return_type disk_prepare(void)
char msg[256]; char msg[256];
int i, count = 0; int i, count = 0;
enum return_type results; enum return_type results;
int timeout = 60;
fprintf(stderr,"%c[1A",27);
for(i=0; i<timeout; i++) {
sleep(1);
if(opendir("/dev/disk/"))break;
fprintf(stderr,"\rwaiting for /dev/disk/ %d...",i);
}
get_medias(DISK, &medias, &medias_models); get_medias(DISK, &medias, &medias_models);
ptr = medias; ptr = medias;

1
init.c
View File

@ -37,7 +37,6 @@
#include "lomount.h" #include "lomount.h"
#include "tools.h" #include "tools.h"
#define MKDEV(ma,mi) ((ma)<<8 | (mi))
#define RAMFS_MAGIC 0x858458f6 #define RAMFS_MAGIC 0x858458f6
#define TMPFS_MAGIC 0x01021994 #define TMPFS_MAGIC 0x01021994

9
log.c
View File

@ -31,6 +31,7 @@
#include "log.h" #include "log.h"
static FILE * logfile = NULL; static FILE * logfile = NULL;
@ -67,15 +68,9 @@ void log_perror(char *msg)
void open_log(void) void open_log(void)
{ {
int i;
int timeout = 60;
if (!IS_TESTING) { if (!IS_TESTING) {
for(i=0; i < timeout; i++ ) { mknod("/dev/tty3", S_IFCHR, MKDEV(4, 3));
logfile = fopen("/dev/tty3", "w"); logfile = fopen("/dev/tty3", "w");
if(logfile != NULL) break;
fprintf(stderr,"\rwaiting for /dev/tty3: %d",i);
sleep(1);
}
if (!logfile) if (!logfile)
logfile = fopen("/tmp/install.log", "a"); logfile = fopen("/tmp/install.log", "a");
} }

View File

@ -58,5 +58,6 @@ struct param_elem
#define ptr_begins_static_str(pointer,static_str) (!strncmp(pointer,static_str,sizeof(static_str)-1)) #define ptr_begins_static_str(pointer,static_str) (!strncmp(pointer,static_str,sizeof(static_str)-1))
#define streq !strcmp #define streq !strcmp
#define MKDEV(ma,mi) ((ma)<<8 | (mi))
#endif #endif