diff -Naur systemd-213.orig/src/core/main.c systemd-213/src/core/main.c
old
|
new
|
|
1170 | 1170 | "Please make sure to replace this file by a symlink to avoid incorrect or misleading mount(8) output."); |
1171 | 1171 | } |
1172 | 1172 | |
1173 | | static void test_usr(void) { |
1174 | | |
1175 | | /* Check that /usr is not a separate fs */ |
1176 | | |
1177 | | if (dir_is_empty("/usr") <= 0) |
1178 | | return; |
1179 | | |
1180 | | log_warning("/usr appears to be on its own filesytem and is not already mounted. This is not a supported setup. " |
1181 | | "Some things will probably break (sometimes even silently) in mysterious ways. " |
1182 | | "Consult http://freedesktop.org/wiki/Software/systemd/separate-usr-is-broken for more information."); |
1183 | | } |
1184 | | |
1185 | 1173 | static int initialize_join_controllers(void) { |
1186 | 1174 | /* By default, mount "cpu" + "cpuacct" together, and "net_cls" |
1187 | 1175 | * + "net_prio". We'd like to add "cpuset" to the mix, but |
… |
… |
|
1568 | 1556 | loopback_setup(); |
1569 | 1557 | |
1570 | 1558 | test_mtab(); |
1571 | | test_usr(); |
1572 | 1559 | } |
1573 | 1560 | |
1574 | 1561 | if (arg_running_as == SYSTEMD_SYSTEM && arg_runtime_watchdog > 0) |
diff -Naur systemd-213.orig/src/core/manager.c systemd-213/src/core/manager.c
old
|
new
|
|
501 | 501 | * here. We do that after deserialization, since they might |
502 | 502 | * have gotten serialized across the reexec. */ |
503 | 503 | |
504 | | m->taint_usr = dir_is_empty("/usr") > 0; |
505 | | |
506 | 504 | *_m = m; |
507 | 505 | return 0; |
508 | 506 | |
… |
… |
|
2211 | 2209 | else |
2212 | 2210 | m->n_failed_jobs += n; |
2213 | 2211 | |
2214 | | } else if (startswith(l, "taint-usr=")) { |
2215 | | int b; |
2216 | | |
2217 | | b = parse_boolean(l+10); |
2218 | | if (b < 0) |
2219 | | log_debug("Failed to parse taint /usr flag %s", l+10); |
2220 | | else |
2221 | | m->taint_usr = m->taint_usr || b; |
2222 | | |
2223 | 2212 | } else if (startswith(l, "firmware-timestamp=")) |
2224 | 2213 | dual_timestamp_deserialize(l+19, &m->firmware_timestamp); |
2225 | 2214 | else if (startswith(l, "loader-timestamp=")) |
diff -Naur systemd-213.orig/src/core/mount.c systemd-213/src/core/mount.c
old
|
new
|
|
353 | 353 | static bool should_umount(Mount *m) { |
354 | 354 | MountParameters *p; |
355 | 355 | |
356 | | if (path_equal(m->where, "/") || |
357 | | path_equal(m->where, "/usr")) |
| 356 | if (path_equal(m->where, "/")) |
358 | 357 | return false; |
359 | 358 | |
360 | 359 | p = get_mount_parameters(m); |
diff -Naur systemd-213.orig/src/core/umount.c systemd-213/src/core/umount.c
old
|
new
|
|
386 | 386 | * them. |
387 | 387 | * |
388 | 388 | * Mount points can be stacked. If a mount |
389 | | * point is stacked below / or /usr, we |
| 389 | * point is stacked below /, we |
390 | 390 | * cannot umount or remount it directly, |
391 | 391 | * since there is no way to refer to the |
392 | 392 | * underlying mount. There's nothing we can do |
… |
… |
|
400 | 400 | mount(NULL, m->path, NULL, MS_REMOUNT|MS_RDONLY, NULL); |
401 | 401 | } |
402 | 402 | |
403 | | /* Skip / and /usr since we cannot unmount that |
404 | | * anyway, since we are running from it. They have |
| 403 | /* Skip / since we cannot unmount that |
| 404 | * anyway, since we are running from it. It has |
405 | 405 | * already been remounted ro. */ |
406 | | if (path_equal(m->path, "/") |
407 | | #ifndef HAVE_SPLIT_USR |
408 | | || path_equal(m->path, "/usr") |
409 | | #endif |
410 | | ) |
| 406 | if (path_equal(m->path, "/")) |
411 | 407 | continue; |
412 | 408 | |
413 | 409 | /* Trying to umount. We don't force here since we rely |
diff -Naur systemd-213.orig/src/fstab-generator/fstab-generator.c systemd-213/src/fstab-generator/fstab-generator.c
old
|
new
|
|
151 | 151 | fstype_is_network(me->mnt_type); |
152 | 152 | } |
153 | 153 | |
154 | | static bool mount_in_initrd(struct mntent *me) { |
155 | | assert(me); |
156 | | |
157 | | return |
158 | | hasmntopt(me, "x-initrd.mount") || |
159 | | streq(me->mnt_dir, "/usr"); |
160 | | } |
161 | | |
162 | 154 | static int add_mount( |
163 | 155 | const char *what, |
164 | 156 | const char *where, |
… |
… |
|
340 | 332 | _cleanup_free_ char *where = NULL, *what = NULL; |
341 | 333 | int k; |
342 | 334 | |
343 | | if (initrd && !mount_in_initrd(me)) |
| 335 | if (initrd) |
344 | 336 | continue; |
345 | 337 | |
346 | 338 | what = fstab_node_to_udev_node(me->mnt_fsname); |
… |
… |
|
375 | 367 | |
376 | 368 | if (initrd) |
377 | 369 | post = SPECIAL_INITRD_FS_TARGET; |
378 | | else if (mount_in_initrd(me)) |
379 | | post = SPECIAL_INITRD_ROOT_FS_TARGET; |
380 | 370 | else if (mount_is_network(me)) |
381 | 371 | post = SPECIAL_REMOTE_FS_TARGET; |
382 | 372 | else |
diff -Naur systemd-213.orig/src/remount-fs/remount-fs.c systemd-213/src/remount-fs/remount-fs.c
old
|
new
|
|
77 | 77 | int k; |
78 | 78 | char *s; |
79 | 79 | |
80 | | /* Remount the root fs, /usr and all API VFS */ |
| 80 | /* Remount the root fs and all API VFS */ |
81 | 81 | if (!mount_point_is_api(me->mnt_dir) && |
82 | | !path_equal(me->mnt_dir, "/") && |
83 | | !path_equal(me->mnt_dir, "/usr")) |
| 82 | !path_equal(me->mnt_dir, "/")) |
84 | 83 | continue; |
85 | 84 | |
86 | 85 | log_debug("Remounting %s", me->mnt_dir); |