summaryrefslogtreecommitdiffstats
path: root/patches
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2009-10-28 16:10:10 +0100
committerMarc Kleine-Budde <mkl@pengutronix.de>2009-11-04 13:56:48 +0100
commit9b508b4bae8f0d1f05b00c579483a158c9f22e46 (patch)
tree916652659aa6dc82d75d2b4037d09fa29c8a774c /patches
parente7283c31751a1b383bb0485170785003ed434208 (diff)
downloadptxdist-9b508b4bae8f0d1f05b00c579483a158c9f22e46.tar.gz
ptxdist-9b508b4bae8f0d1f05b00c579483a158c9f22e46.tar.xz
[klibc] import recent klibc.git patches
Signed-off-by: Jon Ringle <jon@ringle.org> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'patches')
-rw-r--r--patches/klibc-1.5.15/0001-add-linux-arch-ARCH-include-to-search-path.patch50
-rw-r--r--patches/klibc-1.5.15/0001-klibc-add-strtok_r.patch81
-rw-r--r--patches/klibc-1.5.15/0002-klibc-Add-initial-mntent.h-with-setmntent-and-endmnt.patch84
-rw-r--r--patches/klibc-1.5.15/0003-klibc-add-getmntent.patch117
-rw-r--r--patches/klibc-1.5.15/0004-klibc-mount-add-help-arg-for-usage.patch81
-rw-r--r--patches/klibc-1.5.15/0005-klibc-mount-list-all-mounted-file-systems.patch75
-rw-r--r--patches/klibc-1.5.15/0006-klibc-mount-list-fs-of-particular-type.patch62
-rw-r--r--patches/klibc-1.5.15/0007-klibc-mount-read-proc-mounts-preferably.patch33
-rw-r--r--patches/klibc-1.5.15/0008-klibc-ipconfig-raise-field-length-for-rootpath-DHCP-.patch32
-rw-r--r--patches/klibc-1.5.15/0009-klibc-ipconfig-set-null-ciaddr-on-DHCPREQUEST-during.patch43
-rw-r--r--patches/klibc-1.5.15/0010-klibc-1.5.15-released-next-version-is-1.5.16.patch19
-rw-r--r--patches/klibc-1.5.15/0011-klibc-fix-must_inline-macro-in-klibc-compiler.h-for-.patch36
-rw-r--r--patches/klibc-1.5.15/0012-ipconfig-omit-zero-length-DHCP-vendor_class_identifi.patch88
-rw-r--r--patches/klibc-1.5.15/0013-ipconfig-send-requested-hostname-in-DHCP-discover-re.patch114
-rw-r--r--patches/klibc-1.5.15/0014-klibc-use-headers_install-to-install-headers.patch41
-rw-r--r--patches/klibc-1.5.15/0015-klibc-utils-add-simple-ls.patch249
-rw-r--r--patches/klibc-1.5.15/0016-klibc-use-MAKE-instead-of-make-to-call-external-make.patch26
-rw-r--r--patches/klibc-1.5.15/0017-klibc-use-kernel-header-installed-by-headers_install.patch68
-rw-r--r--patches/klibc-1.5.15/0018-Patch-to-add-support-for-detection-of-vfat-and-jffs2.patch58
-rw-r--r--patches/klibc-1.5.15/0019-define-__socklen_t_defined.patch26
-rw-r--r--patches/klibc-1.5.15/0020-fix-warning-include-signal.h-47-5-warning-SIGRTMAX-i.patch31
-rw-r--r--patches/klibc-1.5.15/0021-Fix-no-previous-prototype-__ctype_-warnings.patch55
-rw-r--r--patches/klibc-1.5.15/0022-define-MNTPROC_MNT-and-MNTPROC_UMNT.patch35
-rw-r--r--patches/klibc-1.5.15/series23
24 files changed, 1476 insertions, 51 deletions
diff --git a/patches/klibc-1.5.15/0001-add-linux-arch-ARCH-include-to-search-path.patch b/patches/klibc-1.5.15/0001-add-linux-arch-ARCH-include-to-search-path.patch
deleted file mode 100644
index 9b4e79a1e..000000000
--- a/patches/klibc-1.5.15/0001-add-linux-arch-ARCH-include-to-search-path.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From 7b8d62d4153be1c8b4601a7ec765199b249449b5 Mon Sep 17 00:00:00 2001
-From: Marc Kleine-Budde <mkl@pengutronix.de>
-Date: Mon, 5 Jan 2009 17:46:47 +0100
-Subject: [PATCH] add linux' arch/$ARCH/include to search path
-
-with the recent move of the includes from linux'
-include/asm-$ARCH to arch/$ARCH/asm, klibc fails to compile,
-because the in-linux-header files include from asm/, but this
-is not in the header search path.
-
-e.g. against linux-2.6.27 arm:
-
- arm-iwmmx-linux-gnueabi-gcc -Wp,-MD,usr/klibc/.vsnprintf.o.d -nostdinc -iwithprefix include -Iusr/include/arch/arm -Iusr/include/bits32 -Iusr/klibc/../include -Iusr/include -Ilinux/include -D__KLIBC__=1 -D__KLIBC_MINOR__=5 -D_BITSIZE=32 -fno-stack-protector -fno-exceptions -mabi=aapcs-linux -mno-thumb-interwork -Os -march=armv4 -mtune=strongarm -W -Wall -Wno-sign-compare -Wno-unused-parameter -c -o usr/klibc/vsnprintf.o usr/klibc/vsnprintf.c
-In file included from usr/klibc/../include/sys/types.h:15,
- from usr/klibc/../include/unistd.h:11,
- from usr/klibc/../include/stdio.h:11,
- from usr/klibc/vsnprintf.c:13:
-linux/include/linux/posix_types.h:47:29: error: asm/posix_types.h: No such file or directory
-In file included from usr/klibc/../include/unistd.h:11,
- from usr/klibc/../include/stdio.h:11,
- from usr/klibc/vsnprintf.c:13:
-usr/klibc/../include/sys/types.h:16:23: error: asm/types.h: No such file or directory
-In file included from usr/klibc/../include/unistd.h:11,
- from usr/klibc/../include/stdio.h:11,
- from usr/klibc/vsnprintf.c:13:
-
-This patch fixes the problem by adding a -I to linux' arch/$ARCH/asm
-to the CPPFLAGS. This will fail on x86 (64 and 32 bit) though, because
-in linux x86 is unified, while in klibc it's seperate.
-
-Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
----
- scripts/Kbuild.klibc | 1 +
- 1 files changed, 1 insertions(+), 0 deletions(-)
-
-diff --git a/scripts/Kbuild.klibc b/scripts/Kbuild.klibc
-index 227b9bd..8d80f2c 100644
---- a/scripts/Kbuild.klibc
-+++ b/scripts/Kbuild.klibc
-@@ -104,6 +104,7 @@ KLIBCCPPFLAGS := -nostdinc -iwithprefix include \
- # kernel include paths
- KLIBCKERNELSRC ?= $(srctree)/
- KLIBCCPPFLAGS += -I$(KLIBCKERNELSRC)include \
-+ -I$(KLIBCKERNELSRC)/arch/$(KLIBCARCHDIR)/include \
- $(if $(KBUILD_SRC),-I$(KLIBCKERNELOBJ)include2 -I$(KLIBCKERNELOBJ)include -I$(srctree)/include) \
- $(KLIBCARCHINCFLAGS)
-
---
-1.5.4.3
-
diff --git a/patches/klibc-1.5.15/0001-klibc-add-strtok_r.patch b/patches/klibc-1.5.15/0001-klibc-add-strtok_r.patch
new file mode 100644
index 000000000..3a1ded1fd
--- /dev/null
+++ b/patches/klibc-1.5.15/0001-klibc-add-strtok_r.patch
@@ -0,0 +1,81 @@
+From 6f42216923b6d1bb4924d6e2c9117a226d40c2f3 Mon Sep 17 00:00:00 2001
+From: maximilian attems <max@stro.at>
+Date: Sun, 7 Sep 2008 10:01:28 +0200
+Subject: [PATCH 01/21] [klibc] add strtok_r()
+
+reentrant version of strtok() was missing in klibc,
+use the current strtok() implementation and make
+use of it in strtok() itself.
+
+Signed-off-by: maximilian attems <max@stro.at>
+---
+ usr/include/string.h | 1 +
+ usr/klibc/Kbuild | 1 +
+ usr/klibc/strtok.c | 9 +--------
+ usr/klibc/strtok_r.c | 13 +++++++++++++
+ 4 files changed, 16 insertions(+), 8 deletions(-)
+ create mode 100644 usr/klibc/strtok_r.c
+
+diff --git a/usr/include/string.h b/usr/include/string.h
+index ae8270e..0c8c046 100644
+--- a/usr/include/string.h
++++ b/usr/include/string.h
+@@ -44,5 +44,6 @@ __extern char *strsep(char **, const char *);
+ __extern size_t strspn(const char *, const char *);
+ __extern char *strstr(const char *, const char *);
+ __extern char *strtok(char *, const char *);
++__extern char *strtok_r(char *, const char *, char **);
+
+ #endif /* _STRING_H */
+diff --git a/usr/klibc/Kbuild b/usr/klibc/Kbuild
+index c8eabf9..eb04267 100644
+--- a/usr/klibc/Kbuild
++++ b/usr/klibc/Kbuild
+@@ -36,6 +36,7 @@ klib-y := vsnprintf.o snprintf.o vsprintf.o sprintf.o \
+ strncat.o strlcpy.o strlcat.o \
+ strstr.o strncmp.o strncpy.o strrchr.o \
+ strxspn.o strspn.o strcspn.o strpbrk.o strsep.o strtok.o \
++ strtok_r.o \
+ fnmatch.o \
+ gethostname.o getdomainname.o getcwd.o \
+ seteuid.o setegid.o \
+diff --git a/usr/klibc/strtok.c b/usr/klibc/strtok.c
+index c2671af..6b169a1 100644
+--- a/usr/klibc/strtok.c
++++ b/usr/klibc/strtok.c
+@@ -8,12 +8,5 @@ char *strtok(char *s, const char *delim)
+ {
+ static char *holder;
+
+- if (s)
+- holder = s;
+-
+- do {
+- s = strsep(&holder, delim);
+- } while (s && !*s);
+-
+- return s;
++ return strtok_r(s, delim, &holder);
+ }
+diff --git a/usr/klibc/strtok_r.c b/usr/klibc/strtok_r.c
+new file mode 100644
+index 0000000..695d516
+--- /dev/null
++++ b/usr/klibc/strtok_r.c
+@@ -0,0 +1,13 @@
++#include <string.h>
++
++char *strtok_r(char *s, const char *delim, char **holder)
++{
++ if (s)
++ *holder = s;
++
++ do {
++ s = strsep(holder, delim);
++ } while (s && !*s);
++
++ return s;
++}
+--
+1.6.5
+
diff --git a/patches/klibc-1.5.15/0002-klibc-Add-initial-mntent.h-with-setmntent-and-endmnt.patch b/patches/klibc-1.5.15/0002-klibc-Add-initial-mntent.h-with-setmntent-and-endmnt.patch
new file mode 100644
index 000000000..64387a200
--- /dev/null
+++ b/patches/klibc-1.5.15/0002-klibc-Add-initial-mntent.h-with-setmntent-and-endmnt.patch
@@ -0,0 +1,84 @@
+From 9452ae7af97f5d3af466104570a6a1dea5e973ad Mon Sep 17 00:00:00 2001
+From: maximilian attems <max@stro.at>
+Date: Sat, 16 Aug 2008 00:47:10 +0200
+Subject: [PATCH 02/21] [klibc] Add initial mntent.h with setmntent() and endmntent()
+
+Signed-off-by: maximilian attems <max@stro.at>
+---
+ usr/include/mntent.h | 17 +++++++++++++++++
+ usr/klibc/Kbuild | 3 ++-
+ usr/klibc/endmntent.c | 9 +++++++++
+ usr/klibc/setmntent.c | 7 +++++++
+ 4 files changed, 35 insertions(+), 1 deletions(-)
+ create mode 100644 usr/include/mntent.h
+ create mode 100644 usr/klibc/endmntent.c
+ create mode 100644 usr/klibc/setmntent.c
+
+diff --git a/usr/include/mntent.h b/usr/include/mntent.h
+new file mode 100644
+index 0000000..ca6b211
+--- /dev/null
++++ b/usr/include/mntent.h
+@@ -0,0 +1,17 @@
++#ifndef _MNTENT_H
++#define _MNTENT_H 1
++
++struct mntent {
++ char *mnt_fsname; /* name of mounted file system */
++ char *mnt_dir; /* file system path prefix */
++ char *mnt_type; /* mount type (see mntent.h) */
++ char *mnt_opts; /* mount options (see mntent.h) */
++ int mnt_freq; /* dump frequency in days */
++ int mnt_passno; /* pass number on parallel fsck */
++};
++
++extern FILE *setmntent(const char *, const char *);
++
++extern int endmntent(FILE *fp);
++
++#endif /* mntent.h */
+diff --git a/usr/klibc/Kbuild b/usr/klibc/Kbuild
+index eb04267..842a79f 100644
+--- a/usr/klibc/Kbuild
++++ b/usr/klibc/Kbuild
+@@ -56,7 +56,8 @@ klib-y := vsnprintf.o snprintf.o vsprintf.o sprintf.o \
+ ctype/ispunct.o ctype/isspace.o ctype/isupper.o \
+ ctype/isxdigit.o ctype/tolower.o ctype/toupper.o \
+ userdb/getgrgid.o userdb/getgrnam.o userdb/getpwnam.o \
+- userdb/getpwuid.o userdb/root_group.o userdb/root_user.o
++ userdb/getpwuid.o userdb/root_group.o userdb/root_user.o \
++ setmntent.o endmntent.o
+
+ klib-$(CONFIG_KLIBC_ERRLIST) += errlist.o
+
+diff --git a/usr/klibc/endmntent.c b/usr/klibc/endmntent.c
+new file mode 100644
+index 0000000..419c317
+--- /dev/null
++++ b/usr/klibc/endmntent.c
+@@ -0,0 +1,9 @@
++#include <stdio.h>
++#include <mntent.h>
++
++int endmntent(FILE *fp)
++{
++ if (fp)
++ fclose(fp);
++ return 1;
++}
+diff --git a/usr/klibc/setmntent.c b/usr/klibc/setmntent.c
+new file mode 100644
+index 0000000..d23e141
+--- /dev/null
++++ b/usr/klibc/setmntent.c
+@@ -0,0 +1,7 @@
++#include <stdio.h>
++#include <mntent.h>
++
++FILE *setmntent(const char *filename, const char *type)
++{
++ return fopen(filename, type);
++}
+--
+1.6.5
+
diff --git a/patches/klibc-1.5.15/0003-klibc-add-getmntent.patch b/patches/klibc-1.5.15/0003-klibc-add-getmntent.patch
new file mode 100644
index 000000000..0327193c3
--- /dev/null
+++ b/patches/klibc-1.5.15/0003-klibc-add-getmntent.patch
@@ -0,0 +1,117 @@
+From d2ad1cf968af5c938a0262914f764667a449ffe1 Mon Sep 17 00:00:00 2001
+From: maximilian attems <max@stro.at>
+Date: Sun, 24 Aug 2008 00:48:12 +0200
+Subject: [PATCH 03/21] [klibc] add getmntent()
+
+internaly use reentrant getmntent_r(), can be exported on need.
+take care to use reentrant strtok_r() functions too.
+Thanks to Karel Zak <kzak@redhat.com> for pointing that out.
+
+getmntent is used in several places to check that a news fs
+won't be created on an already mounted partition.
+it is also needed for mount(8) to list mounted fs.
+
+Signed-off-by: maximilian attems <max@stro.at>
+---
+ usr/include/mntent.h | 2 +
+ usr/klibc/Kbuild | 2 +-
+ usr/klibc/getmntent.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 64 insertions(+), 1 deletions(-)
+ create mode 100644 usr/klibc/getmntent.c
+
+diff --git a/usr/include/mntent.h b/usr/include/mntent.h
+index ca6b211..210610c 100644
+--- a/usr/include/mntent.h
++++ b/usr/include/mntent.h
+@@ -12,6 +12,8 @@ struct mntent {
+
+ extern FILE *setmntent(const char *, const char *);
+
++extern struct mntent *getmntent(FILE *);
++
+ extern int endmntent(FILE *fp);
+
+ #endif /* mntent.h */
+diff --git a/usr/klibc/Kbuild b/usr/klibc/Kbuild
+index 842a79f..1f505c2 100644
+--- a/usr/klibc/Kbuild
++++ b/usr/klibc/Kbuild
+@@ -57,7 +57,7 @@ klib-y := vsnprintf.o snprintf.o vsprintf.o sprintf.o \
+ ctype/isxdigit.o ctype/tolower.o ctype/toupper.o \
+ userdb/getgrgid.o userdb/getgrnam.o userdb/getpwnam.o \
+ userdb/getpwuid.o userdb/root_group.o userdb/root_user.o \
+- setmntent.o endmntent.o
++ setmntent.o endmntent.o getmntent.o
+
+ klib-$(CONFIG_KLIBC_ERRLIST) += errlist.o
+
+diff --git a/usr/klibc/getmntent.c b/usr/klibc/getmntent.c
+new file mode 100644
+index 0000000..8af27f3
+--- /dev/null
++++ b/usr/klibc/getmntent.c
+@@ -0,0 +1,61 @@
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <mntent.h>
++
++#define BUFLEN 1024
++
++struct mntent *getmntent_r(FILE *fp, struct mntent *mntbuf, char *buf,
++ int buflen)
++{
++ char *line = NULL, *saveptr = NULL;
++ const char *sep = " \t\n";
++
++ if (!fp || !mntbuf || !buf)
++ return NULL;
++
++ while ((line = fgets(buf, buflen, fp)) != NULL) {
++ if (buf[0] == '#' || buf[0] == '\n')
++ continue;
++ break;
++ }
++
++ if (!line)
++ return NULL;
++
++ mntbuf->mnt_fsname = strtok_r(buf, sep, &saveptr);
++ if (!mntbuf->mnt_fsname)
++ return NULL;
++
++ mntbuf->mnt_dir = strtok_r(NULL, sep, &saveptr);
++ if (!mntbuf->mnt_fsname)
++ return NULL;
++
++ mntbuf->mnt_type = strtok_r(NULL, sep, &saveptr);
++ if (!mntbuf->mnt_type)
++ return NULL;
++
++ mntbuf->mnt_opts = strtok_r(NULL, sep, &saveptr);
++ if (!mntbuf->mnt_opts)
++ mntbuf->mnt_opts = "";
++
++ line = strtok_r(NULL, sep, &saveptr);
++ mntbuf->mnt_freq = !line ? 0 : atoi(line);
++
++ line = strtok_r(NULL, sep, &saveptr);
++ mntbuf->mnt_passno = !line ? 0 : atoi(line);
++
++ return mntbuf;
++}
++
++struct mntent *getmntent(FILE *fp)
++{
++ static char *buf = NULL;
++ static struct mntent mntbuf;
++
++ buf = malloc(BUFLEN);
++ if (!buf)
++ perror("malloc");
++
++ return getmntent_r(fp, &mntbuf, buf, BUFLEN);
++}
+--
+1.6.5
+
diff --git a/patches/klibc-1.5.15/0004-klibc-mount-add-help-arg-for-usage.patch b/patches/klibc-1.5.15/0004-klibc-mount-add-help-arg-for-usage.patch
new file mode 100644
index 000000000..7b880846b
--- /dev/null
+++ b/patches/klibc-1.5.15/0004-klibc-mount-add-help-arg-for-usage.patch
@@ -0,0 +1,81 @@
+From ccc39e2fb2b0133e56ba95217ee5ffed9ca901ac Mon Sep 17 00:00:00 2001
+From: maximilian attems <max@stro.at>
+Date: Fri, 5 Sep 2008 09:18:27 +0200
+Subject: [PATCH 04/21] [klibc] mount: add help arg for usage()
+
+extract current usage() print out of main() and use it for help arg.
+as bonus alphabeticaly sort the arguments.
+
+Signed-off-by: maximilian attems <max@stro.at>
+---
+ usr/utils/mount_main.c | 30 ++++++++++++++++++------------
+ 1 files changed, 18 insertions(+), 12 deletions(-)
+
+diff --git a/usr/utils/mount_main.c b/usr/utils/mount_main.c
+index b5993cc..a15ae3d 100644
+--- a/usr/utils/mount_main.c
++++ b/usr/utils/mount_main.c
+@@ -15,6 +15,13 @@ char *progname;
+ static struct extra_opts extra;
+ static unsigned long rwflag;
+
++static __noreturn usage(void)
++{
++ fprintf(stderr, "Usage: %s [-r] [-w] [-o options] [-t type] [-f] [-i] "
++ "[-n] device directory\n", progname);
++ exit(1);
++}
++
+ static int
+ do_mount(char *dev, char *dir, char *type, unsigned long rwflag, void *data)
+ {
+@@ -66,10 +73,18 @@ int main(int argc, char *argv[])
+ rwflag = MS_VERBOSE;
+
+ do {
+- c = getopt(argc, argv, "no:rt:wfi");
++ c = getopt(argc, argv, "fhino:rt:w");
+ if (c == EOF)
+ break;
+ switch (c) {
++ case 'f':
++ /* we can't edit /etc/mtab yet anyway; exit */
++ exit(0);
++ case 'i':
++ /* ignore for now; no support for mount helpers */
++ break;
++ case 'h':
++ usage();
+ case 'n':
+ /* no mtab writing */
+ break;
+@@ -85,12 +100,6 @@ int main(int argc, char *argv[])
+ case 'w':
+ rwflag &= ~MS_RDONLY;
+ break;
+- case 'f':
+- /* we can't edit /etc/mtab yet anyway; exit */
+- exit(0);
+- case 'i':
+- /* ignore for now; no support for mount helpers */
+- break;
+ case '?':
+ fprintf(stderr, "%s: invalid option -%c\n",
+ progname, optopt);
+@@ -105,11 +114,8 @@ int main(int argc, char *argv[])
+ if (rwflag & MS_TYPE)
+ type = "none";
+
+- if (optind + 2 != argc || type == NULL) {
+- fprintf(stderr, "Usage: %s [-r] [-w] [-o options] [-t type] [-f] [-i] "
+- "[-n] device directory\n", progname);
+- exit(1);
+- }
++ if (optind + 2 != argc || type == NULL)
++ usage();
+
+ return do_mount(argv[optind], argv[optind + 1], type, rwflag,
+ extra.str);
+--
+1.6.5
+
diff --git a/patches/klibc-1.5.15/0005-klibc-mount-list-all-mounted-file-systems.patch b/patches/klibc-1.5.15/0005-klibc-mount-list-all-mounted-file-systems.patch
new file mode 100644
index 000000000..3ce1a059e
--- /dev/null
+++ b/patches/klibc-1.5.15/0005-klibc-mount-list-all-mounted-file-systems.patch
@@ -0,0 +1,75 @@
+From f33a64fe457ccfe74f5d993d025a71ebf7a417c4 Mon Sep 17 00:00:00 2001
+From: maximilian attems <max@stro.at>
+Date: Fri, 5 Sep 2008 22:02:21 +0200
+Subject: [PATCH 05/21] [klibc] mount: list all mounted file systems
+
+plain mount(8) invocation without arguments.
+
+Signed-off-by: maximilian attems <max@stro.at>
+---
+ usr/utils/mount_main.c | 32 ++++++++++++++++++++++++++++++++
+ 1 files changed, 32 insertions(+), 0 deletions(-)
+
+diff --git a/usr/utils/mount_main.c b/usr/utils/mount_main.c
+index a15ae3d..2616e46 100644
+--- a/usr/utils/mount_main.c
++++ b/usr/utils/mount_main.c
+@@ -7,9 +7,13 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
++#include <mntent.h>
+
+ #include "mount_opts.h"
+
++#define _PATH_MOUNTED "/etc/mtab"
++#define _PATH_PROC_MOUNTS "/proc/mounts"
++
+ char *progname;
+
+ static struct extra_opts extra;
+@@ -22,6 +26,31 @@ static __noreturn usage(void)
+ exit(1);
+ }
+
++static __noreturn print_mount(void)
++{
++ FILE *mfp;
++ struct mntent *mnt;
++
++ mfp = setmntent(_PATH_MOUNTED, "r");
++ if (!mfp)
++ mfp = setmntent(_PATH_PROC_MOUNTS, "r");
++ if (!mfp)
++ perror("setmntent");
++
++ while ((mnt = getmntent(mfp)) != NULL) {
++ if (mnt->mnt_fsname && !strncmp(mnt->mnt_fsname, "no", 2))
++ continue;
++ printf("%s on %s", mnt->mnt_fsname, mnt->mnt_dir);
++ if (mnt->mnt_type != NULL && mnt->mnt_type != '\0')
++ printf (" type %s", mnt->mnt_type);
++ if (mnt->mnt_opts != NULL && mnt->mnt_opts != '\0')
++ printf (" (%s)", mnt->mnt_opts);
++ printf("\n");
++ }
++ endmntent(mfp);
++ exit(0);
++}
++
+ static int
+ do_mount(char *dev, char *dir, char *type, unsigned long rwflag, void *data)
+ {
+@@ -114,6 +143,9 @@ int main(int argc, char *argv[])
+ if (rwflag & MS_TYPE)
+ type = "none";
+
++ if (optind == argc)
++ print_mount();
++
+ if (optind + 2 != argc || type == NULL)
+ usage();
+
+--
+1.6.5
+
diff --git a/patches/klibc-1.5.15/0006-klibc-mount-list-fs-of-particular-type.patch b/patches/klibc-1.5.15/0006-klibc-mount-list-fs-of-particular-type.patch
new file mode 100644
index 000000000..27c21ab28
--- /dev/null
+++ b/patches/klibc-1.5.15/0006-klibc-mount-list-fs-of-particular-type.patch
@@ -0,0 +1,62 @@
+From 8b2442a927d0141dbf06289d20486e0e631ebec7 Mon Sep 17 00:00:00 2001
+From: maximilian attems <max@stro.at>
+Date: Fri, 5 Sep 2008 22:13:21 +0200
+Subject: [PATCH 06/21] [klibc] mount: list fs of particular type
+
+makes possible: mount -t squashfs
+pass type of the fs down to print_mount().
+
+fixes http://bugs.debian.org/491067
+requested for casper live cd initramfs.
+
+Cc: Colin Watson <cjwatson@ubuntu.com>
+Signed-off-by: maximilian attems <max@stro.at>
+---
+ usr/utils/mount_main.c | 10 ++++++----
+ 1 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/usr/utils/mount_main.c b/usr/utils/mount_main.c
+index 2616e46..89e75d7 100644
+--- a/usr/utils/mount_main.c
++++ b/usr/utils/mount_main.c
+@@ -26,7 +26,7 @@ static __noreturn usage(void)
+ exit(1);
+ }
+
+-static __noreturn print_mount(void)
++static __noreturn print_mount(char *type)
+ {
+ FILE *mfp;
+ struct mntent *mnt;
+@@ -40,6 +40,8 @@ static __noreturn print_mount(void)
+ while ((mnt = getmntent(mfp)) != NULL) {
+ if (mnt->mnt_fsname && !strncmp(mnt->mnt_fsname, "no", 2))
+ continue;
++ if (type && mnt->mnt_type && strcmp(type, mnt->mnt_type))
++ continue;
+ printf("%s on %s", mnt->mnt_fsname, mnt->mnt_dir);
+ if (mnt->mnt_type != NULL && mnt->mnt_type != '\0')
+ printf (" type %s", mnt->mnt_type);
+@@ -136,6 +138,9 @@ int main(int argc, char *argv[])
+ }
+ } while (1);
+
++ if (optind == argc)
++ print_mount(type);
++
+ /*
+ * If remount, bind or move was specified, then we don't
+ * have a "type" as such. Use the dummy "none" type.
+@@ -143,9 +148,6 @@ int main(int argc, char *argv[])
+ if (rwflag & MS_TYPE)
+ type = "none";
+
+- if (optind == argc)
+- print_mount();
+-
+ if (optind + 2 != argc || type == NULL)
+ usage();
+
+--
+1.6.5
+
diff --git a/patches/klibc-1.5.15/0007-klibc-mount-read-proc-mounts-preferably.patch b/patches/klibc-1.5.15/0007-klibc-mount-read-proc-mounts-preferably.patch
new file mode 100644
index 000000000..0943b55cb
--- /dev/null
+++ b/patches/klibc-1.5.15/0007-klibc-mount-read-proc-mounts-preferably.patch
@@ -0,0 +1,33 @@
+From 6fa665bc70d5f87282a3518595e39cc6cac99050 Mon Sep 17 00:00:00 2001
+From: maximilian attems <max@stro.at>
+Date: Fri, 5 Sep 2008 22:18:09 +0200
+Subject: [PATCH 07/21] [klibc] mount: read /proc/mounts preferably
+
+as klibc mount doesn't write into /etc/mtab (no addmntent() too),
+better checkout the kernel view first.
+may be interchanged again later..
+
+Signed-off-by: maximilian attems <max@stro.at>
+---
+ usr/utils/mount_main.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/usr/utils/mount_main.c b/usr/utils/mount_main.c
+index 89e75d7..ee08720 100644
+--- a/usr/utils/mount_main.c
++++ b/usr/utils/mount_main.c
+@@ -31,9 +31,9 @@ static __noreturn print_mount(char *type)
+ FILE *mfp;
+ struct mntent *mnt;
+
+- mfp = setmntent(_PATH_MOUNTED, "r");
++ mfp = setmntent(_PATH_PROC_MOUNTS, "r");
+ if (!mfp)
+- mfp = setmntent(_PATH_PROC_MOUNTS, "r");
++ mfp = setmntent(_PATH_MOUNTED, "r");
+ if (!mfp)
+ perror("setmntent");
+
+--
+1.6.5
+
diff --git a/patches/klibc-1.5.15/0008-klibc-ipconfig-raise-field-length-for-rootpath-DHCP-.patch b/patches/klibc-1.5.15/0008-klibc-ipconfig-raise-field-length-for-rootpath-DHCP-.patch
new file mode 100644
index 000000000..8a7709834
--- /dev/null
+++ b/patches/klibc-1.5.15/0008-klibc-ipconfig-raise-field-length-for-rootpath-DHCP-.patch
@@ -0,0 +1,32 @@
+From 848a8ce349331cd74021cc3b8ea43f9e47c14e50 Mon Sep 17 00:00:00 2001
+From: maximilian attems <max@stro.at>
+Date: Fri, 5 Sep 2008 22:38:22 +0200
+Subject: [PATCH 08/21] [klibc] ipconfig: raise field length for rootpath DHCP option
+
+ipconfig would cut off after 40 bytes, use 256 bytes.
+This is indeed way too short for dotted-decimal IP adresses
+up to 15 byes long and several NFS mount options.
+fixes http://bugs.debian.org/497800
+
+Reported-by: "Christopher Huhn, GSI" <C.Huhn@gsi.de>
+Signed-off-by: maximilian attems <max@stro.at>
+---
+ usr/kinit/ipconfig/netdev.h | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/usr/kinit/ipconfig/netdev.h b/usr/kinit/ipconfig/netdev.h
+index fb6640a..1091943 100644
+--- a/usr/kinit/ipconfig/netdev.h
++++ b/usr/kinit/ipconfig/netdev.h
+@@ -4,7 +4,7 @@
+ #include <sys/utsname.h>
+ #include <net/if.h>
+
+-#define BPLEN 40
++#define BPLEN 256
+ #define FNLEN 128 /* from DHCP RFC 2131 */
+
+ struct netdev {
+--
+1.6.5
+
diff --git a/patches/klibc-1.5.15/0009-klibc-ipconfig-set-null-ciaddr-on-DHCPREQUEST-during.patch b/patches/klibc-1.5.15/0009-klibc-ipconfig-set-null-ciaddr-on-DHCPREQUEST-during.patch
new file mode 100644
index 000000000..c7a3f02c4
--- /dev/null
+++ b/patches/klibc-1.5.15/0009-klibc-ipconfig-set-null-ciaddr-on-DHCPREQUEST-during.patch
@@ -0,0 +1,43 @@
+From cfc8d649a959f845983aae4c0fc33a0a0c995c92 Mon Sep 17 00:00:00 2001
+From: maximilian attems <max@stro.at>
+Date: Fri, 5 Sep 2008 22:48:27 +0200
+Subject: [PATCH 09/21] [klibc] ipconfig: set null ciaddr on DHCPREQUEST during SELECTING state
+
+RFC 2131, Section 4.3.2 states:
+
+ Clients send DHCPREQUEST messages as follows:
+
+ o DHCPREQUEST generated during SELECTING state:
+
+ Client inserts the address of the selected server in 'server
+ identifier', 'ciaddr' MUST be zero, 'requested IP address' MUST be
+ filled in with the yiaddr value from the chosen DHCPOFFER.
+
+fixes: http://bugs.debian.org/497879
+
+my test dhcpd seem all not that picky, ipconfig worked before
+and after this RFC 2131 conformal change.
+
+Reported-by: Craig Bernstein <cbernstein@stanford.edu>
+Signed-off-by: maximilian attems <max@stro.at>
+---
+ usr/kinit/ipconfig/dhcp_proto.c | 3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/usr/kinit/ipconfig/dhcp_proto.c b/usr/kinit/ipconfig/dhcp_proto.c
+index d4f2c09..21448f7 100644
+--- a/usr/kinit/ipconfig/dhcp_proto.c
++++ b/usr/kinit/ipconfig/dhcp_proto.c
+@@ -171,7 +171,8 @@ static int dhcp_send(struct netdev *dev, struct iovec *vec)
+ bootp.htype = dev->hwtype;
+ bootp.hlen = dev->hwlen;
+ bootp.xid = dev->bootp.xid;
+- bootp.ciaddr = dev->ip_addr;
++ bootp.ciaddr = INADDR_NONE;
++ bootp.yiaddr = dev->ip_addr;
+ bootp.giaddr = INADDR_ANY;
+ bootp.secs = htons(time(NULL) - dev->open_time);
+ memcpy(bootp.chaddr, dev->hwaddr, 16);
+--
+1.6.5
+
diff --git a/patches/klibc-1.5.15/0010-klibc-1.5.15-released-next-version-is-1.5.16.patch b/patches/klibc-1.5.15/0010-klibc-1.5.15-released-next-version-is-1.5.16.patch
new file mode 100644
index 000000000..74e5a9617
--- /dev/null
+++ b/patches/klibc-1.5.15/0010-klibc-1.5.15-released-next-version-is-1.5.16.patch
@@ -0,0 +1,19 @@
+From 5b997526032903b38105db27550ef22a05ee1f5f Mon Sep 17 00:00:00 2001
+From: H. Peter Anvin <hpa@zytor.com>
+Date: Sun, 4 Jan 2009 19:29:33 +0000
+Subject: [PATCH 10/21] [klibc] 1.5.15 released, next version is 1.5.16
+
+---
+ usr/klibc/version | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/usr/klibc/version b/usr/klibc/version
+index f6ed435..0ed0610 100644
+--- a/usr/klibc/version
++++ b/usr/klibc/version
+@@ -1 +1 @@
+-1.5.15
++1.5.16
+--
+1.6.5
+
diff --git a/patches/klibc-1.5.15/0011-klibc-fix-must_inline-macro-in-klibc-compiler.h-for-.patch b/patches/klibc-1.5.15/0011-klibc-fix-must_inline-macro-in-klibc-compiler.h-for-.patch
new file mode 100644
index 000000000..63bb5ad29
--- /dev/null
+++ b/patches/klibc-1.5.15/0011-klibc-fix-must_inline-macro-in-klibc-compiler.h-for-.patch
@@ -0,0 +1,36 @@
+From 63237c6e7037a6058deadc92ddcbcb41c5d4c2f8 Mon Sep 17 00:00:00 2001
+From: Jon Ringle <jon@ringle.org>
+Date: Wed, 22 Jul 2009 03:09:29 -0400
+Subject: [PATCH 11/21] [klibc] fix must_inline macro in klibc/compiler.h for gcc-4.3
+
+Add __gnu_inline__ if we find __GNUC_STDC_INLINE__.
+
+See http://gcc.gnu.org/gcc-4.3/porting_to.html for details.
+
+Signed-off-by: Jon Ringle <jon@ringle.org>
+Signed-off-by: H. Peter Anvin <hpa@zytor.com>
+---
+ usr/include/klibc/compiler.h | 7 ++++++-
+ 1 files changed, 6 insertions(+), 1 deletions(-)
+
+diff --git a/usr/include/klibc/compiler.h b/usr/include/klibc/compiler.h
+index 816a4ee..9dee742 100644
+--- a/usr/include/klibc/compiler.h
++++ b/usr/include/klibc/compiler.h
+@@ -24,7 +24,12 @@
+ /* Use "extern inline" even in the gcc3+ case to avoid warnings in ctype.h */
+ #ifdef __GNUC__
+ # if __GNUC__ >= 3
+-# define __must_inline extern __inline__ __attribute__((always_inline))
++# ifdef __GNUC_STDC_INLINE__
++# define __must_inline extern __inline__ \
++ __attribute__((__gnu_inline__,__always_inline__))
++# else
++# define __must_inline extern __inline__ __attribute__((__always_inline__))
++# endif
+ # else
+ # define __must_inline extern __inline__
+ # endif
+--
+1.6.5
+
diff --git a/patches/klibc-1.5.15/0012-ipconfig-omit-zero-length-DHCP-vendor_class_identifi.patch b/patches/klibc-1.5.15/0012-ipconfig-omit-zero-length-DHCP-vendor_class_identifi.patch
new file mode 100644
index 000000000..3ed8587df
--- /dev/null
+++ b/patches/klibc-1.5.15/0012-ipconfig-omit-zero-length-DHCP-vendor_class_identifi.patch
@@ -0,0 +1,88 @@
+From b4bad5be5fa41416bf67fa1fba0624a0c541ea39 Mon Sep 17 00:00:00 2001
+From: Aron Griffis <agriffis@n01se.net>
+Date: Sun, 21 Jun 2009 22:40:17 -0400
+Subject: [PATCH 12/21] ipconfig: omit zero-length DHCP vendor_class_identifier
+
+If ipconfig is executed with -i "", omit the vendor class
+identifier from the DHCP discover/request rather than
+sending it empty. This patch paves the way for more
+flexibility in the DHCP packet, particularly hostname
+request.
+
+Signed-off-by: Aron Griffis <agriffis@n01se.net>
+Signed-off-by: H. Peter Anvin <hpa@zytor.com>
+---
+ usr/kinit/ipconfig/dhcp_proto.c | 31 +++++++++++++++++++++----------
+ 1 files changed, 21 insertions(+), 10 deletions(-)
+
+diff --git a/usr/kinit/ipconfig/dhcp_proto.c b/usr/kinit/ipconfig/dhcp_proto.c
+index d4f2c09..c127d39 100644
+--- a/usr/kinit/ipconfig/dhcp_proto.c
++++ b/usr/kinit/ipconfig/dhcp_proto.c
+@@ -51,22 +51,22 @@ static uint8_t dhcp_end[] = {
+ pokes at the internals */
+ #define DHCP_IOV_LEN 6
+
+-static struct iovec dhcp_discover_iov[] = {
++static struct iovec dhcp_discover_iov[DHCP_IOV_LEN] = {
+ /* [0] = ip + udp header */
+ /* [1] = bootp header */
+ [2] = {dhcp_discover_hdr, sizeof(dhcp_discover_hdr)},
+ [3] = {dhcp_params, sizeof(dhcp_params)},
+- /* [4] = DHCP vendor class */
+- [5] = {dhcp_end, sizeof(dhcp_end)}
++ /* [4] = optional vendor class */
++ /* [5] = {dhcp_end, sizeof(dhcp_end)} */
+ };
+
+-static struct iovec dhcp_request_iov[] = {
++static struct iovec dhcp_request_iov[DHCP_IOV_LEN] = {
+ /* [0] = ip + udp header */
+ /* [1] = bootp header */
+ [2] = {dhcp_request_hdr, sizeof(dhcp_request_hdr)},
+ [3] = {dhcp_params, sizeof(dhcp_params)},
+- /* [4] = DHCP vendor class */
+- [5] = {dhcp_end, sizeof(dhcp_end)}
++ /* [4] = optional vendor class */
++ /* [5] = {dhcp_end, sizeof(dhcp_end)} */
+ };
+
+ /*
+@@ -164,6 +164,7 @@ static int dhcp_recv(struct netdev *dev)
+ static int dhcp_send(struct netdev *dev, struct iovec *vec)
+ {
+ struct bootp_hdr bootp;
++ int i = 4;
+
+ memset(&bootp, 0, sizeof(struct bootp_hdr));
+
+@@ -179,12 +180,22 @@ static int dhcp_send(struct netdev *dev, struct iovec *vec)
+ vec[1].iov_base = &bootp;
+ vec[1].iov_len = sizeof(struct bootp_hdr);
+
+- vec[4].iov_base = vendor_class_identifier;
+- vec[4].iov_len = vendor_class_identifier_len;
+-
+ DEBUG(("xid %08x secs %d ", bootp.xid, ntohs(bootp.secs)));
+
+- return packet_send(dev, vec, DHCP_IOV_LEN);
++ if (vendor_class_identifier_len > 2) {
++ vec[i].iov_base = vendor_class_identifier;
++ vec[i].iov_len = vendor_class_identifier_len;
++ i++;
++
++ DEBUG(("vendor_class_identifier \"%.*s\" ",
++ vendor_class_identifier_len-2,
++ vendor_class_identifier+2));
++ }
++
++ vec[i].iov_base = dhcp_end;
++ vec[i].iov_len = sizeof(dhcp_end);
++
++ return packet_send(dev, vec, i);
+ }
+
+ /*
+--
+1.6.5
+
diff --git a/patches/klibc-1.5.15/0013-ipconfig-send-requested-hostname-in-DHCP-discover-re.patch b/patches/klibc-1.5.15/0013-ipconfig-send-requested-hostname-in-DHCP-discover-re.patch
new file mode 100644
index 000000000..214174c3f
--- /dev/null
+++ b/patches/klibc-1.5.15/0013-ipconfig-send-requested-hostname-in-DHCP-discover-re.patch
@@ -0,0 +1,114 @@
+From 1f2b4e044a6a0fde32bc976e5ad6436035c84cec Mon Sep 17 00:00:00 2001
+From: Aron Griffis <agriffis@n01se.net>
+Date: Sun, 21 Jun 2009 22:40:17 -0400
+Subject: [PATCH 13/21] ipconfig: send requested hostname in DHCP discover/request
+
+If a hostname is requested, for example -d ::::foo::dhcp,
+then include the hostname in the DHCP discover/request.
+
+Signed-off-by: Aron Griffis <agriffis@n01se.net>
+Signed-off-by: H. Peter Anvin <hpa@zytor.com>
+---
+ usr/kinit/ipconfig/dhcp_proto.c | 22 +++++++++++++++++++---
+ usr/kinit/ipconfig/main.c | 4 ++++
+ usr/kinit/ipconfig/netdev.h | 1 +
+ 3 files changed, 24 insertions(+), 3 deletions(-)
+
+diff --git a/usr/kinit/ipconfig/dhcp_proto.c b/usr/kinit/ipconfig/dhcp_proto.c
+index c127d39..775a5ca 100644
+--- a/usr/kinit/ipconfig/dhcp_proto.c
++++ b/usr/kinit/ipconfig/dhcp_proto.c
+@@ -49,7 +49,7 @@ static uint8_t dhcp_end[] = {
+
+ /* Both iovecs below have to have the same structure, since dhcp_send()
+ pokes at the internals */
+-#define DHCP_IOV_LEN 6
++#define DHCP_IOV_LEN 7
+
+ static struct iovec dhcp_discover_iov[DHCP_IOV_LEN] = {
+ /* [0] = ip + udp header */
+@@ -57,7 +57,8 @@ static struct iovec dhcp_discover_iov[DHCP_IOV_LEN] = {
+ [2] = {dhcp_discover_hdr, sizeof(dhcp_discover_hdr)},
+ [3] = {dhcp_params, sizeof(dhcp_params)},
+ /* [4] = optional vendor class */
+- /* [5] = {dhcp_end, sizeof(dhcp_end)} */
++ /* [5] = optional hostname */
++ /* [6] = {dhcp_end, sizeof(dhcp_end)} */
+ };
+
+ static struct iovec dhcp_request_iov[DHCP_IOV_LEN] = {
+@@ -66,7 +67,8 @@ static struct iovec dhcp_request_iov[DHCP_IOV_LEN] = {
+ [2] = {dhcp_request_hdr, sizeof(dhcp_request_hdr)},
+ [3] = {dhcp_params, sizeof(dhcp_params)},
+ /* [4] = optional vendor class */
+- /* [5] = {dhcp_end, sizeof(dhcp_end)} */
++ /* [5] = optional hostname */
++ /* [6] = {dhcp_end, sizeof(dhcp_end)} */
+ };
+
+ /*
+@@ -164,6 +166,7 @@ static int dhcp_recv(struct netdev *dev)
+ static int dhcp_send(struct netdev *dev, struct iovec *vec)
+ {
+ struct bootp_hdr bootp;
++ char dhcp_hostname[SYS_NMLN+2];
+ int i = 4;
+
+ memset(&bootp, 0, sizeof(struct bootp_hdr));
+@@ -192,6 +195,19 @@ static int dhcp_send(struct netdev *dev, struct iovec *vec)
+ vendor_class_identifier+2));
+ }
+
++ if (dev->reqhostname[0] != '\0') {
++ int len = strlen(dev->reqhostname);
++ dhcp_hostname[0] = 12;
++ dhcp_hostname[1] = len;
++ memcpy(dhcp_hostname+2, dev->reqhostname, len);
++
++ vec[i].iov_base = dhcp_hostname;
++ vec[i].iov_len = len+2;
++ i++;
++
++ DEBUG(("hostname %.*s ", len, dhcp_hostname+2));
++ }
++
+ vec[i].iov_base = dhcp_end;
+ vec[i].iov_len = sizeof(dhcp_end);
+
+diff --git a/usr/kinit/ipconfig/main.c b/usr/kinit/ipconfig/main.c
+index 2ded0f3..619edf7 100644
+--- a/usr/kinit/ipconfig/main.c
++++ b/usr/kinit/ipconfig/main.c
+@@ -522,6 +522,8 @@ static int parse_device(struct netdev *dev, const char *ip)
+ case 4:
+ strncpy(dev->hostname, ip, SYS_NMLN - 1);
+ dev->hostname[SYS_NMLN - 1] = '\0';
++ memcpy(dev->reqhostname, dev->hostname,
++ SYS_NMLN);
+ break;
+ case 5:
+ dev->name = ip;
+@@ -569,6 +571,8 @@ static void bringup_one_dev(struct netdev *template, struct netdev *dev)
+ dev->ip_nameserver[1] = template->ip_nameserver[1];
+ if (template->hostname[0] != '\0')
+ strcpy(dev->hostname, template->hostname);
++ if (template->reqhostname[0] != '\0')
++ strcpy(dev->reqhostname, template->reqhostname);
+ dev->caps &= template->caps;
+
+ bringup_device(dev);
+diff --git a/usr/kinit/ipconfig/netdev.h b/usr/kinit/ipconfig/netdev.h
+index fb6640a..a25a544 100644
+--- a/usr/kinit/ipconfig/netdev.h
++++ b/usr/kinit/ipconfig/netdev.h
+@@ -35,6 +35,7 @@ struct netdev {
+ uint32_t ip_gateway; /* my gateway */
+ uint32_t ip_nameserver[2]; /* two nameservers */
+ uint32_t serverid; /* dhcp serverid */
++ char reqhostname[SYS_NMLN]; /* requested hostname */
+ char hostname[SYS_NMLN]; /* hostname */
+ char dnsdomainname[SYS_NMLN]; /* dns domain name */
+ char nisdomainname[SYS_NMLN]; /* nis domain name */
+--
+1.6.5
+
diff --git a/patches/klibc-1.5.15/0014-klibc-use-headers_install-to-install-headers.patch b/patches/klibc-1.5.15/0014-klibc-use-headers_install-to-install-headers.patch
new file mode 100644
index 000000000..a6663d8cf
--- /dev/null
+++ b/patches/klibc-1.5.15/0014-klibc-use-headers_install-to-install-headers.patch
@@ -0,0 +1,41 @@
+From dc5aff1731bc4708d3391311074f026690212f8d Mon Sep 17 00:00:00 2001
+From: Jon Ringle <jon@ringle.org>
+Date: Thu, 16 Jul 2009 21:33:37 -0400
+Subject: [PATCH 14/21] [klibc] use headers_install to install headers
+
+Use headers_install to install headers.
+arch include directory has moved and it's better
+to ask the kernel Makefile to install the headers
+for us.
+
+Signed-off-by: Jon Ringle <jon@ringle.org>
+Signed-off-by: H. Peter Anvin <hpa@zytor.com>
+---
+ scripts/Kbuild.install | 11 +----------
+ 1 files changed, 1 insertions(+), 10 deletions(-)
+
+diff --git a/scripts/Kbuild.install b/scripts/Kbuild.install
+index 44c8f76..de918f0 100644
+--- a/scripts/Kbuild.install
++++ b/scripts/Kbuild.install
+@@ -95,16 +95,7 @@ header:
+ $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include
+ $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)lib
+ $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)bin
+- $(Q)set -e ; for d in linux asm asm-$(KLIBCARCH) asm-generic $(ASMKLIBCARCH); do \
+- for r in $(KLIBCKERNELSRC)/include $(KLIBCKERNELOBJ)/include \
+- $(KLIBCKERNELOBJ)/include2 ; do \
+- [ ! -d $$r/$$d ] && continue; \
+- mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KLIBCCROSS)include/$$d ; \
+- cp -rfL $$r/$$d/. \
+- $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/$$d/. ; \
+- done ; \
+- done
+- $(Q)cd $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include && ln -sf asm-$(KLIBCARCH) asm
++ $(Q)make -C $(KLIBCKERNELSRC) ARCH=$(KLIBCARCH) INSTALL_HDR_PATH=$(INSTALLROOT)$(INSTALLDIR)/$(KCROSS) headers_install
+ $(Q)cp -rf usr/include/. $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/.
+ $(Q)$(install-data) $(srctree)/klcc/klcc.1 $(INSTALLROOT)$(mandir)/man1/$(KCROSS)klcc.1
+ $(Q)$(install-bin) $(objtree)/klcc/$(KCROSS)klcc $(INSTALLROOT)$(bindir)
+--
+1.6.5
+
diff --git a/patches/klibc-1.5.15/0015-klibc-utils-add-simple-ls.patch b/patches/klibc-1.5.15/0015-klibc-utils-add-simple-ls.patch
new file mode 100644
index 000000000..32b22499b
--- /dev/null
+++ b/patches/klibc-1.5.15/0015-klibc-utils-add-simple-ls.patch
@@ -0,0 +1,249 @@
+From f9f820a9fadbd8c6ff3e2dcba6b82ed5abc204ba Mon Sep 17 00:00:00 2001
+From: Alexey Gladkov <gladkov.alexey@gmail.com>
+Date: Sat, 30 May 2009 01:24:05 +0400
+Subject: [PATCH 15/21] [klibc] utils: add simple ls
+
+Simple utility to list information about a files. The utility which
+does the same thing as "ls -la". This is a useful test program.
+
+Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
+Signed-off-by: H. Peter Anvin <hpa@zytor.com>
+---
+ usr/utils/Kbuild | 4 +-
+ usr/utils/ls.c | 202 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 205 insertions(+), 1 deletions(-)
+ create mode 100644 usr/utils/ls.c
+
+diff --git a/usr/utils/Kbuild b/usr/utils/Kbuild
+index 5b6dc28..354a364 100644
+--- a/usr/utils/Kbuild
++++ b/usr/utils/Kbuild
+@@ -3,7 +3,7 @@
+ #
+
+ progs := chroot dd mkdir mkfifo mknod mount pivot_root umount
+-progs += true false sleep ln nuke minips cat
++progs += true false sleep ln nuke minips cat ls
+ progs += uname halt kill readlink cpio sync dmesg
+
+ static-y := $(addprefix static/, $(progs))
+@@ -36,6 +36,8 @@ static/sleep-y := sleep.o
+ shared/sleep-y := sleep.o
+ static/ln-y := ln.o
+ shared/ln-y := ln.o
++static/ls-y := ls.o
++shared/ls-y := ls.o
+ static/nuke-y := nuke.o
+ shared/nuke-y := nuke.o
+ static/minips-y := minips.o
+diff --git a/usr/utils/ls.c b/usr/utils/ls.c
+new file mode 100644
+index 0000000..859142a
+--- /dev/null
++++ b/usr/utils/ls.c
+@@ -0,0 +1,202 @@
++#include <stdio.h>
++#include <stdlib.h>
++#include <dirent.h>
++#include <unistd.h>
++#include <sys/stat.h>
++#include <sys/types.h>
++#include <sys/sysmacros.h>
++
++#define STAT_ISSET(mode, mask) (((mode) & mask) == mask)
++
++static size_t max_linksiz = 128;
++static int max_nlinks = 1;
++static int max_size = 1;
++static int max_uid = 1;
++static int max_gid = 1;
++static int max_min = 1;
++static int max_maj = 1;
++
++static void do_preformat(const struct stat *st)
++{
++ int bytes;
++
++ if ((bytes = snprintf(NULL, 0, "%ju", (uintmax_t) st->st_nlink)) > max_nlinks)
++ max_nlinks = bytes;
++
++ if ((bytes = snprintf(NULL, 0, "%ju", (uintmax_t) st->st_uid)) > max_uid)
++ max_uid = bytes;
++
++ if ((bytes = snprintf(NULL, 0, "%ju", (uintmax_t) st->st_gid)) > max_gid)
++ max_gid = bytes;
++
++ if (S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode)) {
++ if ((bytes = snprintf(NULL, 0, "%u", major(st->st_rdev))) > max_maj)
++ max_maj = bytes;
++
++ if ((bytes = snprintf(NULL, 0, "%u", minor(st->st_rdev))) > max_min)
++ max_min = bytes;
++
++ max_size = max_maj + max_min + 1;
++ }
++ else {
++ if ((bytes = snprintf(NULL, 0, "%ju", (uintmax_t) st->st_size)) > max_size)
++ max_size = bytes;
++ }
++ return;
++}
++
++static void do_stat(const struct stat *st, const char *path)
++{
++ char *fmt, *link_name;
++ int rc;
++
++ switch (st->st_mode & S_IFMT) {
++ case S_IFBLK: putchar('b'); break;
++ case S_IFCHR: putchar('c'); break;
++ case S_IFDIR: putchar('d'); break;
++ case S_IFIFO: putchar('p'); break;
++ case S_IFLNK: putchar('l'); break;
++ case S_IFSOCK: putchar('s'); break;
++ case S_IFREG: putchar('-'); break;
++ default: putchar('?'); break;
++ }
++ putchar(STAT_ISSET(st->st_mode, S_IRUSR) ? 'r' : '-');
++ putchar(STAT_ISSET(st->st_mode, S_IWUSR) ? 'w' : '-');
++
++ !STAT_ISSET(st->st_mode, S_ISUID) ?
++ putchar(STAT_ISSET(st->st_mode, S_IXUSR) ? 'x' : '-') :
++ putchar('S');
++
++ putchar(STAT_ISSET(st->st_mode, S_IRGRP) ? 'r' : '-');
++ putchar(STAT_ISSET(st->st_mode, S_IWGRP) ? 'w' : '-');
++
++ !STAT_ISSET(st->st_mode, S_ISGID) ?
++ putchar(STAT_ISSET(st->st_mode, S_IXGRP) ? 'x' : '-') :
++ putchar('S');
++
++ putchar(STAT_ISSET(st->st_mode, S_IROTH) ? 'r' : '-');
++ putchar(STAT_ISSET(st->st_mode, S_IWOTH) ? 'w' : '-');
++
++ !STAT_ISSET(st->st_mode, S_ISVTX) ?
++ putchar(STAT_ISSET(st->st_mode, S_IXOTH) ? 'x' : '-') :
++ putchar(S_ISDIR(st->st_mode) ? 't' : 'T');
++
++ if (S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode)) {
++ rc = asprintf(&fmt," %%%dju %%%dju %%%dju %%%du,%%%du %%s",
++ max_nlinks, max_uid, max_gid, max_maj, max_min);
++ if (rc == -1) {
++ perror("asprintf");
++ exit(1);
++ }
++ fprintf(stdout, fmt,
++ (uintmax_t) st->st_nlink,
++ (uintmax_t) st->st_uid,
++ (uintmax_t) st->st_gid,
++ major(st->st_rdev),
++ minor(st->st_rdev),
++ path);
++ }
++ else {
++ rc = asprintf(&fmt," %%%dju %%%dju %%%dju %%%dju %%s",
++ max_nlinks, max_uid, max_gid, max_size);
++ if (rc == -1) {
++ perror("asprintf");
++ exit(1);
++ }
++ fprintf(stdout, fmt,
++ (uintmax_t) st->st_nlink,
++ (uintmax_t) st->st_uid,
++ (uintmax_t) st->st_gid,
++ (uintmax_t) st->st_size,
++ path);
++ }
++ free(fmt);
++
++ if (S_ISLNK(st->st_mode)) {
++ if ((link_name = malloc(max_linksiz)) == NULL) {
++ perror("malloc");
++ exit(1);
++ }
++ if ((rc = readlink(path, link_name, max_linksiz)) == -1) {
++ free(link_name);
++ perror("readlink");
++ exit(1);
++ }
++ link_name[rc] = '\0';
++ fprintf(stdout, " -> %s", link_name);
++ free(link_name);
++ }
++
++ putchar('\n');
++ return;
++}
++
++static void do_dir(const char *path, int preformat)
++{
++ DIR *dir;
++ struct dirent *dent;
++ struct stat st;
++
++ if (chdir(path) == -1) {
++ perror(path);
++ exit(1);
++ }
++
++ if ((dir = opendir(path)) == NULL) {
++ perror(path);
++ exit(1);
++ }
++
++ while ((dent = readdir(dir)) != NULL) {
++ if (lstat(dent->d_name, &st)) {
++ perror(dent->d_name);
++ exit(1);
++ }
++ (preformat) ?
++ do_preformat(&st) :
++ do_stat(&st, dent->d_name);
++ }
++
++ closedir(dir);
++}
++
++int main(int argc, char *argv[])
++{
++ int i;
++ struct stat st;
++
++ if (argc == 1) {
++ do_dir(".", 1);
++ do_dir(".", 0);
++ return 0;
++ }
++
++ for (i = 1; i < argc; i++) {
++ if (argv[i][0] == '-' && argv[i][1] == 'h') {
++ fprintf(stdout, "Usage: ls [-h] [FILE ...]\n");
++ return 0;
++ }
++
++ if (lstat(argv[i], &st)) {
++ perror(argv[i]);
++ exit(1);
++ }
++
++ S_ISDIR(st.st_mode) ?
++ do_dir(argv[i], 1) :
++ do_preformat(&st);
++ }
++
++ for (i = 1; i < argc; i++) {
++ if (lstat(argv[i], &st)) {
++ perror(argv[i]);
++ exit(1);
++ }
++
++ S_ISDIR(st.st_mode) ?
++ do_dir(argv[i], 0) :
++ do_stat(&st, argv[i]);
++ }
++
++ return 0;
++}
+--
+1.6.5
+
diff --git a/patches/klibc-1.5.15/0016-klibc-use-MAKE-instead-of-make-to-call-external-make.patch b/patches/klibc-1.5.15/0016-klibc-use-MAKE-instead-of-make-to-call-external-make.patch
new file mode 100644
index 000000000..482361c18
--- /dev/null
+++ b/patches/klibc-1.5.15/0016-klibc-use-MAKE-instead-of-make-to-call-external-make.patch
@@ -0,0 +1,26 @@
+From 38c10293b6c00202e8877bc48723b615783f2a00 Mon Sep 17 00:00:00 2001
+From: Marc Kleine-Budde <mkl@pengutronix.de>
+Date: Thu, 29 Oct 2009 11:00:44 +0100
+Subject: [PATCH 16/21] [klibc] use $(MAKE) instead of make to call external make
+
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+---
+ scripts/Kbuild.install | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/scripts/Kbuild.install b/scripts/Kbuild.install
+index de918f0..370b54e 100644
+--- a/scripts/Kbuild.install
++++ b/scripts/Kbuild.install
+@@ -95,7 +95,7 @@ header:
+ $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include
+ $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)lib
+ $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)bin
+- $(Q)make -C $(KLIBCKERNELSRC) ARCH=$(KLIBCARCH) INSTALL_HDR_PATH=$(INSTALLROOT)$(INSTALLDIR)/$(KCROSS) headers_install
++ $(Q)$(MAKE) -C $(KLIBCKERNELSRC) ARCH=$(KLIBCARCH) INSTALL_HDR_PATH=$(INSTALLROOT)$(INSTALLDIR)/$(KCROSS) headers_install
+ $(Q)cp -rf usr/include/. $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/.
+ $(Q)$(install-data) $(srctree)/klcc/klcc.1 $(INSTALLROOT)$(mandir)/man1/$(KCROSS)klcc.1
+ $(Q)$(install-bin) $(objtree)/klcc/$(KCROSS)klcc $(INSTALLROOT)$(bindir)
+--
+1.6.5
+
diff --git a/patches/klibc-1.5.15/0017-klibc-use-kernel-header-installed-by-headers_install.patch b/patches/klibc-1.5.15/0017-klibc-use-kernel-header-installed-by-headers_install.patch
new file mode 100644
index 000000000..315c2b4de
--- /dev/null
+++ b/patches/klibc-1.5.15/0017-klibc-use-kernel-header-installed-by-headers_install.patch
@@ -0,0 +1,68 @@
+From 7ed3a34dee03f6c0bd27e659e159f997b0d33a4c Mon Sep 17 00:00:00 2001
+From: Marc Kleine-Budde <mkl@pengutronix.de>
+Date: Mon, 5 Jan 2009 17:46:47 +0100
+Subject: [PATCH 17/21] [klibc] use kernel header installed by "headers_install"
+
+Originally klibc directly sets the compiler header search path
+directly into the kernel tree. This causes compilation to fail on modern
+kernel with a changed include dir layout.
+
+This patch uses the "headers_install" to extract the includes from the
+kernel. Against these headers klibc is build.
+
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+---
+ Makefile | 8 ++++++--
+ scripts/Kbuild.klibc | 2 +-
+ 2 files changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 136d4e8..965fbfd 100644
+--- a/Makefile
++++ b/Makefile
+@@ -3,6 +3,7 @@ SRCROOT = .
+ # kbuild compatibility
+ export srctree := $(shell pwd)
+ export objtree := $(shell pwd)
++export LINUX_HEADERS := $(objtree)/linux-headers
+ export KLIBCSRC := usr/klibc
+ export VERSION := $(shell cat $(KLIBCSRC)/version)
+ export KLIBCINC := usr/include
+@@ -93,16 +94,19 @@ linux:
+ @echo "configured for the $(KLIBCARCH) architecture."
+ @false
+
++$(LINUX_HEADERS): linux
++ $(Q)$(MAKE) -C $(KLIBCKERNELSRC) ARCH=$(KLIBCARCH) INSTALL_HDR_PATH="$@" headers_install
++
+ rpmbuild = $(shell which rpmbuild 2>/dev/null || which rpm)
+
+ klibc.spec: klibc.spec.in $(KLIBCSRC)/version
+ sed -e 's/@@VERSION@@/$(VERSION)/g' < $< > $@
+
+ # Build klcc - it is the first target
+-klcc: .config
++klcc: .config $(LINUX_HEADERS)
+ $(Q)$(MAKE) $(klibc)=klcc
+
+-klibc: .config
++klibc: .config $(LINUX_HEADERS)
+ $(Q)$(MAKE) $(klibc)=.
+
+ test: klibc
+diff --git a/scripts/Kbuild.klibc b/scripts/Kbuild.klibc
+index 227b9bd..5e5ac3d 100644
+--- a/scripts/Kbuild.klibc
++++ b/scripts/Kbuild.klibc
+@@ -103,7 +103,7 @@ KLIBCCPPFLAGS := -nostdinc -iwithprefix include \
+ -I$(KLIBCINC)
+ # kernel include paths
+ KLIBCKERNELSRC ?= $(srctree)/
+-KLIBCCPPFLAGS += -I$(KLIBCKERNELSRC)include \
++KLIBCCPPFLAGS += -I$(LINUX_HEADERS)/include \
+ $(if $(KBUILD_SRC),-I$(KLIBCKERNELOBJ)include2 -I$(KLIBCKERNELOBJ)include -I$(srctree)/include) \
+ $(KLIBCARCHINCFLAGS)
+
+--
+1.6.5
+
diff --git a/patches/klibc-1.5.15/0018-Patch-to-add-support-for-detection-of-vfat-and-jffs2.patch b/patches/klibc-1.5.15/0018-Patch-to-add-support-for-detection-of-vfat-and-jffs2.patch
new file mode 100644
index 000000000..60f1d8fac
--- /dev/null
+++ b/patches/klibc-1.5.15/0018-Patch-to-add-support-for-detection-of-vfat-and-jffs2.patch
@@ -0,0 +1,58 @@
+From 6b24aece3e313aece16ce60255e918963b0905b3 Mon Sep 17 00:00:00 2001
+From: Jon Ringle <jon@ringle.org>
+Date: Thu, 29 Oct 2009 16:27:11 +0100
+Subject: [PATCH 18/21] Patch to add support for detection of vfat and jffs2 images.
+
+Obtained from openembedded:
+http://cgit.openembedded.org/cgit.cgi/openembedded/tree/recipes/klibc/klibc-1.5.15/fstype-sane-vfat-and-jffs2-for-1.5.patch
+
+Signed-off-by: Jon Ringle <jon@ringle.org>
+[mkl: fixed compiler warnings]
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+---
+ usr/kinit/fstype/fstype.c | 22 ++++++++++++++++++++++
+ 1 files changed, 22 insertions(+), 0 deletions(-)
+
+diff --git a/usr/kinit/fstype/fstype.c b/usr/kinit/fstype/fstype.c
+index 69e0e30..d06bcd1 100644
+--- a/usr/kinit/fstype/fstype.c
++++ b/usr/kinit/fstype/fstype.c
+@@ -59,6 +59,26 @@
+ /* Swap needs the definition of block size */
+ #include "swap_fs.h"
+
++static int jffs2_image(const void *buf, unsigned long long *bytes)
++{
++ const unsigned char *cbuf = buf;
++
++ if (cbuf[0] == 0x85 && cbuf[1] == 0x19)
++ return 1;
++
++ return 0;
++}
++
++static int vfat_image(const void *buf, unsigned long long *bytes)
++{
++ if (!strncmp(buf + 54, "FAT12 ", 8)
++ || !strncmp(buf + 54, "FAT16 ", 8)
++ || !strncmp(buf + 82, "FAT32 ", 8))
++ return 1;
++
++ return 0;
++}
++
+ static int gzip_image(const void *buf, unsigned long long *bytes)
+ {
+ const unsigned char *p = buf;
+@@ -492,6 +512,8 @@ static struct imagetype images[] = {
+ {1, "minix", minix_image},
+ {1, "nilfs2", nilfs2_image},
+ {2, "ocfs2", ocfs2_image},
++ {0, "jffs2", jffs2_image},
++ {0, "vfat", vfat_image},
+ {8, "reiserfs", reiserfs_image},
+ {64, "reiserfs", reiserfs_image},
+ {64, "reiser4", reiser4_image},
+--
+1.6.5
+
diff --git a/patches/klibc-1.5.15/0019-define-__socklen_t_defined.patch b/patches/klibc-1.5.15/0019-define-__socklen_t_defined.patch
new file mode 100644
index 000000000..8ea36cb7a
--- /dev/null
+++ b/patches/klibc-1.5.15/0019-define-__socklen_t_defined.patch
@@ -0,0 +1,26 @@
+From 7199462a5dee51bf83db3ea6cc753b9864c26623 Mon Sep 17 00:00:00 2001
+From: Jon Ringle <jon@ringle.org>
+Date: Thu, 29 Oct 2009 16:27:13 +0100
+Subject: [PATCH 19/21] define "__socklen_t_defined"
+
+Signed-off-by: Jon Ringle <jon@ringle.org>
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+---
+ usr/include/sys/socket.h | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/usr/include/sys/socket.h b/usr/include/sys/socket.h
+index 7d47087..d7d4ce4 100644
+--- a/usr/include/sys/socket.h
++++ b/usr/include/sys/socket.h
+@@ -28,6 +28,7 @@
+ #endif
+
+ typedef int socklen_t;
++#define __socklen_t_defined 1
+
+ __extern int socket(int, int, int);
+ __extern int bind(int, struct sockaddr *, int);
+--
+1.6.5
+
diff --git a/patches/klibc-1.5.15/0020-fix-warning-include-signal.h-47-5-warning-SIGRTMAX-i.patch b/patches/klibc-1.5.15/0020-fix-warning-include-signal.h-47-5-warning-SIGRTMAX-i.patch
new file mode 100644
index 000000000..09cbd2ddc
--- /dev/null
+++ b/patches/klibc-1.5.15/0020-fix-warning-include-signal.h-47-5-warning-SIGRTMAX-i.patch
@@ -0,0 +1,31 @@
+From e3cbc39bf1a94056f4a4bbae0067109d0317e68b Mon Sep 17 00:00:00 2001
+From: Jon Ringle <jon@ringle.org>
+Date: Thu, 29 Oct 2009 16:27:14 +0100
+Subject: [PATCH 20/21] fix warning include/signal.h:47:5: warning: "SIGRTMAX" is not defined
+
+Signed-off-by: Jon Ringle <jon@ringle.org>
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+---
+ usr/include/signal.h | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/usr/include/signal.h b/usr/include/signal.h
+index a513282..4ed65bc 100644
+--- a/usr/include/signal.h
++++ b/usr/include/signal.h
+@@ -44,10 +44,12 @@ typedef int sig_atomic_t;
+ /* The kernel header files are inconsistent whether or not
+ SIGRTMAX is inclusive or exclusive. POSIX seems to state that
+ it's inclusive, however. */
++#ifdef SIGRTMAX
+ #if SIGRTMAX >= _NSIG
+ # undef SIGRTMAX
+ # define SIGRTMAX (_NSIG-1)
+ #endif
++#endif
+
+ __extern const char *const sys_siglist[_NSIG];
+ __extern const char *const sys_sigabbrev[_NSIG];
+--
+1.6.5
+
diff --git a/patches/klibc-1.5.15/0021-Fix-no-previous-prototype-__ctype_-warnings.patch b/patches/klibc-1.5.15/0021-Fix-no-previous-prototype-__ctype_-warnings.patch
new file mode 100644
index 000000000..328702c47
--- /dev/null
+++ b/patches/klibc-1.5.15/0021-Fix-no-previous-prototype-__ctype_-warnings.patch
@@ -0,0 +1,55 @@
+From c4b9ce60a61d47a4f5244d7b86e8e30157149612 Mon Sep 17 00:00:00 2001
+From: Jon Ringle <jon@ringle.org>
+Date: Thu, 29 Oct 2009 16:27:16 +0100
+Subject: [PATCH 21/21] Fix no previous prototype __ctype_* warnings
+
+<...>/usr/lib/klibc/include/ctype.h:63: warning: no previous prototype for '__ctype_isascii'
+<...>/usr/lib/klibc/include/ctype.h:68: warning: no previous prototype for '__ctype_isblank'
+<...>/usr/lib/klibc/include/ctype.h:73: warning: no previous prototype for '__ctype_iscntrl'
+<...>/usr/lib/klibc/include/ctype.h:78: warning: no previous prototype for '__ctype_isdigit'
+<...>/usr/lib/klibc/include/ctype.h:83: warning: no previous prototype for '__ctype_isgraph'
+<...>/usr/lib/klibc/include/ctype.h:89: warning: no previous prototype for '__ctype_islower'
+<...>/usr/lib/klibc/include/ctype.h:94: warning: no previous prototype for '__ctype_isprint'
+<...>/usr/lib/klibc/include/ctype.h:99: warning: no previous prototype for '__ctype_ispunct'
+<...>/usr/lib/klibc/include/ctype.h:104: warning: no previous prototype for '__ctype_isspace'
+<...>/usr/lib/klibc/include/ctype.h:109: warning: no previous prototype for '__ctype_isupper'
+<...>/usr/lib/klibc/include/ctype.h:114: warning: no previous prototype for '__ctype_isxdigit'
+<...>/usr/lib/klibc/include/ctype.h:123: warning: no previous prototype for '__ctype_toupper'
+<...>/usr/lib/klibc/include/ctype.h:128: warning: no previous prototype for '__ctype_tolower'
+
+Signed-off-by: Jon Ringle <jon@ringle.org>
+Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
+---
+ usr/include/ctype.h | 16 ++++++++++++++++
+ 1 files changed, 16 insertions(+), 0 deletions(-)
+
+diff --git a/usr/include/ctype.h b/usr/include/ctype.h
+index dfe1c46..ef7cac4 100644
+--- a/usr/include/ctype.h
++++ b/usr/include/ctype.h
+@@ -45,6 +45,22 @@ __extern int isxdigit(int);
+ __extern int toupper(int);
+ __extern int tolower(int);
+
++__must_inline int __ctype_isalnum(int);
++__must_inline int __ctype_isalpha(int);
++__must_inline int __ctype_isascii(int);
++__must_inline int __ctype_isblank(int);
++__must_inline int __ctype_iscntrl(int);
++__must_inline int __ctype_isdigit(int);
++__must_inline int __ctype_isgraph(int);
++__must_inline int __ctype_islower(int);
++__must_inline int __ctype_isprint(int);
++__must_inline int __ctype_ispunct(int);
++__must_inline int __ctype_isspace(int);
++__must_inline int __ctype_isupper(int);
++__must_inline int __ctype_isxdigit(int);
++__must_inline int __ctype_toupper(int);
++__must_inline int __ctype_tolower(int);
++
+ extern const unsigned char __ctypes[];
+
+ __must_inline int __ctype_isalnum(int __c)
+--
+1.6.5
+
diff --git a/patches/klibc-1.5.15/0022-define-MNTPROC_MNT-and-MNTPROC_UMNT.patch b/patches/klibc-1.5.15/0022-define-MNTPROC_MNT-and-MNTPROC_UMNT.patch
new file mode 100644
index 000000000..18242fb5e
--- /dev/null
+++ b/patches/klibc-1.5.15/0022-define-MNTPROC_MNT-and-MNTPROC_UMNT.patch
@@ -0,0 +1,35 @@
+From e9e9c8de22d279face697eb50dd4d9b2f45b3b1d Mon Sep 17 00:00:00 2001
+From: Jon Ringle <jon@ringle.org>
+Date: Fri, 30 Oct 2009 09:06:05 -0400
+Subject: [PATCH 22/22] define MNTPROC_MNT and MNTPROC_UMNT
+
+MNTPROC_MNT and MNTPROC_UMNT are no longer defined in linux-2.6.31
+Hack around this by restoring the old definitions.
+
+http://thread.gmane.org/gmane.linux.nfs/28059
+suggests that a better fix is in progress.
+
+Signed-off-by: Jon Ringle <jon@ringle.org>
+---
+ usr/kinit/nfsmount/mount.c | 5 +++++
+ 1 files changed, 5 insertions(+), 0 deletions(-)
+
+diff --git a/usr/kinit/nfsmount/mount.c b/usr/kinit/nfsmount/mount.c
+index a55af91..1182ae5 100644
+--- a/usr/kinit/nfsmount/mount.c
++++ b/usr/kinit/nfsmount/mount.c
+@@ -12,6 +12,11 @@
+ #include "nfsmount.h"
+ #include "sunrpc.h"
+
++#ifndef MNTPROC_MNT
++#define MNTPROC_MNT 1
++#define MNTPROC_UMNT 3
++#endif
++
+ static uint32_t mount_port;
+
+ struct mount_call {
+--
+1.6.5.rc2
+
diff --git a/patches/klibc-1.5.15/series b/patches/klibc-1.5.15/series
index 6268d03cf..29cde0d12 100644
--- a/patches/klibc-1.5.15/series
+++ b/patches/klibc-1.5.15/series
@@ -1 +1,22 @@
-0001-add-linux-arch-ARCH-include-to-search-path.patch
+0001-klibc-add-strtok_r.patch
+0002-klibc-Add-initial-mntent.h-with-setmntent-and-endmnt.patch
+0003-klibc-add-getmntent.patch
+0004-klibc-mount-add-help-arg-for-usage.patch
+0005-klibc-mount-list-all-mounted-file-systems.patch
+0006-klibc-mount-list-fs-of-particular-type.patch
+0007-klibc-mount-read-proc-mounts-preferably.patch
+0008-klibc-ipconfig-raise-field-length-for-rootpath-DHCP-.patch
+0009-klibc-ipconfig-set-null-ciaddr-on-DHCPREQUEST-during.patch
+0010-klibc-1.5.15-released-next-version-is-1.5.16.patch
+0011-klibc-fix-must_inline-macro-in-klibc-compiler.h-for-.patch
+0012-ipconfig-omit-zero-length-DHCP-vendor_class_identifi.patch
+0013-ipconfig-send-requested-hostname-in-DHCP-discover-re.patch
+0014-klibc-use-headers_install-to-install-headers.patch
+0015-klibc-utils-add-simple-ls.patch
+0016-klibc-use-MAKE-instead-of-make-to-call-external-make.patch
+0017-klibc-use-kernel-header-installed-by-headers_install.patch
+0018-Patch-to-add-support-for-detection-of-vfat-and-jffs2.patch
+0019-define-__socklen_t_defined.patch
+0020-fix-warning-include-signal.h-47-5-warning-SIGRTMAX-i.patch
+0021-Fix-no-previous-prototype-__ctype_-warnings.patch
+0022-define-MNTPROC_MNT-and-MNTPROC_UMNT.patch