mirror of
https://github.com/troglobit/finit.git
synced 2026-11-01 13:10:32 +00:00
Merge branch 'master' of cmatsuoka@helllabs.org:git/eeepc
Conflicts: Changelog finit-mod.c Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
This commit is contained in:
commit
996cb2ec1e
9 files changed
+136
-79
No files matched your search
+14
-12
@@ -91,6 +91,7 @@ THE SOFTWARE.
|
||||
#define chardev(x,m,maj,min) mknod((x), S_IFCHR|(m), makedev((maj),(min)))
|
||||
#define blkdev(x,m,maj,min) mknod((x), S_IFBLK|(m), makedev((maj),(min)))
|
||||
|
||||
#define LINE_SIZE 1024
|
||||
|
||||
void shutdown(int);
|
||||
void signal_handler(int);
|
||||
@@ -101,13 +102,11 @@ int main()
|
||||
{
|
||||
int i;
|
||||
FILE *f;
|
||||
char line[2096];
|
||||
char line[LINE_SIZE];
|
||||
int fd;
|
||||
DIR *dir;
|
||||
struct dirent *d;
|
||||
char filename[1024];
|
||||
struct sigaction sa, act;
|
||||
char hline[1024];
|
||||
char *x;
|
||||
sigset_t nmask, nmask2;
|
||||
|
||||
@@ -145,7 +144,7 @@ int main()
|
||||
* Parse kernel parameters
|
||||
*/
|
||||
if ((f = fopen("/proc/cmdline", "r")) != NULL) {
|
||||
fgets(line, 2095, f);
|
||||
fgets(line, LINE_SIZE, f);
|
||||
if (strstr(line, "quiet")) {
|
||||
close(0);
|
||||
close(1);
|
||||
@@ -166,8 +165,10 @@ int main()
|
||||
#endif
|
||||
umask(0);
|
||||
|
||||
#ifdef MAKE_DEVICES
|
||||
mkdir("/dev/shm", 0755);
|
||||
mkdir("/dev/pts", 0755);
|
||||
#endif
|
||||
|
||||
mount("sysfs", "/sys", "sysfs", 0, NULL);
|
||||
mount("devpts", "/dev/pts", "devpts", 0, "gid=5,mode=620");
|
||||
@@ -187,6 +188,7 @@ int main()
|
||||
chmod("/dev/null", 0667);
|
||||
chmod("/dev/mem", 0640);
|
||||
chardev("/dev/tty", 0666, 5, 0);
|
||||
chardev("/dev/tty3", 0666, 4, 3);
|
||||
chardev("/dev/input/mice", 0660, 13, 63);
|
||||
chardev("/dev/input/event0", 0660, 13, 64);
|
||||
chardev("/dev/agpgart", 0660, 10, 175);
|
||||
@@ -194,7 +196,7 @@ int main()
|
||||
#endif
|
||||
|
||||
unlink("/etc/mtab");
|
||||
system("mount -a"); /* must be after creation of /dev/loop0 */
|
||||
system("mount -a");
|
||||
|
||||
umask(0022);
|
||||
|
||||
@@ -219,9 +221,9 @@ int main()
|
||||
while ((d = readdir(dir)) != NULL) {
|
||||
if (isalnum(d->d_name[0]))
|
||||
continue;
|
||||
sprintf(filename, "/etc/resolvconf/run/interface/%s",
|
||||
d->d_name);
|
||||
unlink(filename);
|
||||
snprintf(line, LINE_SIZE,
|
||||
"/etc/resolvconf/run/interface/%s", d->d_name);
|
||||
unlink(line);
|
||||
}
|
||||
|
||||
closedir(dir);
|
||||
@@ -243,11 +245,11 @@ int main()
|
||||
#endif
|
||||
|
||||
if ((f = fopen("/etc/hostname", "r")) != NULL) {
|
||||
fgets(hline, 1023, f);
|
||||
if ((x = strchr(hline, 0x0a)) != NULL)
|
||||
fgets(line, LINE_SIZE, f);
|
||||
if ((x = strchr(line, 0x0a)) != NULL)
|
||||
*x = 0;
|
||||
|
||||
sethostname(hline, strlen(hline));
|
||||
sethostname(line, strlen(line));
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
@@ -294,7 +296,7 @@ int main()
|
||||
close(1);
|
||||
close(0);
|
||||
|
||||
if (open("/dev/tty1", O_RDWR, 0))
|
||||
if (open("/dev/tty1", O_RDWR) != 0)
|
||||
exit(1);
|
||||
|
||||
sigemptyset(&act.sa_mask);
|
||||
|
||||
Reference in new issue
Block a user