<p dir="ltr">For overlayfs you need to check overlayfs and overlay.</p>
<div class="gmail_quote">24 марта 2015 г. 1:52 пользователь "Tobias Hunger" <<a href="mailto:tobias.hunger@gmail.com">tobias.hunger@gmail.com</a>> написал:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This allows for stateless systems.<br>
---<br>
src/fstab-generator/fstab-generator.c | 21 +++++++++++++--------<br>
src/shared/util.c | 30 ++++++++++++++++++++++++++++++<br>
src/shared/util.h | 1 +<br>
3 files changed, 44 insertions(+), 8 deletions(-)<br>
<br>
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c<br>
index 2ece12f..77c97fd 100644<br>
--- a/src/fstab-generator/fstab-generator.c<br>
+++ b/src/fstab-generator/fstab-generator.c<br>
@@ -397,15 +397,20 @@ static int add_root_mount(void) {<br>
_cleanup_free_ char *what = NULL;<br>
const char *opts;<br>
<br>
- if (isempty(arg_root_what)) {<br>
- log_debug("Could not find a root= entry on the kernel command line.");<br>
- return 0;<br>
- }<br>
+ if (fstype_is_deviceless(arg_root_fstype)) {<br>
+ if (free_and_strdup(&what, arg_root_what) < 0)<br>
+ return log_oom();<br>
+ } else {<br>
+ if (isempty(arg_root_what)) {<br>
+ log_debug("Could not find a root= entry on the kernel command line.");<br>
+ return 0;<br>
+ }<br>
<br>
- what = fstab_node_to_udev_node(arg_root_what);<br>
- if (!path_is_absolute(what)) {<br>
- log_debug("Skipping entry what=%s where=/sysroot type=%s", what, strna(arg_root_fstype));<br>
- return 0;<br>
+ what = fstab_node_to_udev_node(arg_root_what);<br>
+ if (!path_is_absolute(what)) {<br>
+ log_debug("Skipping entry what=%s where=/sysroot type=%s", what, strna(arg_root_fstype));<br>
+ return 0;<br>
+ }<br>
}<br>
<br>
if (!arg_root_options)<br>
diff --git a/src/shared/util.c b/src/shared/util.c<br>
index ad548da..cb03527 100644<br>
--- a/src/shared/util.c<br>
+++ b/src/shared/util.c<br>
@@ -1713,6 +1713,36 @@ bool fstype_is_network(const char *fstype) {<br>
return nulstr_contains(table, fstype);<br>
}<br>
<br>
+bool fstype_is_deviceless(const char *fstype) {<br>
+ static const char table[] =<br>
+ "autofs\0"<br>
+ "bdev\0"<br>
+ "cgroup\0"<br>
+ "configfs\0"<br>
+ "cpuset\0"<br>
+ "debugfs\0"<br>
+ "devpts\0"<br>
+ "devtmpfs\0"<br>
+ "efivarfs\0"<br>
+ "hugetlbfs\0"<br>
+ "mqueue\0"<br>
+ "nfs\0"<br>
+ "nfs4\0"<br>
+ "overlayfs\0"<br>
+ "pipefs\0"<br>
+ "proc\0"<br>
+ "pstore\0"<br>
+ "ramfs\0"<br>
+ "rootfs\0"<br>
+ "rpc_pipefs\0"<br>
+ "securityfs\0"<br>
+ "sockfs\0"<br>
+ "sysfs\0"<br>
+ "tmpfs\0";<br>
+<br>
+ return nulstr_contains(table, fstype);<br>
+}<br>
+<br>
int chvt(int vt) {<br>
_cleanup_close_ int fd;<br>
<br>
diff --git a/src/shared/util.h b/src/shared/util.h<br>
index 29e85bb..b5f44b8 100644<br>
--- a/src/shared/util.h<br>
+++ b/src/shared/util.h<br>
@@ -409,6 +409,7 @@ int fd_cloexec(int fd, bool cloexec);<br>
int close_all_fds(const int except[], unsigned n_except);<br>
<br>
bool fstype_is_network(const char *fstype);<br>
+bool fstype_is_deviceless(const char *fstype);<br>
<br>
int chvt(int vt);<br>
<br>
--<br>
2.3.3<br>
<br>
_______________________________________________<br>
systemd-devel mailing list<br>
<a href="mailto:systemd-devel@lists.freedesktop.org">systemd-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/systemd-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/systemd-devel</a><br>
</blockquote></div>