2011-07-25 00:44:15 +01:00
|
|
|
diff -ru -x '*~' mountall-2.31-orig/configure.ac mountall-2.31/configure.ac
|
|
|
|
--- mountall-2.31-orig/configure.ac 2011-07-15 14:00:15.000000000 +0200
|
|
|
|
+++ mountall-2.31/configure.ac 2011-07-25 00:13:13.000000000 +0200
|
2010-06-04 14:43:53 +01:00
|
|
|
@@ -29,7 +29,7 @@
|
|
|
|
PKG_CHECK_MODULES([NIH_DBUS], [libnih-dbus >= 1.0.0])
|
|
|
|
PKG_CHECK_MODULES([DBUS], [dbus-1 >= 1.2.16])
|
|
|
|
PKG_CHECK_MODULES([UDEV], [libudev >= 146])
|
|
|
|
-PKG_CHECK_MODULES([PLYMOUTH], [ply-boot-client >= 0.8.0])
|
|
|
|
+#PKG_CHECK_MODULES([PLYMOUTH], [ply-boot-client >= 0.8.0])
|
|
|
|
|
|
|
|
# Checks for header files.
|
|
|
|
|
2011-07-25 00:44:15 +01:00
|
|
|
diff -ru -x '*~' mountall-2.31-orig/src/mountall.c mountall-2.31/src/mountall.c
|
|
|
|
--- mountall-2.31-orig/src/mountall.c 2011-07-15 14:00:15.000000000 +0200
|
|
|
|
+++ mountall-2.31/src/mountall.c 2011-07-25 00:21:13.000000000 +0200
|
2010-06-04 14:43:53 +01:00
|
|
|
@@ -64,8 +64,10 @@
|
|
|
|
#include <nih-dbus/dbus_proxy.h>
|
|
|
|
#include <nih-dbus/errors.h>
|
|
|
|
|
|
|
|
+#if 0
|
|
|
|
#include <ply-event-loop.h>
|
|
|
|
#include <ply-boot-client.h>
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
#include "ioprio.h"
|
|
|
|
|
2011-07-25 00:44:15 +01:00
|
|
|
@@ -219,15 +221,19 @@
|
2010-06-04 14:43:53 +01:00
|
|
|
void boredom_timeout (void *data, NihTimer *timer);
|
|
|
|
|
|
|
|
int plymouth_connect (void);
|
|
|
|
+#if 0
|
|
|
|
void plymouth_disconnected (void *user_data, ply_boot_client_t *client);
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
void plymouth_progress (Mount *mnt, int progress);
|
|
|
|
void plymouth_update (int only_clear);
|
|
|
|
|
|
|
|
+#if 0
|
|
|
|
void plymouth_response (void *user_data, ply_boot_client_t *client);
|
|
|
|
void plymouth_failed (void *user_data, ply_boot_client_t *client);
|
|
|
|
void plymouth_answer (void *user_data, const char *keys,
|
|
|
|
ply_boot_client_t *client);
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
void usr1_handler (void *data, NihSignal *signal);
|
2011-07-25 00:44:15 +01:00
|
|
|
int set_dev_wait_time (NihOption *option, const char *arg);
|
|
|
|
@@ -247,8 +253,10 @@
|
2010-06-07 13:14:47 +01:00
|
|
|
**/
|
|
|
|
size_t num_local = 0;
|
|
|
|
size_t num_local_mounted = 0;
|
|
|
|
+size_t num_local_failed = 0;
|
|
|
|
size_t num_remote = 0;
|
|
|
|
size_t num_remote_mounted = 0;
|
|
|
|
+size_t num_remote_failed = 0;
|
|
|
|
size_t num_virtual = 0;
|
|
|
|
size_t num_virtual_mounted = 0;
|
|
|
|
size_t num_swap = 0;
|
2011-07-25 00:44:15 +01:00
|
|
|
@@ -318,6 +326,7 @@
|
2010-06-04 14:43:53 +01:00
|
|
|
**/
|
|
|
|
static struct udev *udev = NULL;
|
|
|
|
|
|
|
|
+#if 0
|
|
|
|
/**
|
|
|
|
* ply_event_loop:
|
|
|
|
*
|
2011-07-25 00:44:15 +01:00
|
|
|
@@ -331,6 +340,7 @@
|
2010-06-04 14:43:53 +01:00
|
|
|
* Plymouth boot client.
|
|
|
|
**/
|
|
|
|
static ply_boot_client_t *ply_boot_client = NULL;
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* plymouth_error:
|
2011-07-25 00:44:15 +01:00
|
|
|
@@ -1253,11 +1263,12 @@
|
2010-07-07 14:08:44 +01:00
|
|
|
nih_debug ("%s is root filesystem", MOUNT_NAME (mnt));
|
|
|
|
tag = TAG_LOCAL;
|
|
|
|
} else if (is_remote (mnt)) {
|
|
|
|
- if ((! strcmp (mnt->mountpoint, "/usr"))
|
|
|
|
+ if ((! has_option (mnt, "nobootwait", FALSE)) && (
|
|
|
|
+ (! strcmp (mnt->mountpoint, "/usr"))
|
|
|
|
|| (! strcmp (mnt->mountpoint, "/var"))
|
|
|
|
|| (! strncmp (mnt->mountpoint, "/usr/", 5))
|
|
|
|
|| (! strncmp (mnt->mountpoint, "/var/", 5))
|
|
|
|
- || (has_option (mnt, "bootwait", FALSE)))
|
|
|
|
+ || (has_option (mnt, "bootwait", FALSE))))
|
|
|
|
{
|
|
|
|
tag = TAG_REMOTE;
|
|
|
|
} else {
|
2011-07-25 00:44:15 +01:00
|
|
|
@@ -1566,7 +1577,8 @@
|
2010-06-07 13:14:47 +01:00
|
|
|
/* Enforce local only after virtual filesystems triggered */
|
|
|
|
if ((! local_triggered)
|
|
|
|
&& virtual_triggered
|
|
|
|
- && (num_local_mounted == num_local)) {
|
|
|
|
+ && (num_local_mounted == num_local)
|
|
|
|
+ && (num_local_failed == 0)) {
|
|
|
|
nih_info (_("%s finished"), "local");
|
|
|
|
emit_event ("local-filesystems", NULL);
|
|
|
|
local_triggered = TRUE;
|
2011-07-25 00:44:15 +01:00
|
|
|
@@ -1575,7 +1587,8 @@
|
2010-06-07 13:14:47 +01:00
|
|
|
/* Enforce remote only after virtual filesystems triggrered */
|
|
|
|
if ((! remote_triggered)
|
|
|
|
&& virtual_triggered
|
|
|
|
- && (num_remote_mounted == num_remote)) {
|
|
|
|
+ && (num_remote_mounted == num_remote)
|
|
|
|
+ && (num_remote_failed == 0)) {
|
|
|
|
nih_info (_("%s finished"), "remote");
|
|
|
|
emit_event ("remote-filesystems", NULL);
|
|
|
|
remote_triggered = TRUE;
|
2011-07-25 00:44:15 +01:00
|
|
|
@@ -1585,7 +1598,9 @@
|
2010-06-07 13:14:47 +01:00
|
|
|
if ((! filesystem_triggered)
|
|
|
|
&& virtual_triggered
|
|
|
|
&& local_triggered
|
|
|
|
- && remote_triggered) {
|
|
|
|
+ && remote_triggered
|
|
|
|
+ && (num_local_failed == 0)
|
|
|
|
+ && (num_remote_failed == 0)) {
|
|
|
|
nih_info (_("All filesystems mounted"));
|
|
|
|
emit_event ("filesystem", NULL);
|
|
|
|
filesystem_triggered = TRUE;
|
2011-07-25 00:44:15 +01:00
|
|
|
@@ -1599,9 +1614,9 @@
|
2010-06-07 13:14:47 +01:00
|
|
|
swap_triggered = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
- nih_info ("local %zi/%zi remote %zi/%zi virtual %zi/%zi swap %zi/%zi",
|
|
|
|
- num_local_mounted, num_local,
|
|
|
|
- num_remote_mounted, num_remote,
|
|
|
|
+ nih_info ("local %zi/%zi/%zi remote %zi/%zi/%zi virtual %zi/%zi swap %zi/%zi",
|
|
|
|
+ num_local_mounted, num_local, num_local_failed,
|
|
|
|
+ num_remote_mounted, num_remote, num_remote_failed,
|
|
|
|
num_virtual_mounted, num_virtual,
|
|
|
|
num_swap_mounted, num_swap);
|
|
|
|
}
|
2011-07-25 00:44:15 +01:00
|
|
|
@@ -2442,12 +2457,14 @@
|
2010-06-04 14:43:53 +01:00
|
|
|
if (no_events)
|
|
|
|
return;
|
|
|
|
|
|
|
|
+#if 0
|
|
|
|
/* Flush the Plymouth connection to ensure all updates are sent,
|
|
|
|
* since the event may kill plymouth.
|
|
|
|
*/
|
|
|
|
if (ply_boot_client)
|
|
|
|
ply_boot_client_flush (ply_boot_client);
|
|
|
|
-
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
env = NIH_MUST (nih_str_array_new (NULL));
|
|
|
|
|
|
|
|
if (mnt) {
|
2011-07-25 00:44:15 +01:00
|
|
|
@@ -3026,6 +3043,7 @@
|
2010-06-04 14:43:53 +01:00
|
|
|
int
|
|
|
|
plymouth_connect (void)
|
|
|
|
{
|
|
|
|
+#if 0
|
|
|
|
/* If we were already connected, just re-use that connection */
|
|
|
|
if (ply_boot_client)
|
|
|
|
return TRUE;
|
2011-07-25 00:44:15 +01:00
|
|
|
@@ -3052,8 +3070,13 @@
|
2010-06-04 14:43:53 +01:00
|
|
|
nih_info (_("Connected to Plymouth"));
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
+#else
|
|
|
|
+ return FALSE;
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+#if 0
|
|
|
|
void
|
|
|
|
plymouth_disconnected (void * user_data,
|
|
|
|
ply_boot_client_t *client)
|
2011-07-25 00:44:15 +01:00
|
|
|
@@ -3066,6 +3089,7 @@
|
2010-06-04 14:43:53 +01:00
|
|
|
ply_boot_client_free (ply_boot_client);
|
|
|
|
ply_boot_client = NULL;
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
|
|
|
void
|
2011-07-25 00:44:15 +01:00
|
|
|
@@ -3076,6 +3100,7 @@
|
2010-06-04 14:43:53 +01:00
|
|
|
|
|
|
|
nih_assert (mnt != NULL);
|
|
|
|
|
|
|
|
+#if 0
|
|
|
|
/* No Plymouth => no progress information */
|
|
|
|
if (! plymouth_connect ())
|
|
|
|
return;
|
2011-07-25 00:44:15 +01:00
|
|
|
@@ -3105,6 +3130,7 @@
|
2010-06-04 14:43:53 +01:00
|
|
|
plymouth_response,
|
|
|
|
plymouth_failed,
|
|
|
|
NULL);
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2011-07-25 00:44:15 +01:00
|
|
|
@@ -3120,20 +3146,31 @@
|
2010-06-04 14:43:53 +01:00
|
|
|
NIH_LIST_FOREACH (mounts, iter) {
|
|
|
|
Mount *mnt = (Mount *)iter;
|
|
|
|
|
|
|
|
- if (mnt->error <= ERROR_BORED)
|
2010-06-07 13:14:47 +01:00
|
|
|
+ if (mnt->error == ERROR_NONE)
|
2010-06-04 14:43:53 +01:00
|
|
|
continue;
|
|
|
|
|
2010-06-07 13:14:47 +01:00
|
|
|
- nih_error (_("Skipping mounting %s since Plymouth is not available"),
|
|
|
|
+ nih_error (_("Could not mount %s"),
|
|
|
|
MOUNT_NAME (mnt));
|
|
|
|
|
|
|
|
mnt->error = ERROR_NONE;
|
|
|
|
|
|
|
|
+ if (mnt->tag == TAG_LOCAL) {
|
|
|
|
+ num_local_failed++;
|
|
|
|
+ emit_event ("mount-failed", mnt);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (mnt->tag == TAG_REMOTE) {
|
|
|
|
+ num_remote_failed++;
|
|
|
|
+ emit_event ("mount-failed", mnt);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
skip_mount (mnt);
|
|
|
|
}
|
|
|
|
|
2010-06-04 14:43:53 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
+#if 0
|
|
|
|
/* If we're already displaying messages, don't change them unless
|
|
|
|
* the message is no longer valid for that mount point; otherwise
|
|
|
|
* clear the message.
|
2011-07-25 00:44:15 +01:00
|
|
|
@@ -3244,8 +3281,10 @@
|
2010-06-04 14:43:53 +01:00
|
|
|
plymouth_answer,
|
|
|
|
plymouth_failed,
|
|
|
|
NULL);
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
+#if 0
|
|
|
|
void
|
|
|
|
plymouth_response (void * user_data,
|
|
|
|
ply_boot_client_t *client)
|
2011-07-25 00:44:15 +01:00
|
|
|
@@ -3364,6 +3403,7 @@
|
2010-06-04 14:43:53 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
2011-07-25 00:44:15 +01:00
|
|
|
/*
|
|
|
|
* set_dev_wait_time:
|
|
|
|
@@ -3399,7 +3439,6 @@
|
|
|
|
return err;
|
|
|
|
}
|
2010-06-04 14:43:53 +01:00
|
|
|
|
2011-07-25 00:44:15 +01:00
|
|
|
-
|
2010-06-04 14:43:53 +01:00
|
|
|
/**
|
2011-07-25 00:44:15 +01:00
|
|
|
* stop_mountpoint_timer:
|
|
|
|
* @mountpoint: mountpoint whose timer you want to stop.
|
|
|
|
@@ -3673,6 +3712,7 @@
|
2010-06-04 14:43:53 +01:00
|
|
|
(NihIoWatcher)udev_monitor_watcher,
|
|
|
|
udev_monitor));
|
|
|
|
|
|
|
|
+#if 0
|
|
|
|
/* Initialise a Plymouth event loop; this is an epoll instance that
|
|
|
|
* we can poll within our own main loop and call out to when needs
|
|
|
|
* be.
|
2011-07-25 00:44:15 +01:00
|
|
|
@@ -3686,6 +3726,7 @@
|
2010-06-04 14:43:53 +01:00
|
|
|
|
|
|
|
/* Attempt an early connection to Plymouth */
|
|
|
|
plymouth_connect ();
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
mounts = NIH_MUST (nih_list_new (NULL));
|
|
|
|
|
2011-07-25 00:44:15 +01:00
|
|
|
@@ -3698,7 +3739,9 @@
|
2010-06-04 14:43:53 +01:00
|
|
|
* from /etc/fstab and /proc/self/mountinfo to find out what else
|
|
|
|
* we need to do.
|
|
|
|
*/
|
|
|
|
+#if 0
|
|
|
|
parse_fstab (BUILTIN_FSTAB);
|
|
|
|
+#endif
|
|
|
|
parse_fstab (_PATH_MNTTAB);
|
|
|
|
parse_mountinfo ();
|
|
|
|
|
2011-07-25 00:44:15 +01:00
|
|
|
@@ -3822,10 +3865,12 @@
|
2010-06-04 14:43:53 +01:00
|
|
|
/* Flush the D-Bus connection to ensure all messages are sent */
|
|
|
|
dbus_connection_flush (connection);
|
|
|
|
|
|
|
|
+#if 0
|
|
|
|
/* Flush the Plymouth connection to ensure all updates are sent */
|
|
|
|
if (ply_boot_client)
|
|
|
|
ply_boot_client_flush (ply_boot_client);
|
|
|
|
-
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|