cdrom.c, disk.c: poke lazy udev to do its job
See also https://bugzilla.altlinux.org/30315
This commit is contained in:
parent
22183d47a8
commit
ce7dbcef2b
4
cdrom.c
4
cdrom.c
@ -192,12 +192,14 @@ 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;
|
int timeout=32;
|
||||||
|
int period=5;
|
||||||
|
|
||||||
update_splash("prepare");
|
update_splash("prepare");
|
||||||
|
|
||||||
fprintf(stderr,"%c[1A",27);
|
fprintf(stderr,"%c[1A",27);
|
||||||
for(i=0; i<timeout; i++) {
|
for(i=0; i<timeout; i++) {
|
||||||
|
if(i%period==0) system("udevadm trigger --action=add");
|
||||||
sleep(1);
|
sleep(1);
|
||||||
if(opendir("/dev/disk/"))break;
|
if(opendir("/dev/disk/"))break;
|
||||||
fprintf(stderr,"\rwaiting for /dev/disk/ %d...",i);
|
fprintf(stderr,"\rwaiting for /dev/disk/ %d...",i);
|
||||||
|
4
disk.c
4
disk.c
@ -331,10 +331,12 @@ 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;
|
int timeout = 32;
|
||||||
|
int period = 5;
|
||||||
update_splash("prepare");
|
update_splash("prepare");
|
||||||
fprintf(stderr,"%c[1A",27);
|
fprintf(stderr,"%c[1A",27);
|
||||||
for(i=0; i<timeout; i++) {
|
for(i=0; i<timeout; i++) {
|
||||||
|
if(i%period==0) system("udevadm trigger --action=add");
|
||||||
sleep(1);
|
sleep(1);
|
||||||
if(opendir("/dev/disk/"))break;
|
if(opendir("/dev/disk/"))break;
|
||||||
fprintf(stderr,"\rwaiting for /dev/disk/ %d...",i);
|
fprintf(stderr,"\rwaiting for /dev/disk/ %d...",i);
|
||||||
|
Loading…
Reference in New Issue
Block a user