+ if (!mkdtemp(temporary_mount))
+ return -errno;
+
+ dev = strappenda(temporary_mount, "/dev");
+ mkdir(dev, 0755);
+ if (mount("tmpfs", dev, "tmpfs", MS_NOSUID|MS_STRICTATIME, "mode=755") < 0) {
+ r = -errno;
+ goto fail;
+ }
+
+ devpts = strappenda(temporary_mount, "/dev/pts");
+ mkdir(devpts, 0755);
+ if (mount("/dev/pts", devpts, NULL, MS_BIND, NULL) < 0) {
+ r = -errno;
+ goto fail;
+ }
+
+ devptmx = strappenda(temporary_mount, "/dev/ptmx");
+ symlink("pts/ptmx", devptmx);
+
+ devshm = strappenda(temporary_mount, "/dev/shm");
+ mkdir(devshm, 01777);
+ r = mount("/dev/shm", devshm, NULL, MS_BIND, NULL);
+ if (r < 0) {
+ r = -errno;
+ goto fail;
+ }
+
+ devmqueue = strappenda(temporary_mount, "/dev/mqueue");
+ mkdir(devmqueue, 0755);
+ mount("/dev/mqueue", devmqueue, NULL, MS_BIND, NULL);
+
+ devkdbus = strappenda(temporary_mount, "/dev/kdbus");
+ mkdir(devkdbus, 0755);
+ mount("/dev/kdbus", devkdbus, NULL, MS_BIND, NULL);
+
+ devhugepages = strappenda(temporary_mount, "/dev/hugepages");
+ mkdir(devhugepages, 0755);
+ mount("/dev/hugepages", devhugepages, NULL, MS_BIND, NULL);
+
+ devlog = strappenda(temporary_mount, "/dev/log");
+ symlink("/run/systemd/journal/dev-log", devlog);
+