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=4a5e2cc760abcc363bc78f0c1c4761c294869f66;hb=b8c597d5d21e83966bdee8a701e6d994aaf650ee;hpb=8e27452380193a5f81bfd08a59aab8b07008ba0b diff --git a/mount-setup.c b/mount-setup.c index 4a5e2cc76..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,9 +41,13 @@ enum { }; static const char *table[] = { - "/proc", "/proc", "proc", "rw", - "/sys", "/sys", "sysfs", "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 }; @@ -82,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],