Hier der leicht modifizierte busybox.diff
Gruss Houdini
diff -Naur busybox/init/init.c busybox_patch/init/init.c
--- busybox/init/init.c 2004-03-15 09:28:40.000000000 +0100
+++ busybox_patch/init/init.c 2004-04-13 19:04:58.000000000 +0200
@@ -376,7 +376,7 @@
while ((fd = open(console, O_RDONLY | O_NONBLOCK)) < 0 && tried < 2) {
/* Can't open selected console -- try
logical system console and VT_MASTER */
- safe_strncpy(console, (tried == 0 ? _PATH_CONSOLE : CURRENT_VC),
+ safe_strncpy(console, (tried == 0 ? _PATH_CONSOLE : "/dev/tty0"),
sizeof(console));
tried++;
}
@@ -629,15 +629,12 @@
pid = run(a);
while (1) {
- wpid = waitpid(pid,&status,0);
+ wpid = wait(&status);
+ if (wpid > 0 && wpid != pid) {
+ continue;
+ }
if (wpid == pid)
break;
- if (wpid == -1 && errno == ECHILD) {
- /* we missed its termination */
- break;
- }
- /* FIXME other errors should maybe trigger an error, but allow
- * the program to continue */
}
return wpid;
}
diff -Naur busybox/libbb/messages.c busybox_patch/libbb/messages.c
--- busybox/libbb/messages.c 2004-03-15 09:28:42.000000000 +0100
+++ busybox_patch/libbb/messages.c 2004-04-13 19:04:58.000000000 +0200
@@ -56,27 +56,47 @@
#endif
#ifdef L_passwd_file
-#define PASSWD_FILE "/etc/passwd"
+#ifdef CONFIG_AUTH_IN_VAR_ETC
+ #define PASSWD_FILE "/var/etc/passwd"
+#else
+ #define PASSWD_FILE "/etc/passwd"
+#endif
const char * const bb_path_passwd_file = PASSWD_FILE;
#endif
#ifdef L_shadow_file
-#define SHADOW_FILE "/etc/shadow"
+#ifdef CONFIG_AUTH_IN_VAR_ETC
+ #define SHADOW_FILE "/var/etc/shadow"
+#else
+ #define SHADOW_FILE "/etc/shadow"
+#endif
const char * const bb_path_shadow_file = SHADOW_FILE;
#endif
#ifdef L_group_file
-#define GROUP_FILE "/etc/group"
+#ifdef CONFIG_AUTH_IN_VAR_ETC
+ #define GROUP_FILE "/var/etc/group"
+#else
+ #define GROUP_FILE "/etc/group"
+#endif
const char * const bb_path_group_file = GROUP_FILE;
#endif
#ifdef L_gshadow_file
-#define GSHADOW_FILE "/etc/gshadow"
+#ifdef CONFIG_AUTH_IN_VAR_ETC
+ #define GSHADOW_FILE "/var/etc/gshadow"
+#else
+ #define GSHADOW_FILE "/etc/gshadow"
+#endif
const char * const bb_path_gshadow_file = GSHADOW_FILE;
#endif
#ifdef L_nologin_file
-#define NOLOGIN_FILE "/etc/nologin"
+#ifdef CONFIG_AUTH_IN_VAR_ETC
+ #define NOLOGIN_FILE "/var/etc/nologin"
+#else
+ #define NOLOGIN_FILE "/etc/nologin"
+#endif
const char * const bb_path_nologin_file = NOLOGIN_FILE;
#endif
diff -Naur busybox/networking/ifupdown.c busybox_patch/networking/ifupdown.c
--- busybox/networking/ifupdown.c 2004-03-15 09:28:48.000000000 +0100
+++ busybox_patch/networking/ifupdown.c 2004-10-14 22:19:22.000000000 +0200
@@ -1023,7 +1023,7 @@
static int execute_all(struct interface_defn_t *ifd, execfn *exec, const char *opt)
{
- int i;
+ int i, fd;
char *buf;
for (i = 0; i < ifd->n_options; i++) {
if (strcmp(ifd->option.name, opt) == 0) {
@@ -1033,10 +1033,15 @@
}
}
- bb_xasprintf(&buf, "run-parts /etc/network/if-%s.d", opt);
- if ((*exec)(buf) != 1) {
- return 0;
+ bb_xasprintf(&buf, "/etc/network/if-%s.d", opt);
+ if ((fd = open(buf, O_RDONLY)) >= 0) {
+ close(fd);
+ bb_xasprintf(&buf, "run-parts /etc/network/if-%s.d", opt);
+ if ((*exec)(buf) != 1) {
+ return 0;
+ }
}
+
return 1;
}
diff -Naur busybox/sysdeps/linux/Config.in busybox_patch/sysdeps/linux/Config.in
--- busybox/sysdeps/linux/Config.in 2004-03-15 09:29:15.000000000 +0100
+++ busybox_patch/sysdeps/linux/Config.in 2004-04-13 19:04:58.000000000 +0200
@@ -195,6 +195,14 @@
if you want to add some simple compiler switches (like -march=i686),
or check for warnings using -Werror, just those options here.
+config CONFIG_AUTH_IN_VAR_ETC
+ bool "Search auth files in /var/etc"
+ default n
+ help
+ passwd, shadow, group, gshadow and nologin will be searched in
+ /var/etc instead of /etc. This is usefull, if /etc is not
+ writeable (flash).
+
endmenu
menu 'Installation Options'
Busybox 1.00 release
-
- Developer
- Beiträge: 2183
- Registriert: Mittwoch 10. Dezember 2003, 07:59
-
- Image-Team
- Beiträge: 1015
- Registriert: Freitag 7. Februar 2003, 18:37
-
- Developer
- Beiträge: 2183
- Registriert: Mittwoch 10. Dezember 2003, 07:59
-
- Image-Team
- Beiträge: 1015
- Registriert: Freitag 7. Februar 2003, 18:37
-
- Developer
- Beiträge: 2183
- Registriert: Mittwoch 10. Dezember 2003, 07:59
Folgender Bereich hat sich noch zu 1.00 geändert und könnte noch angepasst werden:
- bb_xasprintf(&buf, "run-parts /etc/network/if-%s.d", opt);
- if ((*exec)(buf) != 1) {
- return 0;
+ bb_xasprintf(&buf, "/etc/network/if-%s.d", opt);
+ if ((fd = open(buf, O_RDONLY)) >= 0) {
+ close(fd);
+ bb_xasprintf(&buf, "run-parts /etc/network/if-%s.d", opt);
+ if ((*exec)(buf) != 1) {
+ return 0;
+ }
Houdini
- bb_xasprintf(&buf, "run-parts /etc/network/if-%s.d", opt);
- if ((*exec)(buf) != 1) {
- return 0;
+ bb_xasprintf(&buf, "/etc/network/if-%s.d", opt);
+ if ((fd = open(buf, O_RDONLY)) >= 0) {
+ close(fd);
+ bb_xasprintf(&buf, "run-parts /etc/network/if-%s.d", opt);
+ if ((*exec)(buf) != 1) {
+ return 0;
+ }
Houdini
-
- Neugieriger
- Beiträge: 4
- Registriert: Sonntag 5. Oktober 2003, 09:48
Found I needed this also for 2.6 kernel:
Code: Alles auswählen
--- busybox-1.00-rc3-orig/modutils/lsmod.c 2004-03-15 19:28:47.000000000 +1100
+++ busybox-1.00-rc3/modutils/lsmod.c 2004-09-24 21:51:31.000000000 +1000
@@ -38,6 +38,9 @@
#include <sys/file.h>
#include "busybox.h"
+#ifdef CONFIG_FEATURE_2_6_MODULES
+#undef CONFIG_FEATURE_QUERY_MODULE_INTERFACE
+#endif
#ifndef CONFIG_FEATURE_CHECK_TAINTED_MODULE
static inline void check_tainted(void) { printf("\n"); }
@@ -112,7 +115,6 @@
deps = xmalloc(depsize = 256);
printf("Module Size Used by");
check_tainted();
-
for (i = 0, mn = module_names; i < nmod; mn += strlen(mn) + 1, i++) {
if (query_module(mn, QM_INFO, &info, sizeof(info), &count)) {
if (errno == ENOENT) {
-
- Image-Team
- Beiträge: 1015
- Registriert: Freitag 7. Februar 2003, 18:37
Das ist ja schon fast drin. mach doch einfach ma noch ein diff deiner änderungen und schik es mir per MailHoudini hat geschrieben:Folgender Bereich hat sich noch zu 1.00 geändert und könnte noch angepasst werden:
- bb_xasprintf(&buf, "run-parts /etc/network/if-%s.d", opt);
- if ((*exec)(buf) != 1) {
- return 0;
+ bb_xasprintf(&buf, "/etc/network/if-%s.d", opt);
+ if ((fd = open(buf, O_RDONLY)) >= 0) {
+ close(fd);
+ bb_xasprintf(&buf, "run-parts /etc/network/if-%s.d", opt);
+ if ((*exec)(buf) != 1) {
+ return 0;
+ }
Houdini
Riker