Run fsck earlier and print only first 13 chars

Run fsck much earlier, as soon as we can in fact.

The first 13 characters of the UUID, label or device name should
be sufficient to identify the device, without violating max width
of 78 chars.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2016-08-01 23:51:11 +02:00
1 parent f374f443f4
commit 7eac88b639
1 file changed
+9 -9
+9 -9
View File
@@ -100,7 +100,7 @@ static int fsck(int pass)
}
snprintf(cmd, sizeof(cmd), "/sbin/fsck -C -a %s", fs->fs_spec);
run_interactive(cmd, "Checking file system %s", fs->fs_spec);
run_interactive(cmd, "Checking filesystem %13.13s", fs->fs_spec);
}
endfsent();
@@ -222,6 +222,14 @@ int main(int argc, char* argv[])
uev_init(&loop);
ctx = &loop;
/*
* Check file filesystems in /etc/fstab
*/
for (int pass = 1; pass < 10; pass++) {
if (fsck(pass))
break;
}
/*
* Mount base file system, kernel is assumed to run devtmpfs for /dev
*/
@@ -268,14 +276,6 @@ int main(int argc, char* argv[])
#endif
run_interactive(SETUP_DEVFS, "Populating device tree");
/*
* Check file filesystems in /etc/fstab
*/
for (int pass = 1; pass < 10; pass++) {
if (fsck(pass))
break;
}
/*
* Load plugins first, finit.conf may contain references to
* features implemented by plugins.