summaryrefslogtreecommitdiff
path: root/packages/klibc
diff options
context:
space:
mode:
Diffstat (limited to 'packages/klibc')
-rw-r--r--packages/klibc/files/fstype-sane-and-vfat-jffs2.patch (renamed from packages/klibc/files/fstype-sane-and-vfat.patch)24
-rw-r--r--packages/klibc/files/install.patch42
-rw-r--r--packages/klibc/files/klibc-config-eabi.patch9
-rw-r--r--packages/klibc/files/klibc_kexecsyscall.patch11
-rw-r--r--packages/klibc/files/staging.patch144
-rw-r--r--packages/klibc/klibc-common.inc29
-rw-r--r--packages/klibc/klibc-utils-fstype_1.1.1.bb4
-rw-r--r--packages/klibc/klibc-utils-static_1.5.bb94
-rw-r--r--packages/klibc/klibc.inc203
-rw-r--r--packages/klibc/klibc_1.1.1.bb3
-rw-r--r--packages/klibc/klibc_1.5.bb (renamed from packages/klibc/klibc_0.190.bb)1
11 files changed, 438 insertions, 126 deletions
diff --git a/packages/klibc/files/fstype-sane-and-vfat.patch b/packages/klibc/files/fstype-sane-and-vfat-jffs2.patch
index 7b7674637a..e89c5adb9a 100644
--- a/packages/klibc/files/fstype-sane-and-vfat.patch
+++ b/packages/klibc/files/fstype-sane-and-vfat-jffs2.patch
@@ -1,8 +1,6 @@
-Patch to compile fstype util against "normal" libc (glibc/uclicb), and to
-add vfat detection.
-
---- klibc-1.1.1/utils/fstype.c.org 2005-09-06 23:49:34.000000000 +0300
-+++ klibc-1.1.1/utils/fstype.c 2007-11-24 01:07:26.000000000 +0200
+diff -r 3c9d84425ba7 utils/fstype.c
+--- a/utils/fstype.c Thu Feb 14 02:09:30 2008 +0200
++++ b/utils/fstype.c Thu Feb 14 02:13:46 2008 +0200
@@ -13,11 +13,18 @@
*/
@@ -22,10 +20,19 @@ add vfat detection.
#define cpu_to_be32(x) __cpu_to_be32(x) /* Needed by romfs_fs.h */
-@@ -105,6 +112,18 @@
+@@ -105,6 +112,27 @@ static int romfs_image(const unsigned ch
return 0;
}
++static int jffs2_image(const unsigned char *buf, unsigned long *blocks)
++{
++ // Very sloppy! ;-E
++ if (*buf == 0x85 && buf[1] == 0x19)
++ return 1;
++
++ return 0;
++}
++
+static int vfat_image(const unsigned char *buf, unsigned long *blocks)
+{
+ const struct romfs_super_block *sb =
@@ -41,7 +48,7 @@ add vfat detection.
static int minix_image(const unsigned char *buf, unsigned long *blocks)
{
const struct minix_super_block *sb =
-@@ -167,8 +186,6 @@
+@@ -167,8 +195,6 @@ static int xfs_image(const unsigned char
(const struct xfs_sb *)buf;
if (__be32_to_cpu(sb->sb_magicnum) == XFS_SB_MAGIC) {
@@ -50,10 +57,11 @@ add vfat detection.
return 1;
}
return 0;
-@@ -184,6 +201,7 @@
+@@ -184,6 +210,8 @@ static struct imagetype images[] = {
{ 0, "gzip", gzip_image },
{ 0, "cramfs", cramfs_image },
{ 0, "romfs", romfs_image },
++ { 0, "jffs2", jffs2_image },
+ { 0, "vfat", vfat_image },
{ 0, "xfs", xfs_image },
{ 1, "minix", minix_image },
diff --git a/packages/klibc/files/install.patch b/packages/klibc/files/install.patch
deleted file mode 100644
index b165e8b177..0000000000
--- a/packages/klibc/files/install.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-# These are OE specific patches which make the install stuff work
-# in the OE build environment and fix the problem that the gzip
-# stuff should be all links to one executable but end up being
-# copies
---- klibc-1.1.1/Makefile.orig 2005-12-29 14:20:09.080981353 -0800
-+++ klibc-1.1.1/Makefile 2005-12-29 14:20:25.634022970 -0800
-@@ -61,7 +61,7 @@ local-install: $(CROSS)klcc
- mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(CROSS)include/$$d ; \
- for r in $(KRNLSRC)/include $(KRNLOBJ)/include $(KRNLOBJ)/include2 ; do \
- [ ! -d $$r/$$d ] || \
-- cp -rfL $$r/$$d/. $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/$$d/. ; \
-+ cp -rf $$r/$$d/. $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/$$d/. ; \
- done ; \
- done
- cd $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include && ln -sf asm-$(ARCH) asm
---- klibc-1.1.1/gzip/Makefile.orig 2005-12-29 18:10:00.787869930 -0800
-+++ klibc-1.1.1/gzip/Makefile 2005-12-29 18:11:21.084922705 -0800
-@@ -70,9 +70,12 @@ clean:
- spotless: clean
- rm -f *~
-
--# These should presumably be shared...
- install: all
-- $(INSTALL_EXEC) gzip gunzip zcat $(INSTALLROOT)$(INSTALLDIR)/$(CROSS)bin
-+ $(INSTALL_EXEC) gzip $(INSTALLROOT)$(INSTALLDIR)/$(CROSS)bin
-+ rm -f $(INSTALLROOT)$(INSTALLDIR)/$(CROSS)bin/gunzip
-+ ln $(INSTALLROOT)$(INSTALLDIR)/$(CROSS)bin/gzip $(INSTALLROOT)$(INSTALLDIR)/$(CROSS)bin/gunzip
-+ rm -f $(INSTALLROOT)$(INSTALLDIR)/$(CROSS)bin/zcat
-+ ln $(INSTALLROOT)$(INSTALLDIR)/$(CROSS)bin/gzip $(INSTALLROOT)$(INSTALLDIR)/$(CROSS)bin/zcat
-
- ifneq ($(wildcard .*.d),)
- include $(wildcard .*.d)
---- klibc-1.1.1/klibc/Makefile.orig 2005-12-30 10:39:04.504930675 -0800
-+++ klibc-1.1.1/klibc/Makefile 2005-12-30 10:39:52.755966921 -0800
-@@ -184,6 +184,7 @@ install: all
- $(INSTALLROOT)$(INSTALLDIR)/$(CROSS)lib
- $(INSTALL_EXEC) klibc-`cat $(SOLIB).hash`.so \
- $(INSTALLROOT)$(INSTALLDIR)/$(CROSS)lib
-+ test -z "$(INSTALLROOT)" || \
- $(INSTALL_EXEC) klibc-`cat $(SOLIB).hash`.so \
- $(INSTALLROOT)/$(SHLIBDIR)
-
diff --git a/packages/klibc/files/klibc-config-eabi.patch b/packages/klibc/files/klibc-config-eabi.patch
new file mode 100644
index 0000000000..86517f0594
--- /dev/null
+++ b/packages/klibc/files/klibc-config-eabi.patch
@@ -0,0 +1,9 @@
+diff -Nur klibc-1.5/defconfig klibc-1.5p/defconfig
+--- klibc-1.5/defconfig 2007-03-04 02:52:10.000000000 +0100
++++ klibc-1.5p/defconfig 2008-02-08 19:24:22.337127756 +0100
+@@ -5,4 +5,4 @@
+ CONFIG_REGPARM=y
+ # ARM options
+ # CONFIG_KLIBC_THUMB is not set
+-# CONFIG_AEABI is not set
++CONFIG_AEABI=y
diff --git a/packages/klibc/files/klibc_kexecsyscall.patch b/packages/klibc/files/klibc_kexecsyscall.patch
new file mode 100644
index 0000000000..9b2dca4738
--- /dev/null
+++ b/packages/klibc/files/klibc_kexecsyscall.patch
@@ -0,0 +1,11 @@
+--- klibc-1.5/usr/klibc/SYSCALLS.def 2007-03-04 02:52:10.000000000 +0100
++++ klibc.clean/usr/klibc/SYSCALLS.def 2008-02-22 17:12:23.663612084 +0100
+@@ -13,6 +13,8 @@
+ #include <asm/unistd.h>
+ #include <klibc/sysconfig.h>
+ #include <bitsize.h>
++#include <asm/kexec.h>
++long kexec_load(void *, unsigned long , struct kexec_segment *, unsigned long );
+
+ /*
+ * Process-related syscalls
diff --git a/packages/klibc/files/staging.patch b/packages/klibc/files/staging.patch
new file mode 100644
index 0000000000..215daad456
--- /dev/null
+++ b/packages/klibc/files/staging.patch
@@ -0,0 +1,144 @@
+Index: klibc-1.5/Makefile
+===================================================================
+--- klibc-1.5.orig/Makefile 2007-03-04 02:52:10.000000000 +0100
++++ klibc-1.5/Makefile 2008-02-24 15:25:15.213824149 +0100
+@@ -33,7 +33,7 @@
+ export PERL := perl
+
+ # Location for installation
+-export prefix = /usr
++export prefix = $(INST)
+ export bindir = $(prefix)/bin
+ export libdir = $(prefix)/lib
+ export mandir = $(prefix)/man
+Index: klibc-1.5/scripts/Kbuild.install
+===================================================================
+--- klibc-1.5.orig/scripts/Kbuild.install 2007-03-04 02:52:10.000000000 +0100
++++ klibc-1.5/scripts/Kbuild.install 2008-02-24 15:24:28.085825030 +0100
+@@ -88,25 +88,21 @@
+ header:
+ $(Q)echo " INSTALL headers + man pages to $(INSTALLROOT)$(INSTALLDIR)"
+ $(Q)mkdir -p $(INSTALLROOT)$(bindir)
+- $(Q)mkdir -p $(INSTALLROOT)$(mandir)/man1
+- $(Q)mkdir -p $(INSTALLROOT)$(SHLIBDIR)
+ $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)
+ $(Q)-rm -rf $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include
+ $(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 scsi asm-$(KLIBCARCH) asm-generic $(ASMKLIBCARCH); do \
+ mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KLIBCCROSS)include/$$d ; \
+ for r in $(KLIBCKERNELSRC)/include $(KLIBCKERNELOBJ)/include \
+ $(KLIBCKERNELOBJ)/include2 ; do \
+ [ ! -d $$r/$$d ] || \
+- cp -rfL $$r/$$d/. \
++ cp -rfd $$r/$$d/. \
+ $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/$$d/. ; \
+ done ; \
+ done
+ $(Q)cd $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include && ln -sf asm-$(KLIBCARCH) asm
+ $(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)
+
+ footer: header
+Index: klibc-1.5/usr/dash/Kbuild
+===================================================================
+--- klibc-1.5.orig/usr/dash/Kbuild 2007-03-04 02:52:10.000000000 +0100
++++ klibc-1.5/usr/dash/Kbuild 2008-02-24 15:13:50.189827040 +0100
+@@ -107,5 +107,3 @@
+ $(obj)/arith.c: $(obj)/arith.h
+ $(Q):
+
+-# Targets to install
+-install-y := sh.shared
+Index: klibc-1.5/usr/gzip/Kbuild
+===================================================================
+--- klibc-1.5.orig/usr/gzip/Kbuild 2007-03-04 02:52:10.000000000 +0100
++++ klibc-1.5/usr/gzip/Kbuild 2008-02-24 15:13:50.197824604 +0100
+@@ -21,5 +21,3 @@
+ # Cleaning
+ targets := gzip gzip.g gunzip zcat
+
+-# Targets to install
+-install-y := gzip gunzip zcat
+Index: klibc-1.5/usr/kinit/fstype/Kbuild
+===================================================================
+--- klibc-1.5.orig/usr/kinit/fstype/Kbuild 2007-03-04 02:52:10.000000000 +0100
++++ klibc-1.5/usr/kinit/fstype/Kbuild 2008-02-24 15:13:50.201824503 +0100
+@@ -21,5 +21,3 @@
+ # Cleaning
+ clean-dirs := static shared
+
+-# install binary
+-install-y := $(shared-y)
+Index: klibc-1.5/usr/kinit/ipconfig/Kbuild
+===================================================================
+--- klibc-1.5.orig/usr/kinit/ipconfig/Kbuild 2007-03-04 02:52:10.000000000 +0100
++++ klibc-1.5/usr/kinit/ipconfig/Kbuild 2008-02-24 15:13:50.205824123 +0100
+@@ -27,5 +27,3 @@
+ # Cleaning
+ clean-dirs := static shared
+
+-# install binary
+-install-y := $(shared-y)
+Index: klibc-1.5/usr/kinit/Kbuild
+===================================================================
+--- klibc-1.5.orig/usr/kinit/Kbuild 2007-03-04 02:52:10.000000000 +0100
++++ klibc-1.5/usr/kinit/Kbuild 2008-02-24 15:13:50.209824302 +0100
+@@ -33,5 +33,3 @@
+ subdir- := fstype ipconfig nfsmount resume run-init
+
+
+-# install binary
+-install-y := kinit kinit.shared
+Index: klibc-1.5/usr/kinit/nfsmount/Kbuild
+===================================================================
+--- klibc-1.5.orig/usr/kinit/nfsmount/Kbuild 2007-03-04 02:52:10.000000000 +0100
++++ klibc-1.5/usr/kinit/nfsmount/Kbuild 2008-02-24 15:13:50.213824201 +0100
+@@ -23,5 +23,3 @@
+
+ clean-dirs := static shared
+
+-# Install binary
+-install-y := $(shared-y)
+Index: klibc-1.5/usr/kinit/resume/Kbuild
+===================================================================
+--- klibc-1.5.orig/usr/kinit/resume/Kbuild 2007-03-04 02:52:10.000000000 +0100
++++ klibc-1.5/usr/kinit/resume/Kbuild 2008-02-24 15:13:50.217824380 +0100
+@@ -26,5 +26,3 @@
+ # Cleaning
+ clean-dirs := static shared
+
+-# install binary
+-install-y := $(shared-y)
+Index: klibc-1.5/usr/kinit/run-init/Kbuild
+===================================================================
+--- klibc-1.5.orig/usr/kinit/run-init/Kbuild 2007-03-04 02:52:10.000000000 +0100
++++ klibc-1.5/usr/kinit/run-init/Kbuild 2008-02-24 15:13:50.221824559 +0100
+@@ -21,5 +21,3 @@
+ # Cleaning
+ clean-dirs := static shared
+
+-# install binary
+-install-y := $(shared-y)
+Index: klibc-1.5/usr/klibc/Kbuild
+===================================================================
+--- klibc-1.5.orig/usr/klibc/Kbuild 2007-03-04 02:52:10.000000000 +0100
++++ klibc-1.5/usr/klibc/Kbuild 2008-02-24 15:13:50.229824358 +0100
+@@ -175,5 +175,3 @@
+ $(INSTALLROOT)$(INSTALLDIR)/$(KLIBCCROSS)lib))
+ $(Q)$(install-lib) $(obj)/klibc-$(SOLIBHASH).so \
+ $(INSTALLROOT)$(INSTALLDIR)/$(KLIBCCROSS)lib
+- $(Q)$(install-lib) $(obj)/klibc-$(SOLIBHASH).so \
+- $(INSTALLROOT)$(SHLIBDIR)
+Index: klibc-1.5/usr/utils/Kbuild
+===================================================================
+--- klibc-1.5.orig/usr/utils/Kbuild 2007-03-04 02:52:10.000000000 +0100
++++ klibc-1.5/usr/utils/Kbuild 2008-02-24 15:13:50.229824358 +0100
+@@ -64,5 +64,3 @@
+ # Clean deletes the static and shared dir
+ clean-dirs := static shared
+
+-# install only install the shared binaries
+-install-y := $(shared-y) shared/reboot shared/poweroff
diff --git a/packages/klibc/klibc-common.inc b/packages/klibc/klibc-common.inc
new file mode 100644
index 0000000000..76e393796a
--- /dev/null
+++ b/packages/klibc/klibc-common.inc
@@ -0,0 +1,29 @@
+DEPENDS = "virtual/kernel perl-native"
+SECTION = "libs"
+DESCRIPTION = "klibc is intended to be a minimalistic libc subset for \
+use with initramfs. It is deliberately written for small size, \
+minimal entaglement, and portability, not speed."
+LICENSE = "BSD-ADV"
+SRC_URI = "${KERNELORG_MIRROR}/pub/linux/libs/klibc/Stable/klibc-${PV}.tar.bz2"
+S = "${WORKDIR}/klibc-${PV}"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+KLIBC_ARCH = '${TARGET_ARCH}'
+KLIBC_ARCH_armeb = 'arm'
+KLIBC_ARCH_mipsel = 'mips'
+
+# the klibc code contains ARM instructions (for ARM), this
+# could be fixed, but for the moment:
+ARM_INSTRUCTION_SET = "arm"
+
+SRC_URI_append_linux-gnueabi = "file://klibc-config-eabi.patch;patch=1"
+SRC_URI_append_linux-uclibcgnueabi = "file://klibc-config-eabi.patch;patch=1"
+
+EXTRA_OEMAKE = "'KLIBCARCH=${KLIBC_ARCH}' \
+ 'CROSS_COMPILE=${TARGET_PREFIX}' \
+ "
+
+do_configure () {
+ ln -sf ${STAGING_KERNEL_DIR} linux
+}
+
diff --git a/packages/klibc/klibc-utils-fstype_1.1.1.bb b/packages/klibc/klibc-utils-fstype_1.1.1.bb
index 29ce38285c..2bcc0f6085 100644
--- a/packages/klibc/klibc-utils-fstype_1.1.1.bb
+++ b/packages/klibc/klibc-utils-fstype_1.1.1.bb
@@ -1,6 +1,6 @@
SRC_URI = "${KERNELORG_MIRROR}/pub/linux/libs/klibc/Stable/klibc-${PV}.tar.bz2"
-SRC_URI += "file://fstype-sane-and-vfat.patch;patch=1"
-PR = "r0"
+SRC_URI += "file://fstype-sane-and-vfat-jffs2.patch;patch=1"
+PR = "r1"
S = "${WORKDIR}/klibc-${PV}"
diff --git a/packages/klibc/klibc-utils-static_1.5.bb b/packages/klibc/klibc-utils-static_1.5.bb
new file mode 100644
index 0000000000..f9c9923212
--- /dev/null
+++ b/packages/klibc/klibc-utils-static_1.5.bb
@@ -0,0 +1,94 @@
+require klibc-common.inc
+
+PR = "r6"
+
+
+# We only want the static utils. klibc build both. So we install only what we want.
+do_install() {
+ install -d ${D}${base_bindir}
+ install -m 755 usr/dash/sh ${D}${base_bindir}
+ install -m 755 usr/gzip/gzip ${D}${base_bindir}
+ install -m 755 usr/kinit/kinit ${D}${base_bindir}
+ install -m 755 usr/kinit/fstype/static/fstype ${D}${base_bindir}
+ install -m 755 usr/kinit/ipconfig/static/ipconfig ${D}${base_bindir}
+ install -m 755 usr/kinit/nfsmount/static/nfsmount ${D}${base_bindir}
+ install -m 755 usr/kinit/resume/static/resume ${D}${base_bindir}
+ install -m 755 usr/kinit/run-init/static/run-init ${D}${base_bindir}
+ install -m 755 usr/utils/static/cat ${D}${base_bindir}
+ install -m 755 usr/utils/static/chroot ${D}${base_bindir}
+ install -m 755 usr/utils/static/cpio ${D}${base_bindir}
+ install -m 755 usr/utils/static/dd ${D}${base_bindir}
+ install -m 755 usr/utils/static/false ${D}${base_bindir}
+ install -m 755 usr/utils/static/halt ${D}${base_bindir}
+ install -m 755 usr/utils/static/insmod ${D}${base_bindir}
+ install -m 755 usr/utils/static/kill ${D}${base_bindir}
+ install -m 755 usr/utils/static/ln ${D}${base_bindir}
+ install -m 755 usr/utils/static/minips ${D}${base_bindir}
+ install -m 755 usr/utils/static/mkdir ${D}${base_bindir}
+ install -m 755 usr/utils/static/mkfifo ${D}${base_bindir}
+ install -m 755 usr/utils/static/mknod ${D}${base_bindir}
+ install -m 755 usr/utils/static/mount ${D}${base_bindir}
+ install -m 755 usr/utils/static/nuke ${D}${base_bindir}
+ install -m 755 usr/utils/static/pivot_root ${D}${base_bindir}
+ install -m 755 usr/utils/static/poweroff ${D}${base_bindir}
+ install -m 755 usr/utils/static/readlink ${D}${base_bindir}
+ install -m 755 usr/utils/static/reboot ${D}${base_bindir}
+ install -m 755 usr/utils/static/sleep ${D}${base_bindir}
+ install -m 755 usr/utils/static/true ${D}${base_bindir}
+ install -m 755 usr/utils/static/umount ${D}${base_bindir}
+ install -m 755 usr/utils/static/uname ${D}${base_bindir}
+ cd ${D}${base_bindir}
+ ln -s gzip gunzip
+ ln -s gzip zcat
+ cd -
+}
+
+PACKAGES = "klibc-utils-static-sh klibc-utils-static-gzip \
+ klibc-utils-static-kinit klibc-utils-static-fstype \
+ klibc-utils-static-ipconfig klibc-utils-static-nfsmount \
+ klibc-utils-static-resume klibc-utils-static-run-init \
+ klibc-utils-static-cat klibc-utils-static-chroot \
+ klibc-utils-static-cpio klibc-utils-static-dd \
+ klibc-utils-static-false klibc-utils-static-halt \
+ klibc-utils-static-insmod klibc-utils-static-kill \
+ klibc-utils-static-ln klibc-utils-static-minips \
+ klibc-utils-static-mkdir klibc-utils-static-mkfifo \
+ klibc-utils-static-mknod klibc-utils-static-mount \
+ klibc-utils-static-nuke klibc-utils-static-pivot-root \
+ klibc-utils-static-poweroff klibc-utils-static-readlink \
+ klibc-utils-static-reboot klibc-utils-static-sleep \
+ klibc-utils-static-true klibc-utils-static-umount \
+ klibc-utils-static-uname \
+ "
+
+FILES_klibc-utils-static-sh = "${base_bindir}/sh"
+FILES_klibc-utils-static-gzip = "${base_bindir}/gzip ${base_bindir}/gunzip ${base_bindir}/zcat"
+FILES_klibc-utils-static-kinit = "${base_bindir}/kinit"
+FILES_klibc-utils-static-fstype = "${base_bindir}/fstype"
+FILES_klibc-utils-static-ipconfig = "${base_bindir}/ipconfig"
+FILES_klibc-utils-static-nfsmount = "${base_bindir}/nfsmount"
+FILES_klibc-utils-static-resume = "${base_bindir}/resume"
+FILES_klibc-utils-static-run-init = "${base_bindir}/run-init"
+FILES_klibc-utils-static-cat = "${base_bindir}/cat"
+FILES_klibc-utils-static-chroot = "${base_bindir}/chroot"
+FILES_klibc-utils-static-cpio = "${base_bindir}/cpio"
+FILES_klibc-utils-static-dd = "${base_bindir}/dd"
+FILES_klibc-utils-static-false = "${base_bindir}/false"
+FILES_klibc-utils-static-halt = "${base_bindir}/halt"
+FILES_klibc-utils-static-insmod = "${base_bindir}/insmod"
+FILES_klibc-utils-static-kill = "${base_bindir}/kill"
+FILES_klibc-utils-static-ln = "${base_bindir}/ln"
+FILES_klibc-utils-static-minips = "${base_bindir}/minips"
+FILES_klibc-utils-static-mkdir = "${base_bindir}/mkdir"
+FILES_klibc-utils-static-mkfifo = "${base_bindir}/mkfifo"
+FILES_klibc-utils-static-mknod = "${base_bindir}/mknod"
+FILES_klibc-utils-static-mount = "${base_bindir}/mount"
+FILES_klibc-utils-static-nuke = "${base_bindir}/nuke"
+FILES_klibc-utils-static-pivot-root = "${base_bindir}/pivot_root"
+FILES_klibc-utils-static-poweroff = "${base_bindir}/poweroff"
+FILES_klibc-utils-static-readlink = "${base_bindir}/readlink"
+FILES_klibc-utils-static-reboot = "${base_bindir}/reboot"
+FILES_klibc-utils-static-sleep = "${base_bindir}/sleep"
+FILES_klibc-utils-static-true = "${base_bindir}/true"
+FILES_klibc-utils-static-umount = "${base_bindir}/umount"
+FILES_klibc-utils-static-uname = "${base_bindir}/uname"
diff --git a/packages/klibc/klibc.inc b/packages/klibc/klibc.inc
index a7f0094264..78e1bca125 100644
--- a/packages/klibc/klibc.inc
+++ b/packages/klibc/klibc.inc
@@ -1,78 +1,139 @@
-DEPENDS = "virtual/kernel perl-native"
-SECTION = "libs"
-DESCRIPTION = "klibc is intended to be a minimalistic libc subset for \
-use with initramfs. It is deliberately written for small size, \
-minimal entaglement, and portability, not speed."
-LICENSE = "BSD-ADV"
-SRC_URI = "${KERNELORG_MIRROR}/pub/linux/libs/klibc/Stable/klibc-${PV}.tar.bz2"
-SRC_URI += "file://install.patch;patch=1"
-S = "${WORKDIR}/klibc-${PV}"
-PACKAGE_ARCH = "${MACHINE_ARCH}"
+require klibc-common.inc
-# for the correct kernel staging path
-# inherit module-base
+SRC_URI += "file://staging.patch;patch=1 \
+ file://klibc_kexecsyscall.patch;patch=1 \
+ "
-EXTRA_OEMAKE = "'ARCH=${KLIBC_ARCH}' \
- 'CROSS=${TARGET_PREFIX}' \
- 'CC=${HOST_PREFIX}gcc' \
- 'LD=${HOST_PREFIX}ld' \
- 'AR=${AR}' \
- 'RANLIB=${RANLIB}' \
- 'NM=${TARGET_PREFIX}nm' \
- 'STRIP=echo' \
- 'SHLIBDIR=/lib' \
- 'HOST_CC=${BUILD_CC}' \
- 'HOST_CFLAGS=${BUILD_CFLAGS}' \
- 'HOST_LDFLAGS=${BUILD_LDFLAGS}' \
- 'HOST_LIBS=' \
- 'LDFLAGS=' \
- 'ARCHREQFLAGS=${HOST_CC_ARCH}' \
- 'OPTFLAGS=${TARGET_CFLAGS}' \
- 'mandir=${mandir}'"
-
-KLIBC_ARCH = '${TARGET_ARCH}'
-KLIBC_ARCH_armeb = 'arm'
-KLIBC_ARCH_mipsel = 'mips'
-
-# the klibc code contains ARM instructions (for ARM), this
-# could be fixed, but for the moment:
-ARM_INSTRUCTION_SET = "arm"
-
-TARGET_CFLAGS := "${@oe_filter_out('-I\S+', '${TARGET_CFLAGS}', d)} -I${STAGING_KERNEL_DIR}/include"
-
-INSTALLDIR = "/usr/lib/klibc"
-INSTALLPREFIX = "${INSTALLDIR}/${TARGET_PREFIX}"
-INSTALLBINDIR = "${INSTALLPREFIX}bin"
-INSTALLLIBDIR = "${INSTALLPREFIX}lib"
-INSTALLINCDIR = "${INSTALLPREFIX}include"
-
-PACKAGES = "${PN} ${PN}-dev ${PN}-doc"
-
-FILES_${PN} = "/lib/*.so* ${INSTALLBINDIR}"
-FILES_${PN}-dev = "/usr/bin ${INSTALLINCDIR} ${INSTALLLIBDIR}"
-
-do_configure () {
- ln -sf ${STAGING_KERNEL_DIR} linux
+# we want only the shared programms and the lib so we chose them manually
+do_install() {
+ install -d ${D}${base_bindir}
+ install -m 755 usr/dash/sh.shared ${D}${base_bindir}/sh
+ install -m 755 usr/gzip/gzip ${D}${base_bindir}
+ install -m 755 usr/kinit/kinit.shared ${D}${base_bindir}/kinit
+ install -m 755 usr/kinit/fstype/shared/fstype ${D}${base_bindir}
+ install -m 755 usr/kinit/ipconfig/shared/ipconfig ${D}${base_bindir}
+ install -m 755 usr/kinit/nfsmount/shared/nfsmount ${D}${base_bindir}
+ install -m 755 usr/kinit/resume/shared/resume ${D}${base_bindir}
+ install -m 755 usr/kinit/run-init/shared/run-init ${D}${base_bindir}
+ install -m 755 usr/utils/shared/cat ${D}${base_bindir}
+ install -m 755 usr/utils/shared/chroot ${D}${base_bindir}
+ install -m 755 usr/utils/shared/cpio ${D}${base_bindir}
+ install -m 755 usr/utils/shared/dd ${D}${base_bindir}
+ install -m 755 usr/utils/shared/false ${D}${base_bindir}
+ install -m 755 usr/utils/shared/halt ${D}${base_bindir}
+ install -m 755 usr/utils/shared/insmod ${D}${base_bindir}
+ install -m 755 usr/utils/shared/kill ${D}${base_bindir}
+ install -m 755 usr/utils/shared/ln ${D}${base_bindir}
+ install -m 755 usr/utils/shared/minips ${D}${base_bindir}
+ install -m 755 usr/utils/shared/mkdir ${D}${base_bindir}
+ install -m 755 usr/utils/shared/mkfifo ${D}${base_bindir}
+ install -m 755 usr/utils/shared/mknod ${D}${base_bindir}
+ install -m 755 usr/utils/shared/mount ${D}${base_bindir}
+ install -m 755 usr/utils/shared/nuke ${D}${base_bindir}
+ install -m 755 usr/utils/shared/pivot_root ${D}${base_bindir}
+ install -m 755 usr/utils/shared/poweroff ${D}${base_bindir}
+ install -m 755 usr/utils/shared/readlink ${D}${base_bindir}
+ install -m 755 usr/utils/shared/reboot ${D}${base_bindir}
+ install -m 755 usr/utils/shared/sleep ${D}${base_bindir}
+ install -m 755 usr/utils/shared/true ${D}${base_bindir}
+ install -m 755 usr/utils/shared/umount ${D}${base_bindir}
+ install -m 755 usr/utils/shared/uname ${D}${base_bindir}
+
+ install -d ${D}${base_libdir}
+ install -m 755 usr/klibc/klibc-*.so ${D}${base_libdir}
+ cd ${D}${base_libdir}
+ ln -s klibc-*.so klibc.so
+ cd -
+ cd ${D}${base_bindir}
+ ln -s gzip gunzip
+ ln -s gzip zcat
+ cd -
}
-STAGING_KLIBC_DIR = "${STAGING_DIR_HOST}/klibc"
-
+export INST=${STAGING_DIR_TARGET}
do_stage() {
- rm -rf "${STAGING_KLIBC_DIR}"
- oe_runmake 'prefix=${STAGING_KLIBC_DIR}' \
- 'bindir=${STAGING_BINDIR}' \
- 'mandir=${STAGING_DIR_HOST}${layout_mandir}' \
- install
- # The following is sufficient, at least in klibc 1.1.1 to make klcc
- # use the staged libraries and include files.
- sed -i -e 's@^\$prefix = .*$@\$prefix = "${STAGING_KLIBC_DIR}/lib/klibc";@' \
- '${STAGING_BINDIR}/${TARGET_PREFIX}klcc'
- # Perhaps other binaries need to be moved to cross?
- mv '${STAGING_BINDIR}/${TARGET_PREFIX}klcc' '${STAGING_BINDIR_CROSS}'
+ oe_runmake install
+ cp '${STAGING_DIR_TARGET}/bin/klcc' '${CROSS_DIR}/bin/${TARGET_PREFIX}klcc'
}
-do_install() {
- # The installed -dev won't work because it has the cross compiler
- # path compiled in.
- oe_runmake 'INSTALLROOT=${D}' install
-}
+PACKAGES = "${PN} klibc-utils-sh klibc-utils-kinit \
+ klibc-utils-fstype klibc-utils-ipconfig \
+ klibc-utils-nfsmount klibc-utils-resume \
+ klibc-utils-run-init klibc-utils-cat \
+ klibc-utils-chroot klibc-utils-cpio \
+ klibc-utils-dd klibc-utils-false \
+ klibc-utils-halt klibc-utils-insmod \
+ klibc-utils-kill klibc-utils-ln \
+ klibc-utils-minips klibc-utils-mkdir \
+ klibc-utils-mkfifo klibc-utils-mknod \
+ klibc-utils-mount klibc-utils-nuke \
+ klibc-utils-pivot-root klibc-utils-poweroff \
+ klibc-utils-readlink klibc-utils-reboot \
+ klibc-utils-sleep klibc-utils-true \
+ klibc-utils-umount klibc-utils-uname \
+ klibc-utils-gzip"
+
+FILES_${PN} = "${base_libdir}/klibc*.so"
+FILES_klibc-utils-sh = "${base_bindir}/sh"
+FILES_klibc-utils-static-gzip = "${base_bindir}/gzip ${base_bindir}/gunzip ${base_bindir}/zcat"
+FILES_klibc-utils-kinit = "${base_bindir}/kinit"
+FILES_klibc-utils-fstype = "${base_bindir}/fstype"
+FILES_klibc-utils-ipconfig = "${base_bindir}/ipconfig"
+FILES_klibc-utils-nfsmount = "${base_bindir}/nfsmount"
+FILES_klibc-utils-resume = "${base_bindir}/resume"
+FILES_klibc-utils-run-init = "${base_bindir}/run-init"
+FILES_klibc-utils-cat = "${base_bindir}/cat"
+FILES_klibc-utils-chroot = "${base_bindir}/chroot"
+FILES_klibc-utils-cpio = "${base_bindir}/cpio"
+FILES_klibc-utils-dd = "${base_bindir}/dd"
+FILES_klibc-utils-false = "${base_bindir}/false"
+FILES_klibc-utils-halt = "${base_bindir}/halt"
+FILES_klibc-utils-insmod = "${base_bindir}/insmod"
+FILES_klibc-utils-kill = "${base_bindir}/kill"
+FILES_klibc-utils-ln = "${base_bindir}/ln"
+FILES_klibc-utils-minips = "${base_bindir}/minips"
+FILES_klibc-utils-mkdir = "${base_bindir}/mkdir"
+FILES_klibc-utils-mkfifo = "${base_bindir}/mkfifo"
+FILES_klibc-utils-mknod = "${base_bindir}/mknod"
+FILES_klibc-utils-mount = "${base_bindir}/mount"
+FILES_klibc-utils-nuke = "${base_bindir}/nuke"
+FILES_klibc-utils-pivot-root = "${base_bindir}/pivot_root"
+FILES_klibc-utils-poweroff = "${base_bindir}/poweroff"
+FILES_klibc-utils-readlink = "${base_bindir}/readlink"
+FILES_klibc-utils-reboot = "${base_bindir}/reboot"
+FILES_klibc-utils-sleep = "${base_bindir}/sleep"
+FILES_klibc-utils-true = "${base_bindir}/true"
+FILES_klibc-utils-umount = "${base_bindir}/umount"
+FILES_klibc-utils-uname = "${base_bindir}/uname"
+
+# Yes we want exactly the klibc that was compiled with the utils
+RDEPENDS_klibc-utils-sh = "${PN} (=${PV}-${PR})"
+RDEPENDS_klibc-utils-kinit = "${PN} (=${PV}-${PR})"
+RDEPENDS_klibc-utils-fstype = "${PN} (=${PV}-${PR})"
+RDEPENDS_klibc-utils-ipconfig = "${PN} (=${PV}-${PR})"
+RDEPENDS_klibc-utils-nfsmount = "${PN} (=${PV}-${PR})"
+RDEPENDS_klibc-utils-resume = "${PN} (=${PV}-${PR})"
+RDEPENDS_klibc-utils-run-init = "${PN} (=${PV}-${PR})"
+RDEPENDS_klibc-utils-cat = "${PN} (=${PV}-${PR})"
+RDEPENDS_klibc-utils-chroot = "${PN} (=${PV}-${PR})"
+RDEPENDS_klibc-utils-cpio = "${PN} (=${PV}-${PR})"
+RDEPENDS_klibc-utils-dd = "${PN} (=${PV}-${PR})"
+RDEPENDS_klibc-utils-false = "${PN} (=${PV}-${PR})"
+RDEPENDS_klibc-utils-halt = "${PN} (=${PV}-${PR})"
+RDEPENDS_klibc-utils-insmod = "${PN} (=${PV}-${PR})"
+RDEPENDS_klibc-utils-kill = "${PN} (=${PV}-${PR})"
+RDEPENDS_klibc-utils-ln = "${PN} (=${PV}-${PR})"
+RDEPENDS_klibc-utils-minips = "${PN} (=${PV}-${PR})"
+RDEPENDS_klibc-utils-mkdir = "${PN} (=${PV}-${PR})"
+RDEPENDS_klibc-utils-mkfifo = "${PN} (=${PV}-${PR})"
+RDEPENDS_klibc-utils-mknod = "${PN} (=${PV}-${PR})"
+RDEPENDS_klibc-utils-mount = "${PN} (=${PV}-${PR})"
+RDEPENDS_klibc-utils-nuke = "${PN} (=${PV}-${PR})"
+RDEPENDS_klibc-utils-pivot-root = "${PN} (=${PV}-${PR})"
+RDEPENDS_klibc-utils-poweroff = "${PN} (=${PV}-${PR})"
+RDEPENDS_klibc-utils-readlink = "${PN} (=${PV}-${PR})"
+RDEPENDS_klibc-utils-reboot = "${PN} (=${PV}-${PR})"
+RDEPENDS_klibc-utils-sleep = "${PN} (=${PV}-${PR})"
+RDEPENDS_klibc-utils-true = "${PN} (=${PV}-${PR})"
+RDEPENDS_klibc-utils-umount = "${PN} (=${PV}-${PR})"
+RDEPENDS_klibc-utils-uname = "${PN} (=${PV}-${PR})"
diff --git a/packages/klibc/klibc_1.1.1.bb b/packages/klibc/klibc_1.1.1.bb
deleted file mode 100644
index ff715765d5..0000000000
--- a/packages/klibc/klibc_1.1.1.bb
+++ /dev/null
@@ -1,3 +0,0 @@
-require klibc.inc
-
-PR = "r1"
diff --git a/packages/klibc/klibc_0.190.bb b/packages/klibc/klibc_1.5.bb
index cd1ba9d56e..71eed9f8da 100644
--- a/packages/klibc/klibc_0.190.bb
+++ b/packages/klibc/klibc_1.5.bb
@@ -1 +1,2 @@
require klibc.inc
+PR = "r4"