From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 83F39138247 for ; Sat, 18 Jan 2014 14:32:11 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8719FE0C78; Sat, 18 Jan 2014 14:32:05 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4FE0AE0C7A for ; Sat, 18 Jan 2014 14:32:04 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5474033F97E for ; Sat, 18 Jan 2014 14:32:03 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id 754E51872E for ; Sat, 18 Jan 2014 14:32:01 +0000 (UTC) From: "Anthony G. Basile" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Anthony G. Basile" Message-ID: <1390055514.5eb9c84b7f455851e54aef12e475ca6776fc8613.blueness@gentoo> Subject: [gentoo-commits] proj/hardened-dev:musl commit in: sys-apps/kmod/, sys-apps/kmod/files/ X-VCS-Repository: proj/hardened-dev X-VCS-Files: sys-apps/kmod/files/kmod-15-dynamic-kmod.patch sys-apps/kmod/files/kmod-15-use-strndup.patch sys-apps/kmod/files/kmod-static-nodes sys-apps/kmod/kmod-15-r99.ebuild sys-apps/kmod/metadata.xml X-VCS-Directories: sys-apps/kmod/ sys-apps/kmod/files/ X-VCS-Committer: blueness X-VCS-Committer-Name: Anthony G. Basile X-VCS-Revision: 5eb9c84b7f455851e54aef12e475ca6776fc8613 X-VCS-Branch: musl Date: Sat, 18 Jan 2014 14:32:01 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 1209e59a-309d-43fd-9bc8-27047e38f69b X-Archives-Hash: 6c48b60ac8f893614e6f8720b71c6609 commit: 5eb9c84b7f455851e54aef12e475ca6776fc8613 Author: layman localhost> AuthorDate: Thu Jan 16 14:34:50 2014 +0000 Commit: Anthony G. Basile gentoo org> CommitDate: Sat Jan 18 14:31:54 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=5eb9c84b sys-apps/kmod: use strndup, not strndupa --- sys-apps/kmod/files/kmod-15-dynamic-kmod.patch | 16 +++ sys-apps/kmod/files/kmod-15-use-strndup.patch | 12 +++ sys-apps/kmod/files/kmod-static-nodes | 18 ++++ sys-apps/kmod/kmod-15-r99.ebuild | 129 +++++++++++++++++++++++++ sys-apps/kmod/metadata.xml | 12 +++ 5 files changed, 187 insertions(+) diff --git a/sys-apps/kmod/files/kmod-15-dynamic-kmod.patch b/sys-apps/kmod/files/kmod-15-dynamic-kmod.patch new file mode 100644 index 0000000..c93bea6 --- /dev/null +++ b/sys-apps/kmod/files/kmod-15-dynamic-kmod.patch @@ -0,0 +1,16 @@ +do not statically link kmod against its own libraries + +https://bugs.gentoo.org/493630 +http://thread.gmane.org/gmane.linux.kernel.modules/1206 + +--- a/Makefile.in ++++ b/Makefile.in +@@ -817,7 +817,7 @@ + @BUILD_TOOLS_TRUE@ tools/static-nodes.c + + @BUILD_TOOLS_TRUE@tools_kmod_LDADD = libkmod/libkmod-util.la \ +-@BUILD_TOOLS_TRUE@ libkmod/libkmod-internal.la ++@BUILD_TOOLS_TRUE@ libkmod/libkmod.la + + + # ------------------------------------------------------------------------------ diff --git a/sys-apps/kmod/files/kmod-15-use-strndup.patch b/sys-apps/kmod/files/kmod-15-use-strndup.patch new file mode 100644 index 0000000..7d56480 --- /dev/null +++ b/sys-apps/kmod/files/kmod-15-use-strndup.patch @@ -0,0 +1,12 @@ +diff -Naur kmod-15.orig/libkmod/libkmod-util.c kmod-15/libkmod/libkmod-util.c +--- kmod-15.orig/libkmod/libkmod-util.c 2014-01-16 14:11:37.002012850 +0000 ++++ kmod-15/libkmod/libkmod-util.c 2014-01-16 14:10:36.709009479 +0000 +@@ -324,7 +324,7 @@ + { + char *start, *end; + +- start = strndupa(path, len); ++ start = strndup(path, len); + end = start + len; + + /* diff --git a/sys-apps/kmod/files/kmod-static-nodes b/sys-apps/kmod/files/kmod-static-nodes new file mode 100644 index 0000000..43d8431 --- /dev/null +++ b/sys-apps/kmod/files/kmod-static-nodes @@ -0,0 +1,18 @@ +#!/sbin/runscript +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/kmod/files/kmod-static-nodes,v 1.1 2013/08/09 19:08:18 ssuominen Exp $ + +description="Create list of required static device nodes for the current kernel" + +depend() { + after dev-mount + before tmpfiles.dev dev +} + +start() { + ebegin "Creating list of required static device nodes for the current kernel" + checkpath -q -d /run/tmpfiles.d + kmod static-nodes --format=tmpfiles --output=/run/tmpfiles.d/kmod.conf + eend $? +} diff --git a/sys-apps/kmod/kmod-15-r99.ebuild b/sys-apps/kmod/kmod-15-r99.ebuild new file mode 100644 index 0000000..09cc20f --- /dev/null +++ b/sys-apps/kmod/kmod-15-r99.ebuild @@ -0,0 +1,129 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/kmod/kmod-15-r1.ebuild,v 1.1 2013/12/09 01:55:28 vapier Exp $ + +EAPI=5 +inherit autotools eutils libtool multilib toolchain-funcs versionator + +if [[ ${PV} == 9999 ]]; then + EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/kernel/${PN}/${PN}.git" + inherit git-2 +else + SRC_URI="mirror://kernel/linux/utils/kernel/kmod/${P}.tar.xz" + KEYWORDS="alpha amd64 arm hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86" +fi + +DESCRIPTION="library and tools for managing linux kernel modules" +HOMEPAGE="http://git.kernel.org/?p=utils/kernel/kmod/kmod.git" + +LICENSE="LGPL-2" +SLOT="0" +IUSE="debug doc lzma +openrc static-libs +tools zlib" + +# Upstream does not support running the test suite with custom configure flags. +# I was also told that the test suite is intended for kmod developers. +# So we have to restrict it. +# See bug #408915. +RESTRICT="test" + +RDEPEND="!sys-apps/module-init-tools + !sys-apps/modutils + lzma? ( >=app-arch/xz-utils-5.0.4-r1 ) + openrc? ( !=sys-libs/zlib-1.2.6 )" #427130 +DEPEND="${RDEPEND} + dev-libs/libxslt + doc? ( dev-util/gtk-doc ) + lzma? ( virtual/pkgconfig ) + zlib? ( virtual/pkgconfig )" + +pkg_setup() { + [[ $(tc-getCPP) == *cpp ]] && ! version_is_at_least 4.6 $(gcc-version) && \ + die "You need at least GNU GCC 4.6.x to build this package." #481020 +} + +src_prepare() { + if [ ! -e configure ]; then + if use doc; then + gtkdocize --copy --docdir libkmod/docs || die + else + touch libkmod/docs/gtk-doc.make + fi + eautoreconf + else + epatch "${FILESDIR}"/${PN}-15-dynamic-kmod.patch #493630 + epatch "${FILESDIR}"/${PN}-15-use-strndup.patch + elibtoolize + fi + + # Restore possibility of running --enable-static wrt #472608 + sed -i \ + -e '/--enable-static is not supported by kmod/s:as_fn_error:echo:' \ + configure || die +} + +src_configure() { + econf \ + --bindir=/bin \ + --with-rootlibdir=/$(get_libdir) \ + --enable-shared \ + $(use_enable static-libs static) \ + $(use_enable tools) \ + $(use_enable debug) \ + $(use_enable doc gtk-doc) \ + $(use_with lzma xz) \ + $(use_with zlib) +} + +src_install() { + default + prune_libtool_files + + if use tools; then + local bincmd sbincmd + for sbincmd in depmod insmod lsmod modinfo modprobe rmmod; do + dosym /bin/kmod /sbin/${sbincmd} + done + + # These are also usable as normal user + for bincmd in lsmod modinfo; do + dosym kmod /bin/${bincmd} + done + fi + + cat <<-EOF > "${T}"/usb-load-ehci-first.conf + softdep uhci_hcd pre: ehci_hcd + softdep ohci_hcd pre: ehci_hcd + EOF + + insinto /lib/modprobe.d + doins "${T}"/usb-load-ehci-first.conf #260139 + + use openrc && doinitd "${FILESDIR}"/kmod-static-nodes +} + +pkg_postinst() { + if use openrc; then + if [[ -L ${ROOT}etc/runlevels/boot/static-nodes ]]; then + ewarn "Removing old conflicting static-nodes init script from the boot runlevel" + rm -f "${ROOT}"etc/runlevels/boot/static-nodes + fi + + # Add kmod to the runlevel automatically if this is the first install of this package. + if [[ -z ${REPLACING_VERSIONS} ]]; then + if [[ -x ${ROOT}etc/init.d/kmod-static-nodes && -d ${ROOT}etc/runlevels/sysinit ]]; then + ln -s /etc/init.d/kmod-static-nodes "${ROOT}"/etc/runlevels/sysinit/kmod-static-nodes + fi + fi + + if [[ -e ${ROOT}etc/runlevels/sysinit ]]; then + if [[ ! -e ${ROOT}etc/runlevels/sysinit/kmod-static-nodes ]]; then + ewarn + ewarn "You need to add kmod-static-nodes to the sysinit runlevel for" + ewarn "kernel modules to have required static nodes!" + ewarn "Run this command:" + ewarn "\trc-update add kmod-static-nodes sysinit" + fi + fi + fi +} diff --git a/sys-apps/kmod/metadata.xml b/sys-apps/kmod/metadata.xml new file mode 100644 index 0000000..97fc7c5 --- /dev/null +++ b/sys-apps/kmod/metadata.xml @@ -0,0 +1,12 @@ + + + + base-system + + udev-bugs@gentoo.org + + + Install the OpenRC init scripts + Install module loading/unloading tools. + +