mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07:00
finit-mdv checks filesystem if CHECKFS= parameter specified
Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
This commit is contained in:
@@ -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
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user