X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=mount-setup.c;h=a0eb75ca6a14d6954c03c66d3669bd7b400b9551;hp=5a2e89af7c8fa25f456094b090399b5a008f2eeb;hb=b8c597d5d21e83966bdee8a701e6d994aaf650ee;hpb=dbd4655d8937fb870a6ec42889081ecd4b83ca98 diff --git a/mount-setup.c b/mount-setup.c index 5a2e89af7..a0eb75ca6 100644 --- a/mount-setup.c +++ b/mount-setup.c @@ -29,6 +29,8 @@ #include "mount-setup.h" #include "log.h" +#include "macro.h" +#include "util.h" enum { MOUNT_WHAT, @@ -39,12 +41,13 @@ enum { }; static const char *table[] = { - "/proc", "/proc", "proc", "rw", - "/sys", "/sys", "sysfs", "rw", - "udev", "/dev", "devtmpfs", "rw", - "tmpfs", "/dev/shm", "tmpfs", "rw", - "devpts", "/dev/pts", "devpts", "rw", - "cgroup", "/cgroup/debug", "cgroup", "debug", + "proc", "/proc", "proc", NULL, + "sysfs", "/sys", "sysfs", NULL, + "devtmps", "/dev", "devtmpfs", "mode=755", + "tmpfs", "/dev/shm", "tmpfs", "mode=1777", + "devpts", "/dev/pts", "devpts", NULL, + "cgroup", "/cgroup/debug", "cgroup", "debug", + "debugfs", "/sys/kernel/debug", "debugfs", NULL, NULL }; @@ -85,11 +88,15 @@ static int mount_one(const char *t[]) { if (r > 0) return 0; + /* The access mode here doesn't really matter too much, since + * the mounted file system will take precedence anyway. */ + mkdir(t[MOUNT_WHERE], 0755); + log_debug("Mounting %s to %s of type %s with options %s.", t[MOUNT_WHAT], t[MOUNT_WHERE], t[MOUNT_TYPE], - t[MOUNT_OPTIONS]); + strna(t[MOUNT_OPTIONS])); if (mount(t[MOUNT_WHAT], t[MOUNT_WHERE],