Use spawn to run udevadm
Signed-off-by: Alexey Gladkov <legion@altlinux.org>
This commit is contained in:
parent
35bf95867a
commit
bc936fd7c2
6
cdrom.c
6
cdrom.c
@ -35,7 +35,9 @@
|
||||
#include "mount.h"
|
||||
|
||||
#include "cdrom.h"
|
||||
#include "init.h"
|
||||
|
||||
extern char *udevtrigger_add[];
|
||||
extern char version[];
|
||||
|
||||
static int mount_iso9660(char * dev_name)
|
||||
@ -199,7 +201,9 @@ enum return_type cdrom_prepare(void)
|
||||
|
||||
fprintf(stderr,"%c[1A",27);
|
||||
for(i=0; i<timeout; i++) {
|
||||
if(i%period==0) system("udevadm trigger --action=add");
|
||||
if (i % period == 0) {
|
||||
spawn(udevtrigger_add);
|
||||
}
|
||||
sleep(1);
|
||||
if(opendir("/dev/disk/"))break;
|
||||
fprintf(stderr,"\rwaiting for /dev/disk/ %d...",i);
|
||||
|
6
disk.c
6
disk.c
@ -39,7 +39,9 @@
|
||||
#include "automatic.h"
|
||||
|
||||
#include "disk.h"
|
||||
#include "init.h"
|
||||
|
||||
extern char *udevtrigger_add[];
|
||||
extern char version[];
|
||||
|
||||
struct partition_detection_anchor {
|
||||
@ -336,7 +338,9 @@ enum return_type disk_prepare(void)
|
||||
update_splash("prepare");
|
||||
fprintf(stderr,"%c[1A",27);
|
||||
for(i=0; i<timeout; i++) {
|
||||
if(i%period==0) system("udevadm trigger --action=add");
|
||||
if (i % period == 0) {
|
||||
spawn(udevtrigger_add);
|
||||
}
|
||||
sleep(1);
|
||||
if(opendir("/dev/disk/"))break;
|
||||
fprintf(stderr,"\rwaiting for /dev/disk/ %d...",i);
|
||||
|
1
init.c
1
init.c
@ -59,6 +59,7 @@ char ** myenv = NULL;
|
||||
|
||||
char *udevd[] = {"/sbin/udevd", "udevd", "--resolve-names=never", NULL};
|
||||
char *udevtrigger[] = {"/sbin/udevadm", "udevadm", "trigger", NULL};
|
||||
char *udevtrigger_add[] = {"/sbin/udevadm", "udevadm", "trigger", "--action=add", NULL};
|
||||
char *udevsettle[] = {"/sbin/udevadm", "udevadm", "settle", NULL};
|
||||
|
||||
char *init_top[] = {"/sbin/init-top", "init-top", NULL};
|
||||
|
Loading…
Reference in New Issue
Block a user