mirror of
https://github.com/troglobit/finit.git
synced 2026-10-28 12:30:44 +00:00
Drop configuration file, use mount -a to mount /home
Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
This commit is contained in:
1 parent
2fb32d1c63
commit
fd56a4d2f7
1 file changed
+2
-26
@@ -120,7 +120,6 @@ int main()
|
|||||||
char hline[1024];
|
char hline[1024];
|
||||||
char *x;
|
char *x;
|
||||||
sigset_t nmask, nmask2;
|
sigset_t nmask, nmask2;
|
||||||
char defuser[64], homedev[64];
|
|
||||||
|
|
||||||
puts("finit " VERSION);
|
puts("finit " VERSION);
|
||||||
|
|
||||||
@@ -150,27 +149,8 @@ int main()
|
|||||||
|
|
||||||
reboot(RB_DISABLE_CAD);
|
reboot(RB_DISABLE_CAD);
|
||||||
|
|
||||||
strncpy(homedev, "", 64);
|
|
||||||
strncpy(defuser, DEFUSER, 64);
|
|
||||||
|
|
||||||
mount("proc", "/proc", "proc", 0, NULL);
|
mount("proc", "/proc", "proc", 0, NULL);
|
||||||
|
|
||||||
/*
|
|
||||||
* Parse conf file
|
|
||||||
*/
|
|
||||||
if ((f = fopen("/etc/finit.conf", "r")) != NULL) {
|
|
||||||
while(!feof(f)) {
|
|
||||||
fgets(line, 2095, f);
|
|
||||||
if (!strncmp(line, "home=", 5)) {
|
|
||||||
strncpy(homedev, line + 5, 64);
|
|
||||||
} else if (!strncmp(line, "user=", 5)) {
|
|
||||||
strncpy(defuser, line + 5, 64);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
debug("home = %s", homedev);
|
|
||||||
debug("user = %s", defuser);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Parse kernel parameters
|
* Parse kernel parameters
|
||||||
*/
|
*/
|
||||||
@@ -203,14 +183,10 @@ int main()
|
|||||||
mount("devpts", "/dev/pts", "devpts", 0, "gid=5,mode=620");
|
mount("devpts", "/dev/pts", "devpts", 0, "gid=5,mode=620");
|
||||||
mount("tmpfs", "/dev/shm", "tmpfs", 0, NULL);
|
mount("tmpfs", "/dev/shm", "tmpfs", 0, NULL);
|
||||||
mount("tmpfs", "/tmp", "tmpfs", 0, "mode=1777,size=128m");
|
mount("tmpfs", "/tmp", "tmpfs", 0, "mode=1777,size=128m");
|
||||||
|
|
||||||
if (strlen(homedev)) {
|
|
||||||
debug("mount home at %s", homedev);
|
|
||||||
mount(homedev, "/home", "ext3", 0, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
mount(SYSROOT, "/", NULL, MS_MOVE, NULL);
|
mount(SYSROOT, "/", NULL, MS_MOVE, NULL);
|
||||||
|
|
||||||
|
system("mount -a");
|
||||||
|
|
||||||
#ifdef MAKE_DEVICES
|
#ifdef MAKE_DEVICES
|
||||||
debug("make devices");
|
debug("make devices");
|
||||||
mkdir("/dev/input", 0755);
|
mkdir("/dev/input", 0755);
|
||||||
|
|||||||
Reference in new issue
Block a user