mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 17:31:20 +02:00
hdd_menu: wait for HDD to be mounted by mdev after format
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/swap.h>
|
||||
#include <sys/vfs.h>
|
||||
#include <dirent.h>
|
||||
#include <dlfcn.h>
|
||||
#include <sys/mount.h>
|
||||
@@ -649,6 +650,20 @@ _remount:
|
||||
fprintf(f, "/sbin/hotplug\n");
|
||||
fclose(f);
|
||||
}
|
||||
#else
|
||||
/* mounting is asynchronous via mdev, so wait for the directory to appear */
|
||||
for (int i = 0; i < 20; i++) {
|
||||
struct statfs s;
|
||||
if (::statfs(dst, &s) == 0) {
|
||||
if (s.f_type == 0xEF53) /* EXT3_SUPER_MAGIC */
|
||||
break;
|
||||
if (s.f_type == 0x52654973) /* REISERFS_SUPER_MAGIC */
|
||||
break;
|
||||
}
|
||||
if (i == 0)
|
||||
printf("CHDDFmtExec: waiting for %s to be mounted\n", dst);
|
||||
sleep(1);
|
||||
}
|
||||
#endif
|
||||
|
||||
if(!res) {
|
||||
|
Reference in New Issue
Block a user