[BusyBox] init/askfirst
Richard Kojedzinszky
krichy at tvnetwork.hu
Sat Jan 15 12:04:19 UTC 2005
Dear all,
I am using busybox 1.00 with uclibc 0.9.26, and noted that as uclibc does
not define __ARCH_HAS_MMU__ in any .h files, the askfirst section is not
compiled in init/init.c. Thus, in my env, on all four terminals a shell is
spawned, instead of waiting for an enter. I attached a patch, which solves
the problem, but maybe not this is the correct solution.
Regards,
Kojedzinszky Richard
TvNetWork Rt.
E-mail: krichy at tvnetwork.hu
PGP: 0x24E79141
Fingerprint = 6847 ECFF EF58 0C09 18A5 16CF 270F 0C6F 24E7 9141
-------------- next part --------------
--- busybox-1.00/init/init.c.orig 2005-01-15 12:59:46.000000000 +0100
+++ busybox-1.00/init/init.c 2005-01-15 13:00:21.000000000 +0100
@@ -577,7 +577,7 @@
}
}
-#if !defined(__UCLIBC__) || defined(__ARCH_HAS_MMU__)
+#if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__)
if (a->action & ASKFIRST) {
char c;
/*
@@ -917,7 +917,7 @@
if (check_free_memory() > 1000)
return;
-#if !defined(__UCLIBC__) || defined(__ARCH_HAS_MMU__)
+#if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__)
if (stat("/etc/fstab", &statBuf) == 0) {
/* swapon -a requires /proc typically */
new_init_action(SYSINIT, "/bin/mount -t proc proc /proc", "");
@@ -962,7 +962,7 @@
new_init_action(CTRLALTDEL, "/sbin/reboot", "");
/* Umount all filesystems on halt/reboot */
new_init_action(SHUTDOWN, "/bin/umount -a -r", "");
-#if !defined(__UCLIBC__) || defined(__ARCH_HAS_MMU__)
+#if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__)
/* Swapoff on halt/reboot */
new_init_action(SHUTDOWN, "/sbin/swapoff -a", "");
#endif
--- busybox-1.00/shell/hush.c.orig 2005-01-15 13:01:09.000000000 +0100
+++ busybox-1.00/shell/hush.c 2005-01-15 13:01:17.000000000 +0100
@@ -1439,7 +1439,7 @@
}
/* XXX test for failed fork()? */
-#if !defined(__UCLIBC__) || defined(__ARCH_HAS_MMU__)
+#if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__)
if (!(child->pid = fork()))
#else
if (!(child->pid = vfork()))
@@ -2258,7 +2258,7 @@
#if 1
int pid, channel[2];
if (pipe(channel)<0) bb_perror_msg_and_die("pipe");
-#if !defined(__UCLIBC__) || defined(__ARCH_HAS_MMU__)
+#if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__)
pid=fork();
#else
pid=vfork();
--- busybox-1.00/shell/lash.c.orig 2005-01-15 13:01:33.000000000 +0100
+++ busybox-1.00/shell/lash.c 2005-01-15 13:01:41.000000000 +0100
@@ -1381,7 +1381,7 @@
}
}
-#if !defined(__UCLIBC__) || defined(__ARCH_HAS_MMU__)
+#if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__)
if (!(child->pid = fork()))
#else
if (!(child->pid = vfork()))
More information about the busybox
mailing list