Browse Source

musl/kmod: added external patches and musl speciffic conf

stable/0.6
Nagy Karoly Gabriel 11 years ago
parent
commit
87531086d8
  1. 48
      base/musl/pkg/kmod/kmod-test-glibc-assumption.patch
  2. 15
      base/musl/pkg/kmod/kmod.conf
  3. 34
      base/musl/pkg/kmod/musl_strndupa.patch

48
base/musl/pkg/kmod/kmod-test-glibc-assumption.patch

@ -0,0 +1,48 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../musl/pkg/kmod/kmod-test-glibc-assumption.patch
# Copyright (C) 2014 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
This patch comes from sabotagelinux
https://github.com/sabotage-linux/sabotage/blob/master/KEEP/kmod-test-glibc-assumption.patch
check if __GLIBC__ is defined before using _FILE_OFFSET_BITS
_FILE_OFFSET_BITS is a glibc internal macro.
musl provides 64bit off_t by default, but
defines stat64 etc as macros to make glibc-centric
programs happy. however the expansion causes
problems with the hack used here to work around
glibc's 32bit past...
--- kmod-15.org/testsuite/path.c 2013-08-26 16:03:22.239000003 +0000
+++ kmod-15/testsuite/path.c 2013-08-26 16:11:36.939000003 +0000
@@ -185,7 +185,7 @@
WRAP_2ARGS(int, -1, access, int);
WRAP_2ARGS(int, -1, stat, struct stat*);
WRAP_2ARGS(int, -1, lstat, struct stat*);
-#ifndef _FILE_OFFSET_BITS
+#if defined(__GLIBC__) && !defined(_FILE_OFFSET_BITS)
WRAP_2ARGS(int, -1, stat64, struct stat64*);
WRAP_2ARGS(int, -1, lstat64, struct stat64*);
WRAP_OPEN(64);
@@ -196,7 +196,7 @@
#ifdef HAVE___XSTAT
WRAP_VERSTAT(__x,);
WRAP_VERSTAT(__lx,);
-#ifndef _FILE_OFFSET_BITS
+#if defined(__GLIBC__) && !defined(_FILE_OFFSET_BITS)
WRAP_VERSTAT(__x,64);
WRAP_VERSTAT(__lx,64);
#endif

15
base/musl/pkg/kmod/kmod.conf

@ -0,0 +1,15 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../musl/pkg/kmod/kmod.conf
# Copyright (C) 2014 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- SDE-COPYRIGHT-NOTE-END ---
var_append configprefix ' ' 'CFLAGS=-D_GNU_SOURCE'

34
base/musl/pkg/kmod/musl_strndupa.patch

@ -0,0 +1,34 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../musl/pkg/kmod/musl_strndupa.patch
# Copyright (C) 2014 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
http://git.alpinelinux.org/cgit/aports/plain/main/kmod/strndupa.patch
diff --git a/libkmod/libkmod-util.c b/libkmod/libkmod-util.c
index df12433..142e767 100644
--- a/libkmod/libkmod-util.c
+++ b/libkmod/libkmod-util.c
@@ -334,7 +334,9 @@ int mkdir_p(const char *path, int len, mode_t mode)
{
char *start, *end;
- start = strndupa(path, len);
+ start = alloca(len+1);
+ strncpy(start, path, len);
+ start[len] = '\0';
end = start + len;
/*
Loading…
Cancel
Save