mirror of
https://github.com/troglobit/finit.git
synced 2026-10-17 10:49:34 +00:00
configure: Remove --enable-rw-rootfs detect using /etc/fstab instead
This patch removes the --enable-rw-rootfs build flag. Like OpenRC we now check /etc/fstab instad; if `/` is listed *and* doesn't have the `ro` flag set, we remount / read-write. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
7c8b0df720
commit
aa08221666
7 files changed
+30
-23
No files matched your search
+25
-5
@@ -433,7 +433,7 @@ int main(int argc, char *argv[])
|
||||
*/
|
||||
makedir("/dev/shm", 0755);
|
||||
if (!fismnt("/dev/shm") && !ismnt("/etc/fstab", "/dev/shm"))
|
||||
mount("shm", "/dev/shm", "tmpfs", 0, NULL);
|
||||
mount("shm", "/dev/shm", "tmpfs", 0, "mode=0777");
|
||||
|
||||
/*
|
||||
* New tmpfs based /run for volatile runtime data
|
||||
@@ -498,10 +498,30 @@ int main(int argc, char *argv[])
|
||||
* Mount filesystems
|
||||
*/
|
||||
if (!rescue) {
|
||||
#ifdef REMOUNT_ROOTFS
|
||||
run("mount -n -o remount,rw /");
|
||||
#endif
|
||||
#ifdef SYSROOT
|
||||
#ifndef SYSROOT
|
||||
/*
|
||||
* Remount / read-write if it exists in fstab is not 'ro'.
|
||||
* This is what the Debian sysv initscripts does.
|
||||
*/
|
||||
if (setfsent()) {
|
||||
struct fstab *fs;
|
||||
|
||||
while ((fs = getfsent())) {
|
||||
if (strcmp(fs->fs_file, "/"))
|
||||
continue;
|
||||
|
||||
if (strcmp(fs->fs_type, "ro"))
|
||||
run_interactive("mount -n -o remount,rw /", "Remounting / as read-write");
|
||||
break;
|
||||
}
|
||||
|
||||
endfsent();
|
||||
}
|
||||
#else
|
||||
/*
|
||||
* XXX: Untested, in the initramfs age we should
|
||||
* probably use switch_root instead.
|
||||
*/
|
||||
mount(SYSROOT, "/", NULL, MS_MOVE, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user