chiark / gitweb /
fstab-generator: set "ro" as default for sysroot.mount
[elogind.git] / src / fstab-generator / fstab-generator.c
index ad26acb14a526466404d5592341bf46a113faa50..5c34de1155f90dccd60fe005b9c19098226f1dbe 100644 (file)
@@ -178,7 +178,9 @@ static bool mount_is_bind(struct mntent *me) {
 
         return
                 hasmntopt(me, "bind") ||
-                streq(me->mnt_type, "bind");
+                streq(me->mnt_type, "bind") ||
+                hasmntopt(me, "rbind") ||
+                streq(me->mnt_type, "rbind");
 }
 
 static bool mount_is_network(struct mntent *me) {
@@ -447,7 +449,7 @@ static int parse_new_root_from_proc_cmdline(void) {
                 return 0;
         }
 
-        opts = strdup("defaults");
+        opts = strdup("ro");
         type = strdup("auto");
         if (!opts || !type)
                 return log_oom();
@@ -495,8 +497,8 @@ static int parse_new_root_from_proc_cmdline(void) {
 
         if (what) {
 
-                log_debug("Found entry what=%s where=/new_root type=%s", what, type);
-                r = add_mount(what, "/new_root", type, opts, 0, wait, false, false,
+                log_debug("Found entry what=%s where=/sysroot type=%s", what, type);
+                r = add_mount(what, "/sysroot", type, opts, 0, wait, false, false,
                               false, false, false, "/proc/cmdline");
 
                 if (r < 0)