[oe-commits] org.oe.dev kexec-utils-static: make it compile against klibc

thesing commit openembedded-commits at lists.openembedded.org
Fri Feb 22 20:54:01 UTC 2008


kexec-utils-static: make it compile against klibc

Author: thesing at openembedded.org
Branch: org.openembedded.dev
Revision: f51d223df158f1cff524858100f483e0d4918266
ViewMTN: http://monotone.openembedded.org/revision/info/f51d223df158f1cff524858100f483e0d4918266
Files:
1
packages/kexec/files/kexec-klibc.patch
packages/kexec/kexec-tools-static_1.101.bb
packages/kexec/kexec-tools.inc
packages/kexec/kexec-tools_1.101.bb
Diffs:

#
# mt diff -r376228113515d4d85fe897a8e60dcecb20f8d196 -rf51d223df158f1cff524858100f483e0d4918266
#
# 
# 
# add_file "packages/kexec/files/kexec-klibc.patch"
#  content [0c778df2238eb4e8880f42f1cbad2044a8dadd87]
# 
# patch "packages/kexec/kexec-tools-static_1.101.bb"
#  from [674c9eaf4fafd6d5c38088e0bc02792ec9389d12]
#    to [d0f22ab3acf2088a1f8f5c9d8c236df7ab851083]
# 
# patch "packages/kexec/kexec-tools.inc"
#  from [46447a70d4c5e42a305dc4920a1a924741867aca]
#    to [26f7178b5fe7c56ce1096f1c04aa5e25320a6474]
# 
# patch "packages/kexec/kexec-tools_1.101.bb"
#  from [1d9c587e836f1b4b6071adcc2a9f6b91314468d5]
#    to [99597c038f5dd47567309c34f3eefbecd95e5ad1]
# 
============================================================
--- packages/kexec/files/kexec-klibc.patch	0c778df2238eb4e8880f42f1cbad2044a8dadd87
+++ packages/kexec/files/kexec-klibc.patch	0c778df2238eb4e8880f42f1cbad2044a8dadd87
@@ -0,0 +1,140 @@
+Index: kexec-tools-1.101/kexec/arch/arm/kexec-elf-rel-arm.c
+===================================================================
+--- kexec-tools-1.101.orig/kexec/arch/arm/kexec-elf-rel-arm.c	2008-02-22 20:45:15.907610333 +0100
++++ kexec-tools-1.101/kexec/arch/arm/kexec-elf-rel-arm.c	2008-02-22 20:45:27.508612989 +0100
+@@ -1,5 +1,5 @@
+ #include <stdio.h>
+-#include <elf.h>
++#include "../../../include/elf.h"
+ #include "../../kexec.h"
+ #include "../../kexec-elf.h"
+ 
+Index: kexec-tools-1.101/kexec/arch/arm/kexec-zImage-arm.c
+===================================================================
+--- kexec-tools-1.101.orig/kexec/arch/arm/kexec-zImage-arm.c	2008-02-22 20:45:15.959611260 +0100
++++ kexec-tools-1.101/kexec/arch/arm/kexec-zImage-arm.c	2008-02-22 20:45:27.508612989 +0100
+@@ -110,13 +110,13 @@
+ 	}
+ 
+ 	fread(buf, sizeof(buf[1]), BOOT_PARAMS_SIZE, fp);
+-	if (ferror(fp)) {
++/*	if (ferror(fp)) {
+ 		fprintf(stderr, "Cannot read %s: %s\n",
+ 			fn, strerror(errno));
+ 		fclose(fp);
+ 		return NULL;
+ 	}
+-
++*/
+ 	fclose(fp);
+ 	return (struct tag *) buf;
+ }
+Index: kexec-tools-1.101/kexec/ifdown.c
+===================================================================
+--- kexec-tools-1.101.orig/kexec/ifdown.c	2004-06-09 20:55:31.000000000 +0200
++++ kexec-tools-1.101/kexec/ifdown.c	2008-02-22 20:45:27.508612989 +0100
+@@ -14,7 +14,7 @@
+ #include <sys/ioctl.h>
+ #include <sys/socket.h>
+ #include <sys/time.h>
+-#include <sys/errno.h>
++#include <errno.h>
+ 
+ #include <net/if.h>
+ #include <netinet/in.h>
+Index: kexec-tools-1.101/purgatory/Makefile
+===================================================================
+--- kexec-tools-1.101.orig/purgatory/Makefile	2005-01-08 23:36:32.000000000 +0100
++++ kexec-tools-1.101/purgatory/Makefile	2008-02-22 20:45:27.516611391 +0100
+@@ -13,7 +13,7 @@
+ 
+ PCFLAGS += $(call cc-option, -ffreestanding)
+ PCFLAGS += $(call cc-option, -fnobuiltin)
+-PCFLAGS += $(call cc-option, -fnostdinc)
++PCFLAGS += $(call cc-option, -nostdinc)
+ PCFLAGS += $(call cc-option, -fno-zero-initialized-in-bss)
+ 
+ PURGATORY_C_SRCS:= 
+Index: kexec-tools-1.101/kexec/kexec-elf-rel.c
+===================================================================
+--- kexec-tools-1.101.orig/kexec/kexec-elf-rel.c	2005-01-13 14:04:21.000000000 +0100
++++ kexec-tools-1.101/kexec/kexec-elf-rel.c	2008-02-22 20:45:27.524612027 +0100
+@@ -4,7 +4,7 @@
+ #include <stdio.h>
+ #include <errno.h>
+ #include <stdlib.h>
+-#include "elf.h"
++#include "../include/elf.h"
+ #include <boot/elf_boot.h>
+ #include "kexec.h"
+ #include "kexec-elf.h"
+Index: kexec-tools-1.101/kexec/kexec-syscall.h
+===================================================================
+--- kexec-tools-1.101.orig/kexec/kexec-syscall.h	2008-02-22 20:45:15.923611048 +0100
++++ kexec-tools-1.101/kexec/kexec-syscall.h	2008-02-22 20:45:27.524612027 +0100
+@@ -2,7 +2,7 @@
+ #define KEXEC_SYSCALL_H
+ 
+ #define __LIBRARY__
+-#include <syscall.h>
++/*#include <syscall.h>*/
+ #include <sys/syscall.h>
+ #include <unistd.h>
+ 
+@@ -21,7 +21,7 @@
+ #define LINUX_REBOOT_CMD_KEXEC_OLD	0x81726354
+ #define LINUX_REBOOT_CMD_KEXEC_OLD2	0x18263645
+ #define LINUX_REBOOT_CMD_KEXEC		0x45584543
+-
++/*
+ #ifdef __i386__
+ #define __NR_kexec_load		283
+ #endif
+@@ -43,18 +43,19 @@
+ #ifndef __NR_kexec_load
+ #error Unknown processor architecture.  Needs a kexec_load syscall number.
+ #endif
+-
++*/
+ struct kexec_segment;
+-
++/*
+ static inline long kexec_load(void *entry, unsigned long nr_segments,
+ 			struct kexec_segment *segments, unsigned long flags)
+ {
+ 	return (long) syscall(__NR_kexec_load, entry, nr_segments, segments, flags);
+ }
+-
++*/
+ static inline long kexec_reboot(void)
+ {
+-	return (long) syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_KEXEC, 0);
++	//return (long) syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_KEXEC, 0);
++	return __reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, LINUX_REBOOT_CMD_KEXEC, 0);
+ }
+ 
+ 
+Index: kexec-tools-1.101/kexec/kexec.c
+===================================================================
+--- kexec-tools-1.101.orig/kexec/kexec.c	2008-02-22 20:45:15.923611048 +0100
++++ kexec-tools-1.101/kexec/kexec.c	2008-02-22 20:45:38.847612035 +0100
+@@ -29,9 +29,7 @@
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <getopt.h>
+-#ifdef HAVE_ZLIB_H
+-#include <zlib.h>
+-#endif
++#include "zlib.h"
+ #include <sha256.h>
+ #include "kexec.h"
+ #include "kexec-syscall.h"
+@@ -383,7 +381,7 @@
+ 	return buf;
+ }
+ 
+-#if HAVE_ZLIB_H
++#if 1 
+ char *slurp_decompress_file(const char *filename, off_t *r_size)
+ {
+ 	gzFile fp;
============================================================
--- packages/kexec/kexec-tools-static_1.101.bb	674c9eaf4fafd6d5c38088e0bc02792ec9389d12
+++ packages/kexec/kexec-tools-static_1.101.bb	d0f22ab3acf2088a1f8f5c9d8c236df7ab851083
@@ -1,12 +1,23 @@
+# the binaries are statical linked against klibc
 require kexec-tools.inc
 
-PR = "r0"
+PR = "r1"
+DEPENDS = "klibc"
 
-SRC_URI += "file://kexec-static.patch;patch=1"
+SRC_URI += "file://kexec-klibc.patch;patch=1"
 S = "${WORKDIR}/kexec-tools-${PV}"
 
-PACKAGES =+ "kexec-static kdump-static"
+EXTRA_OECONF = " --without-zlib"
 
-FILES_kexec-static = "${sbindir}/kexec"
-FILES_kdump-static = "${sbindir}/kdump"
+export CC=${TARGET_PREFIX}klcc
 
+# standart oe cflags don't work with klcc
+export CFLAGS=""
+export CPPFLAGS=""
+export LDFLAGS=""
+
+PACKAGES =+ "kexec-klibc kdump-klibc"
+
+FILES_kexec-klibc = "${sbindir}/kexec"
+FILES_kdump-klibc = "${sbindir}/kdump"
+
============================================================
--- packages/kexec/kexec-tools.inc	46447a70d4c5e42a305dc4920a1a924741867aca
+++ packages/kexec/kexec-tools.inc	26f7178b5fe7c56ce1096f1c04aa5e25320a6474
@@ -7,8 +7,6 @@ inherit autotools
 
 inherit autotools
 
-export LDFLAGS = "-L${STAGING_LIBDIR}"
-EXTRA_OECONF = " --with-zlib=yes"
 
 SRC_URI = "http://www.xmission.com/~ebiederm/files/kexec/kexec-tools-${PV}.tar.gz \
            file://kexec-tools-arm.patch;patch=1 \
============================================================
--- packages/kexec/kexec-tools_1.101.bb	1d9c587e836f1b4b6071adcc2a9f6b91314468d5
+++ packages/kexec/kexec-tools_1.101.bb	99597c038f5dd47567309c34f3eefbecd95e5ad1
@@ -1,3 +1,5 @@ require kexec-tools.inc
 require kexec-tools.inc
+export LDFLAGS = "-L${STAGING_LIBDIR}"
+EXTRA_OECONF = " --with-zlib=yes"
 
+PR = "r5"
-PR = "r4"






More information about the Openembedded-commits mailing list