Skip to contentSkip to conversation

klibc_1.5.26: now build against linux-libc-headers

PATCH New Andrea Adami 1 participant 2 messages May 13, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 klibc_1.5.26: now build against linux-libc-headers

* add install-patch creating symlinks as done by debian
* extra add the mtd headers
* refresh patches (split out prefix.patch)
* recipe is now not machine-specific anymore
* bump INC_PR

---
 .../recipes-devtools/klibc/klcc-cross_1.5.26.bb    |    2 +-
 .../klibc/klibc-1.5.26/klibc-linux-libc-dev.patch  |   23 ++++++++++++++++++++
 .../klibc/klibc-1.5.26/prefix.patch                |   14 ++++++++++++
 .../klibc/klibc-1.5.26/staging.patch               |   23 ++++++-------------
 meta-initramfs/recipes-devtools/klibc/klibc.inc    |   13 ++++++-----
 .../recipes-devtools/klibc/klibc_1.5.26.bb         |   16 +-------------
 6 files changed, 53 insertions(+), 38 deletions(-)
 create mode 100644 meta-initramfs/recipes-devtools/klibc/klibc-1.5.26/klibc-linux-libc-dev.patch
 create mode 100644 meta-initramfs/recipes-devtools/klibc/klibc-1.5.26/prefix.patch
meta-initramfs/recipes-devtools/klibc/klcc-cross_1.5.26.bb +1 -1
index ad7c07e..5a6739d 100644
@@ -14,7 +14,7 @@ FILESPATH =. "${FILE_DIRNAME}/klibc-${PV}:"
 # ${TARGET_PREFIX}klcc is just a
 # perl wrapper around gcc-cross
 # so give it the same arch and path
-PACKAGE_ARCH = "${TUNE_PKGARCH}"
+#PACKAGE_ARCH = "${TUNE_PKGARCH}"
 
 inherit cross
 
meta-initramfs/recipes-devtools/klibc/klibc-1.5.26/klibc-linux-libc-dev.patch new file +23 -0
new file mode 100644
index 0000000..3c55e14
@@ -0,0 +1,23 @@
+commit 43adf69062254fb4f8d4d11fb5fe36a60ae25d5a
+Author: Ben Hutchings <[email protected]>
+Date:   Sun Mar 14 18:41:56 2010 +0000
+
+    Taken from debian "Fix klibc Debian specific build trouble"
+
+Index: klibc-2.0~rc2/scripts/Kbuild.install
+===================================================================
+--- klibc-2.0~rc2.orig/scripts/Kbuild.install	2012-02-11 18:50:21.000000000 +0000
++++ klibc-2.0~rc2/scripts/Kbuild.install	2012-02-11 19:04:52.000000000 +0000
+@@ -95,8 +95,11 @@
+ 	$(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)for x in $(KLIBCKERNELSRC)/include/asm $(KLIBCKERNELSRC)/include/asm* $(KLIBCKERNELSRC)/include/linux $(KLIBCKERNELSRC)/include/mtd; do \
++		ln -sf $${x} $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/ || exit; \
++	done
+ 	$(Q)cp -rf usr/include/. $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/.
++	$(Q)chmod -R a+rX $(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)
+ 
meta-initramfs/recipes-devtools/klibc/klibc-1.5.26/prefix.patch new file +14 -0
new file mode 100644
index 0000000..6f5ff0d
@@ -0,0 +1,14 @@
+Index: klibc-1.5.24/Makefile
+===================================================================
+--- a/Makefile	2011-07-27 15:50:53.000000000 +0200
++++ b/Makefile	2011-08-01 00:47:56.000000000 +0200
+@@ -39,7 +39,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
+
meta-initramfs/recipes-devtools/klibc/klibc-1.5.26/staging.patch +7 -16
index cedd5e6..03955f2 100644
@@ -6,25 +6,11 @@ Signed-off-by: Thomas Kunze <[email protected]>
 Minor edits following upstream changes
 Signed-off-by: Andrea Adami <[email protected]>
 
-Index: klibc-1.5.24/Makefile
-===================================================================
---- a/Makefile	2011-07-27 15:50:53.000000000 +0200
-+++ b/Makefile	2011-08-01 00:47:56.000000000 +0200
-@@ -39,7 +39,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.24/scripts/Kbuild.install
 ===================================================================
 --- a/scripts/Kbuild.install	2011-07-27 15:50:53.000000000 +0200
 +++ b/scripts/Kbuild.install	2011-08-01 00:03:03.000000000 +0200
