finit-mdv checks filesystem if CHECKFS= parameter specified

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
This commit is contained in:
Claudio Matsuoka
2008-04-24 16:05:46 -03:00
parent 7caf633259
commit d87fb47cf3
2 changed files with 17 additions and 3 deletions
+3 -3
View File
@@ -2,12 +2,12 @@ O.4 ()
- default username for finit-alt configurable in Makefile
- create loopback device node in finit-alt (for squashfs)
- add option to use built-in run-parts instead of /bin/run-parts
<<<<<<< HEAD:Changelog
- ignore signal instead of setting to an empty handler (Metalshark)
- handle pam_console permissions in finit-alt for Mandriva
=======
- add services.sh example and nash-hotplug patch for Mandriva
>>>>>>> a3ad99798e6ade97a981adf5b4376e758c97b894:Changelog
- mount /proc/bus/usb in Mandriva
- finit-mdv checks filesystem if CHECKFS= parameter is specified
0.3 (20080223)
- Change poweroff method to reboot(RB_POWER_OFF) (Metalshark)
+14
View File
@@ -62,6 +62,7 @@ THE SOFTWARE.
#define REMOUNT_ROOTFS_RW
#define MAKE_DEVICES
#define PAM_CONSOLE
#define CHECK_FS
#else /* original Eeepc distribution */
#define RANDOMSEED "/var/lib/urandom/random-seed"
#define SYSROOT "/mnt"
@@ -144,12 +145,25 @@ int main()
* Parse kernel parameters
*/
if ((f = fopen("/proc/cmdline", "r")) != NULL) {
char *x;
fgets(line, LINE_SIZE, f);
if (strstr(line, "quiet")) {
close(0);
close(1);
close(2);
}
#ifdef CHECK_FS
if ((x = strstr(line, "CHECKFS="))) {
char *c, cmd[256];
strncpy(cmd, "e2fsck -C -p -f ", LINE_SIZE);
c = cmd + strlen(cmd);
while (x && *x != ' ') *c++ = *x++;
system(cmd);
sync();
sync();
reboot(RB_AUTOBOOT);
}
#endif
fclose(f);
}