Add hook point on fstab mount failure

Check return code from `mount -na`, if there where any errors give
plugins a chance to do something about it.

Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Tobias Waldekranz
2015-09-29 22:38:06 +02:00
committed by Joachim Nilsson
parent 9491f18972
commit ae15988eb8
2 changed files with 9 additions and 1 deletions
+8 -1
View File
@@ -71,6 +71,7 @@ static int banner(void)
int main(int argc, char* argv[])
{
int err;
uev_ctx_t loop;
/*
@@ -151,7 +152,13 @@ int main(int argc, char* argv[])
plugin_run_hooks(HOOK_ROOTFS_UP);
umask(0);
run("/bin/mount -na");
print_desc("Mounting filesystems", NULL);
err = run("/bin/mount -na");
print_result(err);
if (err)
plugin_run_hooks(HOOK_MOUNT_ERROR);
run("/sbin/swapon -ea");
umask(0022);
+1
View File
@@ -43,6 +43,7 @@
typedef enum {
/* Bootstrap hooks */
HOOK_ROOTFS_UP = 0,
HOOK_MOUNT_ERROR,
HOOK_BASEFS_UP,
HOOK_NETWORK_UP,
HOOK_SVC_UP,