-@@ -88,16 +88,12 @@
+@@ -88,13 +88,10 @@
  header:
  	$(Q)echo "  INSTALL headers + man pages to $(INSTALLROOT)$(INSTALLDIR)"
  	$(Q)mkdir -p $(INSTALLROOT)$(bindir)
@@ -35,8 +21,13 @@ Index: klibc-1.5.24/scripts/Kbuild.install
  	$(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)for x in $(KLIBCKERNELSRC)/include/asm $(KLIBCKERNELSRC)/include/asm* $(KLIBCKERNELSRC)/include/linux $(KLIBCKERNELSRC)/include/mtd; do \
+ 		ln -sf $${x} $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/ || exit; \
+ 	done
+@@ -103,7 +100,6 @@
+ 	done
  	$(Q)cp -rf usr/include/. $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/.
+ 	$(Q)chmod -R a+rX $(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)
  
meta-initramfs/recipes-devtools/klibc/klibc.inc +7 -6
index 195f089..f89af9d 100644
@@ -1,4 +1,4 @@
-DEPENDS = "virtual/kernel perl-native"
+DEPENDS = "linux-libc-headers 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, \
@@ -6,13 +6,11 @@ minimal entaglement, and portability, not speed."
 LICENSE = "BSD-3-Clause & GPL-2.0 & MIT & Zlib"
 LIC_FILES_CHKSUM = "file://usr/klibc/LICENSE;md5=d75181f10e998c21eb147f6d2e43ce8b"
 
-PACKAGE_ARCH = "${MACHINE_ARCH}"
-
 # Prevents do_package failures with:
 # debugsources.list: No such file or directory:
 INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
 
-INC_PR = "r0"
+INC_PR = "r1"
 
 KLIBC_ARCH = '${TARGET_ARCH}'
 KLIBC_ARCH_armeb = 'arm'
@@ -30,9 +28,11 @@ SRC_URI_append_linux-gnueabi = " file://klibc-config-eabi.patch"
 SRC_URI_append_linux-uclibceabi = " file://klibc-config-eabi.patch"
 
 SRC_URI += "file://fstype-sane-vfat-and-jffs2-for-1.5.patch \
+            file://klibc-linux-libc-dev.patch \
             file://modprobe.patch \
             file://dash_readopt.patch \
             file://wc.patch \
+            file://prefix.patch \
             file://staging.patch \
             file://kernel_3.2__aligned_u64.patch  \
             "
@@ -41,9 +41,10 @@ S = "${WORKDIR}/git"
 
 EXTRA_OEMAKE = "'KLIBCARCH=${KLIBC_ARCH}' \
                 'CROSS_COMPILE=${TARGET_PREFIX}' \
-                'KLIBCKERNELSRC=${STAGING_KERNEL_DIR}' \
+                'KLIBCKERNELSRC=${STAGING_DIR_TARGET}/${exec_prefix}' \
                 "
 
 do_configure () {
-        ln -sf ${STAGING_KERNEL_DIR} linux
+
+        ln -sf "${STAGING_DIR_TARGET}/${exec_prefix}" linux
 }
meta-initramfs/recipes-devtools/klibc/klibc_1.5.26.bb +1 -15
index c583fdc..101ba55 100644
@@ -2,23 +2,9 @@ PR = "${INC_PR}.0"
 
 export INST = "${D}"
 
