From 5e18f02fe4c69c1cc91df42e6d7e652bcfc7c565 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Wed, 23 May 2007 20:32:02 +0000 Subject: [PATCH] Clifford Wolf: Some more linux26-headers related fixes [2007052114204727160] (https://www.rocklinux.net/submaster) git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@8465 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc --- package/base/linux/config-500.in | 2 +- package/base/linux/linux.conf | 8 ++- .../linux/linux26-hdrs/types_blkcnt_t.patch | 20 ++++++ package/base/util-linux/llseek_fixes.patch | 64 +++++++++++++++++++ 4 files changed, 92 insertions(+), 2 deletions(-) create mode 100644 package/base/linux/linux26-hdrs/types_blkcnt_t.patch create mode 100644 package/base/util-linux/llseek_fixes.patch diff --git a/package/base/linux/config-500.in b/package/base/linux/config-500.in index eefdf1134..d45ca96c2 100644 --- a/package/base/linux/config-500.in +++ b/package/base/linux/config-500.in @@ -70,7 +70,7 @@ then ;; esac - choice ROCKCFG_PKG_LINUX_DEFAULT_HEADERS linux-libc \ + choice ROCKCFG_PKG_LINUX_DEFAULT_HEADERS linux26 \ linux26 'Use Linux 2.6 headers as system headers' \ linux-libc 'Use linux-libc-headers package as system headers' diff --git a/package/base/linux/linux.conf b/package/base/linux/linux.conf index 3c7dea3d2..7cd1c31cf 100644 --- a/package/base/linux/linux.conf +++ b/package/base/linux/linux.conf @@ -499,7 +499,13 @@ main_lx_headers() { echo "Installing Linux headers in $root ..." mkdir -p $builddir/hdr_path eval $MAKE headers_install INSTALL_HDR_PATH=$builddir/hdr_path - cp -av $builddir/hdr_path/* $root/usr/include/ + for x in $confdir/linux26-hdrs/*.patch; do + [ -f $x ] || continue + echo "Applying linux userspace headers patch $x.." + ( cd $builddir/hdr_path/include && patch -p1 < $x; ) + done + rm -vf $builddir/hdr_path/include/scsi/{sg,scsi,scsi_ioctl}.h + cp -av $builddir/hdr_path/include/* $root/usr/include/ } autoextract=0 diff --git a/package/base/linux/linux26-hdrs/types_blkcnt_t.patch b/package/base/linux/linux26-hdrs/types_blkcnt_t.patch new file mode 100644 index 000000000..de357e2e2 --- /dev/null +++ b/package/base/linux/linux26-hdrs/types_blkcnt_t.patch @@ -0,0 +1,20 @@ +--- ./linux/types.h 2007-05-20 23:27:49.000000000 +0200 ++++ ./linux/types.h 2007-05-20 23:30:30.000000000 +0200 +@@ -121,6 +121,8 @@ + * any application/library that wants linux/types.h. + */ + ++#if 0 /* CONFLICT WITH GLIBC HEADERS */ ++ + /* + * The type of the inode's block count. + */ +@@ -130,6 +132,8 @@ + typedef unsigned long blkcnt_t; + #endif + ++#endif /* CONFLICT WITH GLIBC HEADERS */ ++ + /* + * The type of an index into the pagecache. Use a #define so asm/types.h + * can override it. diff --git a/package/base/util-linux/llseek_fixes.patch b/package/base/util-linux/llseek_fixes.patch new file mode 100644 index 000000000..41bdff812 --- /dev/null +++ b/package/base/util-linux/llseek_fixes.patch @@ -0,0 +1,64 @@ +--- ./fdisk/llseek.c 2007-05-21 11:45:41.000000000 +0200 ++++ ./fdisk/llseek.c 2007-05-21 11:53:14.000000000 +0200 +@@ -5,6 +5,7 @@ + * under the terms of the GNU Public License. + */ + ++#include + #include + + #include +@@ -26,27 +27,12 @@ + #else + #include /* for __NR__llseek */ + +-static int _llseek (unsigned int, unsigned long, +- unsigned long, long long *, unsigned int); +- +-#ifdef __NR__llseek +- +-static _syscall5(int,_llseek,unsigned int,fd,unsigned long,offset_high, +- unsigned long, offset_low,long long *,result, +- unsigned int, origin) +- +-#else +- +-/* no __NR__llseek on compilation machine - might give it explicitly */ + static int _llseek (unsigned int fd, unsigned long oh, + unsigned long ol, long long *result, + unsigned int origin) { +- errno = ENOSYS; +- return -1; ++ return syscall(__NR__llseek, fd, oh, ol, result, origin); + } + +-#endif +- + static long long my_llseek (unsigned int fd, long long offset, + unsigned int origin) + { +--- ./fdisk/sfdisk.c 2007-05-21 11:48:48.000000000 +0200 ++++ ./fdisk/sfdisk.c 2007-05-21 11:54:32.000000000 +0200 +@@ -47,6 +47,7 @@ + #include + #include + #include ++#include + #include + #include /* _syscall */ + #include "nls.h" +@@ -177,9 +178,11 @@ + #endif + + #ifndef use_lseek +-static __attribute__used +-_syscall5(int, _llseek, unsigned int, fd, ulong, hi, ulong, lo, +- loff_t *, res, unsigned int, wh); ++static int _llseek (unsigned int fd, unsigned long oh, ++ unsigned long ol, long long *result, ++ unsigned int origin) { ++ return syscall(__NR__llseek, fd, oh, ol, result, origin); ++} + #endif + + static int