summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/insmod-busybox
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2001-01-04 20:04:45 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2001-01-04 20:04:45 +0000
commit02fec4701cee79f875c1d02b8b4aee09380dbcb8 (patch)
treef4f291aedbb2e60ee58351481858a8cd3ec80b6b /mdk-stage1/insmod-busybox
parent9887fe04751edf39e8389f2c3ec3f020b5e1c17d (diff)
downloaddrakx-02fec4701cee79f875c1d02b8b4aee09380dbcb8.tar
drakx-02fec4701cee79f875c1d02b8b4aee09380dbcb8.tar.gz
drakx-02fec4701cee79f875c1d02b8b4aee09380dbcb8.tar.bz2
drakx-02fec4701cee79f875c1d02b8b4aee09380dbcb8.tar.xz
drakx-02fec4701cee79f875c1d02b8b4aee09380dbcb8.zip
integrate dietlibc/stdio per default for cdrom and disk only installs
Diffstat (limited to 'mdk-stage1/insmod-busybox')
-rw-r--r--mdk-stage1/insmod-busybox/Makefile29
-rw-r--r--mdk-stage1/insmod-busybox/busybox.h4
-rw-r--r--mdk-stage1/insmod-busybox/insmod.c13
-rw-r--r--mdk-stage1/insmod-busybox/utility.c24
4 files changed, 41 insertions, 29 deletions
diff --git a/mdk-stage1/insmod-busybox/Makefile b/mdk-stage1/insmod-busybox/Makefile
index 451e3b262..ca05279e9 100644
--- a/mdk-stage1/insmod-busybox/Makefile
+++ b/mdk-stage1/insmod-busybox/Makefile
@@ -8,30 +8,47 @@
#
#*****************************************************************************
+top_dir = ..
-all: insmod libinsmod.a
+include $(top_dir)/Makefile.common
+
+
+all: insmod libinsmod.a libinsmod-DIET.a
clean:
- rm -f *.o insmod libinsmod.a
+ rm -f *.o insmod libinsmod.a libinsmod-DIET.a
+
FLAGS = -c -Wall -Os -fomit-frame-pointer -D_GNU_SOURCE -DBB_VER='"0.47"' -DBB_BT='"2000.12.06-14:02+0000"'
+
insmod: insmod-frontend.o insmod.o utility-standalone.o
gcc -o $@ $^
+ $(STRIPCMD) $@
libinsmod.a: insmod.o utility.o
ar cru $@ $^
ranlib $@
+libinsmod-DIET.a: insmod-DIET.o utility-DIET.o
+ ar cru $@ $^
+ ranlib $@
+
insmod-frontend.o: insmod-frontend.c busybox.h
- gcc $(FLAGS) insmod-frontend.c
+ gcc $(FLAGS) $(GLIBC_INCLUDES) insmod-frontend.c
utility.o: utility.c busybox.h
- gcc $(FLAGS) utility.c
+ gcc $(FLAGS) $(GLIBC_INCLUDES) utility.c
+
+utility-DIET.o: utility.c busybox.h
+ gcc $(FLAGS) $(DIETLIBC_INCLUDES) -o $@ utility.c
utility-standalone.o: utility.c busybox.h
- gcc $(FLAGS) -o $@ -D_STANDALONE_ utility.c
+ gcc $(FLAGS) $(GLIBC_INCLUDES) -o $@ -D_STANDALONE_ utility.c
insmod.o: insmod.c busybox.h
- gcc $(FLAGS) insmod.c
+ gcc $(FLAGS) $(GLIBC_INCLUDES) insmod.c
+
+insmod-DIET.o: insmod.c busybox.h
+ gcc $(FLAGS) $(DIETLIBC_INCLUDES) -o $@ insmod.c
diff --git a/mdk-stage1/insmod-busybox/busybox.h b/mdk-stage1/insmod-busybox/busybox.h
index 69f455435..72d5e0a69 100644
--- a/mdk-stage1/insmod-busybox/busybox.h
+++ b/mdk-stage1/insmod-busybox/busybox.h
@@ -37,8 +37,6 @@
#include <errno.h>
#include <sys/stat.h>
#include <sys/param.h>
-#include <mntent.h>
-#include <regex.h>
/* for the _syscall() macros */
#include <sys/syscall.h>
#include <linux/unistd.h>
@@ -394,7 +392,7 @@ extern void print_file(FILE *file);
extern int print_file_by_name(char *filename);
extern char process_escape_sequence(char **ptr);
extern char *get_last_path_component(char *path);
-extern void xregcomp(regex_t *preg, const char *regex, int cflags);
+// extern void xregcomp(regex_t *preg, const char *regex, int cflags);
#ifndef DMALLOC
extern void *xmalloc (size_t size);
diff --git a/mdk-stage1/insmod-busybox/insmod.c b/mdk-stage1/insmod-busybox/insmod.c
index ac5f191fb..86c9ad181 100644
--- a/mdk-stage1/insmod-busybox/insmod.c
+++ b/mdk-stage1/insmod-busybox/insmod.c
@@ -45,7 +45,6 @@
#include <dirent.h>
#include <ctype.h>
#include <assert.h>
-#include <getopt.h>
#include <sys/utsname.h>
//----------------------------------------------------------------------------
@@ -2926,13 +2925,11 @@ extern int insmod_main( int argc, char **argv)
}
obj_allocate_commons(f);
- if (optind < argc) {
- if (m_has_modinfo
- ? !new_process_module_arguments(f, argc - optind, argv + optind)
- : !old_process_module_arguments(f, argc - optind, argv + optind))
- {
- goto out;
- }
+ if (m_has_modinfo
+ ? !new_process_module_arguments(f, argc-1, argv+1)
+ : !old_process_module_arguments(f, argc-1, argv+1))
+ {
+ goto out;
}
arch_create_got(f);
diff --git a/mdk-stage1/insmod-busybox/utility.c b/mdk-stage1/insmod-busybox/utility.c
index c5f26b8d9..89e460dd0 100644
--- a/mdk-stage1/insmod-busybox/utility.c
+++ b/mdk-stage1/insmod-busybox/utility.c
@@ -78,30 +78,30 @@ const char mtab_file[] = "/dev/mtab";
#endif
#ifdef _STANDALONE_
-extern void errorMsg(const char *s, ...)
+void errorMsg(const char *s, ...)
{
va_list p;
- va_start(p, s);
fflush(stdout);
- fprintf(stderr, "busybox: ");
- vfprintf(stderr, s, p);
- fprintf(stderr, "\n");
+ printf("busybox: ");
+ va_start(p, s);
+ vprintf(s, p);
va_end(p);
- fflush(stderr);
+ printf("\n");
+ fflush(stdout);
}
-extern void fatalError(const char *s, ...)
+void fatalError(const char *s, ...)
{
va_list p;
- va_start(p, s);
fflush(stdout);
- fprintf(stderr, "busybox: ");
- vfprintf(stderr, s, p);
- fprintf(stderr, "\n");
+ fprintf(stdout, "busybox: ");
+ va_start(p, s);
+ vfprintf(stdout, s, p);
va_end(p);
- fflush(stderr);
+ fprintf(stdout, "\n");
+ fflush(stdout);
exit(FALSE);
}
#else /* _STANDALONE_ */