-do_compile_prepend() {
-
-    # after kernel 3.1 the headers are moved in /generated
-    if [ ! -e ${STAGING_KERNEL_DIR}/arch/${TARGET_ARCH}/include/asm/bitsperlong.h ]
-    then
-        ln -sf ${STAGING_KERNEL_DIR}/arch/${TARGET_ARCH}/include/generated/asm/bitsperlong.h ${STAGING_KERNEL_DIR}/arch/${TARGET_ARCH}/include/asm/bitsperlong.h
-        ln -sf ${STAGING_KERNEL_DIR}/arch/${TARGET_ARCH}/include/generated/asm/errno.h ${STAGING_KERNEL_DIR}/arch/${TARGET_ARCH}/include/asm/errno.h
-        ln -sf ${STAGING_KERNEL_DIR}/arch/${TARGET_ARCH}/include/generated/asm/ioctl.h ${STAGING_KERNEL_DIR}/arch/${TARGET_ARCH}/include/asm/ioctl.h
-        ln -sf ${STAGING_KERNEL_DIR}/arch/${TARGET_ARCH}/include/generated/asm/poll.h ${STAGING_KERNEL_DIR}/arch/${TARGET_ARCH}/include/asm/poll.h
-        ln -sf ${STAGING_KERNEL_DIR}/arch/${TARGET_ARCH}/include/generated/asm/resource.h ${STAGING_KERNEL_DIR}/arch/${TARGET_ARCH}/include/asm/resource.h
-    fi
-
-}
-
 do_install() {
 
-        oe_runmake install
+        oe_runmake DESTDIR="${D}" install
 
         # the crosscompiler is packaged by klcc-cross
         # remove klcc
Signature · 1 line
1.7.3.4
#1 lore raw

PATCH 2/2 ubi-utils-klibc: clean patch

* after klibc refactoring
* bump PR

---
 .../mtd/ubi-utils-klibc/libubi.c.patch             |   27 --------------------
 .../recipes-devtools/mtd/ubi-utils-klibc_1.4.9.bb  |    5 +--
 2 files changed, 2 insertions(+), 30 deletions(-)
meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc/libubi.c.patch +0 -27
index 97c4fa3..8278a4f 100644
@@ -1,32 +1,5 @@
 --- a/ubi-utils/libubi.c	2012-05-01 01:57:51.000000000 +0200
 +++ b/ubi-utils/libubi.c	2012-05-01 01:55:14.000000000 +0200
-@@ -36,6 +36,26 @@
- #include "libubi_int.h"
- #include "common.h"
- 
-+/* parts of mtd/ubi-user.h */
-+
-+/* Set an UBI volume property */
-+#define UBI_IOCSETPROP _IOW(UBI_VOL_IOC_MAGIC, 6, struct ubi_set_prop_req)
-+
-+/**
-+ * struct ubi_set_prop_req - a data structure used to set an ubi volume
-+ *                           property.
-+ * @property: property to set (%UBI_PROP_DIRECT_WRITE)
-+ * @padding: reserved for future, not used, has to be zeroed
-+ * @value: value to set
-+ */
-+struct ubi_set_prop_req {
-+	uint8_t  property;
-+	uint8_t  padding[7];
-+	uint64_t value;
-+}  __attribute__ ((packed));
-+
-+/* end parts of mtd/ubi-user.h */
-+
- /**
-  * mkpath - compose full path from 2 given components.
-  * @path: the first component
 @@ -382,8 +402,8 @@
  		return errmsg("\"%s\" is not a character device", node);
  	}
meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc_1.4.9.bb +2 -3
index c46ded5..9a8987c 100644
@@ -6,7 +6,7 @@ LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
                     file://include/common.h;beginline=1;endline=17;md5=ba05b07912a44ea2bf81ce409380049c"
 
-PR = "r1"
+PR = "r2"
 
 inherit klibc
 
@@ -36,7 +36,6 @@ PACKAGES =+ "ubinfo-klibc ubiattach-klibc ubidetach-klibc mtdinfo-klibc ubiupdat
              ubimkvol-klibc ubirename-klibc ubirmvol-klibc ubirsvol-klibc \
              ubinize-klibc ubiformat-klibc ubicrc32-klibc"
 
-FILES_ubicrc32-klibc = "${sbindir}/ubicrc32"
 FILES_ubinfo-klibc = "${sbindir}/ubinfo"
 FILES_ubiattach-klibc = "${sbindir}/ubiattach"
 FILES_ubidetach-klibc = "${sbindir}/ubidetach"
@@ -48,4 +47,4 @@ FILES_ubirmvol-klibc = "${sbindir}/ubirmvol"
 FILES_ubirsvol-klibc = "${sbindir}/ubirsvol"
 FILES_ubinize-klibc = "${sbindir}/ubinize"
 FILES_ubiformat-klibc = "${sbindir}/ubiformat"
-
+FILES_ubicrc32-klibc = "${sbindir}/ubicrc32"
Signature · 1 line
1.7.3.4