summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV3n3RiX <venerix@rogentos.ro>2016-10-23 13:21:14 +0100
committerV3n3RiX <venerix@rogentos.ro>2016-10-23 13:21:14 +0100
commit655ac74f6d1dca3fd56c92fe4d42c35b10b74f31 (patch)
treeb05aaec4971d2d6761005e770cee0e34b6828cdd
parent1ee72da9a68ba8dc94bf31566ee45cb3dcb3b53b (diff)
dkms : don't touch config files, use gentoo-functions, add systemd service
-rw-r--r--sys-kernel/dkms/dkms-2.2.0.3-r1.ebuild (renamed from sys-kernel/dkms/dkms-2.2.0.3.ebuild)6
-rw-r--r--sys-kernel/dkms/files/dkms-2.2.0.3-dont-touch-configs.patch26
-rw-r--r--sys-kernel/dkms/files/dkms-2.2.0.3-gentoo-functions.patch69
-rw-r--r--sys-kernel/dkms/files/dkms-2.2.0.3-kogaion-systemd.patch147
4 files changed, 246 insertions, 2 deletions
diff --git a/sys-kernel/dkms/dkms-2.2.0.3.ebuild b/sys-kernel/dkms/dkms-2.2.0.3-r1.ebuild
index 365ca53e..da1fe50c 100644
--- a/sys-kernel/dkms/dkms-2.2.0.3.ebuild
+++ b/sys-kernel/dkms/dkms-2.2.0.3-r1.ebuild
@@ -13,8 +13,10 @@ RDEPEND="app-arch/rpm"
KEYWORDS="*"
SLOT="0"
-src_compile() {
- return
+src_prepare() {
+ epatch ${FILESDIR}/${P}-dont-touch-configs.patch
+ epatch ${FILESDIR}/${P}-gentoo-functions.patch
+ epatch ${FILESDIR}/${P}-kogaion-systemd.patch
}
src_install() {
diff --git a/sys-kernel/dkms/files/dkms-2.2.0.3-dont-touch-configs.patch b/sys-kernel/dkms/files/dkms-2.2.0.3-dont-touch-configs.patch
new file mode 100644
index 00000000..9d2dcbe6
--- /dev/null
+++ b/sys-kernel/dkms/files/dkms-2.2.0.3-dont-touch-configs.patch
@@ -0,0 +1,26 @@
+diff -Nur a/dkms b/dkms
+--- a/dkms 2011-12-07 18:23:58.000000000 +0000
++++ b/dkms 2016-10-23 12:35:35.863843825 +0100
+@@ -756,22 +756,6 @@
+ sa_sck_o[${#sa_sck_o[@]}]="s/\(INITRD_MODULES.*\)$obsolete_module\b\(.*\)/\1${dest_module_name[$index]}\2/"
+ done
+ done
+-
+- # do all the changes at once, record the diffs for posterity
+- for file in "$@"; do
+- [[ $file && -w $file ]] || continue
+- if [[ $file = /etc/sysconfig/kernel ]]; then
+- sed "${sa_sck_o[@]}" "$file" > "$temp_dir_name/${file##*/}.new"
+- else
+- sed "${sa_mc_o[@]}" "$file" > "$temp_dir_name/${file##*/}.new"
+- fi
+- if ! mod_diff=$(diff -u "$temp_dir_name/${file##*/}.new" "$file"); then
+- echo $"$file updated to replace obsoleted module references:"
+- echo "$mod_diff"
+- cp -fp "$temp_dir_name/${file##*/}.new" "$file"
+- rm -f "$temp_dir_name/${file##*/}.new"
+- fi
+- done
+ }
+
+ moduleconfig_add()
diff --git a/sys-kernel/dkms/files/dkms-2.2.0.3-gentoo-functions.patch b/sys-kernel/dkms/files/dkms-2.2.0.3-gentoo-functions.patch
new file mode 100644
index 00000000..11fd3cce
--- /dev/null
+++ b/sys-kernel/dkms/files/dkms-2.2.0.3-gentoo-functions.patch
@@ -0,0 +1,69 @@
+diff -Nur a/dkms_autoinstaller b/dkms_autoinstaller
+--- a/dkms_autoinstaller 2011-07-22 00:06:55.000000000 +0100
++++ b/dkms_autoinstaller 2016-10-23 12:49:18.363899043 +0100
+@@ -1,52 +1,30 @@
+ #!/bin/sh
+-#
+-# dkms_autoinstaller A service to automatically install DKMS modules
+-# for new kernels.
+-# chkconfig: 345 04 04
+-# description: An autoinstaller bootup service for DKMS
+-#
+-### BEGIN INIT INFO
+-# Provides: dkms_autoinstaller dkms
+-# Default-Start: 2 3 4 5
+-# Default-Stop:
+-# Required-Start: $local_fs
+-# Required-Stop: $null
+ # Short-Description: Automatically install DKMS modules for new kernels
+ # Description: A service to automatically install DKMS modules for new kernels.
+-### END INIT INFO
+
+ test -f /usr/sbin/dkms || exit 0
+
+-if [ -f /lib/lsb/init-functions ]; then
+- . /lib/lsb/init-functions
+-fi
+-#We only have these functions on debian/ubuntu
+-# so on other distros just stub them out
+-if [ ! -f /etc/debian_version ]; then
+- alias log_daemon_msg=/bin/echo
+- log_end_msg() { if [ "$1" = "0" ]; then echo " Done. "; else echo " Failed. "; fi }
+- alias log_action_begin_msg=log_daemon_msg
+- alias log_action_end_msg=log_end_msg
++if [ -f /lib/gentoo/functions.sh ]; then
++ . /lib/gentoo/functions.sh
+ fi
+
+ if [ -n "$2" ]; then
+- kernel="$2"
++ kernel="$2"
+ else
+- kernel=`uname -r`
++ kernel=`uname -r`
+ fi
+
+ # See how we were called.
+ case "$1" in
+- start)
+- log_daemon_msg "dkms: running auto installation service for kernel $kernel"
+- dkms autoinstall --kernelver $kernel
+- log_end_msg $?
+- ;;
+- stop|restart|force-reload|status|reload)
+- # ignore
+- ;;
+- *)
+- echo "Usage: $0 {start}"
++ start)
++ einfo "dkms: running auto installation service for kernel $kernel"
++ dkms autoinstall --kernelver $kernel
++ ;;
++ status)
++ dkms status
++ ;;
++ *)
++ echo "Usage: $0 {start}"
+ esac
+
+ exit 0
diff --git a/sys-kernel/dkms/files/dkms-2.2.0.3-kogaion-systemd.patch b/sys-kernel/dkms/files/dkms-2.2.0.3-kogaion-systemd.patch
new file mode 100644
index 00000000..d9c46c07
--- /dev/null
+++ b/sys-kernel/dkms/files/dkms-2.2.0.3-kogaion-systemd.patch
@@ -0,0 +1,147 @@
+diff -Nur a/dkms.service b/dkms.service
+--- a/dkms.service 1970-01-01 01:00:00.000000000 +0100
++++ b/dkms.service 2016-10-23 13:12:58.789994401 +0100
+@@ -0,0 +1,11 @@
++[Unit]
++Description=DKMS Autoinstall service
++Before=display-manager.service getty.target
++
++[Service]
++Type=oneshot
++RemainAfterExit=true
++ExecStart=/usr/lib/dkms/dkms_autoinstaller start
++
++[Install]
++WantedBy=multi-user.target
+diff -Nur a/Makefile b/Makefile
+--- a/Makefile 2011-12-07 18:23:51.000000000 +0000
++++ b/Makefile 2016-10-23 13:14:39.627001171 +0100
+@@ -13,27 +13,17 @@
+ ETC = $(DESTDIR)/etc/dkms
+ VAR = $(DESTDIR)/var/lib/dkms
+ MAN = $(DESTDIR)/usr/share/man/man8
+-INITD = $(DESTDIR)/etc/init.d
+-INITD_RH = $(DESTDIR)/etc/rc.d/init.d
+ LIBDIR = $(DESTDIR)/usr/lib/dkms
+ BASHDIR = $(DESTDIR)/etc/bash_completion.d
+ KCONF = $(DESTDIR)/etc/kernel
+-SHAREDIR = $(DESTDIR)/usr/share
+-DOCDIR = $(SHAREDIR)/doc/dkms
++SYSTEMD_UNITDIR=$(DESTDIR)/usr/lib/systemd/system
+
+ #Define the top-level build directory
+ BUILDDIR := $(shell pwd)
+ TOPDIR := $(shell pwd)
+
+-.PHONY = tarball
+-
+-all: clean tarball rpm debs
+-
+-clean:
+- -rm -rf *~ dist/ dkms-freshmeat.txt
+-
+ install:
+- mkdir -m 0755 -p $(VAR) $(SBIN) $(MAN) $(ETC) $(BASHDIR) $(SHAREDIR) $(LIBDIR)
++ mkdir -m 0755 -p $(VAR) $(SBIN) $(MAN) $(ETC) $(BASHDIR) $(LIBDIR) $(SYSTEMD_UNITDIR)
+ sed -e "s/\[INSERT_VERSION_HERE\]/$(RELEASE_VERSION)/" dkms > dkms.versioned
+ mv -f dkms.versioned dkms
+ install -p -m 0755 dkms_common.postinst $(LIBDIR)/common.postinst
+@@ -42,6 +32,7 @@
+ install -p -m 0644 dkms_framework.conf $(ETC)/framework.conf
+ install -p -m 0644 dkms_dbversion $(VAR)
+ install -p -m 0644 dkms.bash-completion $(BASHDIR)/dkms
++ install -p -m 0644 dkms.service $(SYSTEMD_UNITDIR)
+ # install compressed manpage with proper timestamp and permissions
+ gzip -c -9 dkms.8 > $(MAN)/dkms.8.gz
+ chmod 0644 $(MAN)/dkms.8.gz
+@@ -50,90 +41,3 @@
+ install -p -m 0755 kernel_prerm.d_dkms $(KCONF)/prerm.d/dkms
+ install -p -m 0755 kernel_postinst.d_dkms $(KCONF)/postinst.d/dkms
+
+-DOCFILES=sample.spec sample.conf AUTHORS COPYING README.dkms sample-suse-9-mkkmp.spec sample-suse-10-mkkmp.spec
+-
+-doc-perms:
+- # ensure doc file permissions ok
+- chmod 0644 $(DOCFILES)
+-
+-install-redhat: install doc-perms
+- mkdir -m 0755 -p $(INITD_RH)
+- install -p -m 0755 dkms_mkkerneldoth $(LIBDIR)/mkkerneldoth
+- install -p -m 0755 dkms_find-provides $(LIBDIR)/find-provides
+- install -p -m 0755 lsb_release $(LIBDIR)/lsb_release
+- install -p -m 0644 template-dkms-mkrpm.spec $(ETC)
+- install -p -m 0644 template-dkms-redhat-kmod.spec $(ETC)
+- install -p -m 0755 dkms_autoinstaller $(INITD_RH)
+-
+-install-doc:
+- mkdir -m 0755 -p $(DOCDIR)
+- install -p -m 0644 $(DOCFILES) $(DOCDIR)
+-
+-install-debian: install install-doc
+- mkdir -p -m 0755 $(SHAREDIR)/apport/package-hooks
+- install -p -m 0755 dkms_apport.py $(SHAREDIR)/apport/package-hooks/dkms_packages.py
+- mkdir -p -m 0755 $(KCONF)/header_postinst.d
+- install -p -m 0755 kernel_postinst.d_dkms $(KCONF)/header_postinst.d/dkms
+- mkdir -p -m 0755 $(ETC)/template-dkms-mkdeb/debian
+- ln -s template-dkms-mkdeb $(ETC)/template-dkms-mkdsc
+- install -p -m 0664 template-dkms-mkdeb/Makefile $(ETC)/template-dkms-mkdeb/
+- install -p -m 0664 template-dkms-mkdeb/debian/* $(ETC)/template-dkms-mkdeb/debian/
+- chmod +x $(ETC)/template-dkms-mkdeb/debian/postinst
+- chmod +x $(ETC)/template-dkms-mkdeb/debian/prerm
+- chmod +x $(ETC)/template-dkms-mkdeb/debian/rules
+- rm $(DOCDIR)/COPYING*
+- rm $(DOCDIR)/sample*
+-
+-deb_destdir=$(BUILDDIR)/dist
+-TARBALL=$(deb_destdir)/$(RELEASE_STRING).tar.gz
+-tarball: $(TARBALL)
+-
+-$(TARBALL):
+- mkdir -p $(deb_destdir)
+- tmp_dir=`mktemp -d --tmpdir dkms.XXXXXXXX` ; \
+- cp -a ../$(RELEASE_NAME) $${tmp_dir}/$(RELEASE_STRING) ; \
+- sed -e "s/\[INSERT_VERSION_HERE\]/$(RELEASE_VERSION)/" dkms > $${tmp_dir}/$(RELEASE_STRING)/dkms ; \
+- sed -e "s/\[INSERT_VERSION_HERE\]/$(RELEASE_VERSION)/" dkms.spec > $${tmp_dir}/$(RELEASE_STRING)/dkms.spec ; \
+- find $${tmp_dir}/$(RELEASE_STRING) -depth -name .git -type d -exec rm -rf \{\} \; ; \
+- find $${tmp_dir}/$(RELEASE_STRING) -depth -name dist -type d -exec rm -rf \{\} \; ; \
+- find $${tmp_dir}/$(RELEASE_STRING) -depth -name \*~ -type f -exec rm -f \{\} \; ; \
+- find $${tmp_dir}/$(RELEASE_STRING) -depth -name dkms\*.rpm -type f -exec rm -f \{\} \; ; \
+- find $${tmp_dir}/$(RELEASE_STRING) -depth -name dkms\*.tar.gz -type f -exec rm -f \{\} \; ; \
+- find $${tmp_dir}/$(RELEASE_STRING) -depth -name dkms-freshmeat.txt -type f -exec rm -f \{\} \; ; \
+- rm -rf $${tmp_dir}/$(RELEASE_STRING)/debian ; \
+- sync ; sync ; sync ; \
+- tar cvzf $(TARBALL) -C $${tmp_dir} $(RELEASE_STRING); \
+- rm -rf $${tmp_dir} ;
+-
+-
+-rpm: $(TARBALL) dkms.spec
+- tmp_dir=`mktemp -d --tmpdir dkms.XXXXXXXX` ; \
+- mkdir -p $${tmp_dir}/{BUILD,RPMS,SRPMS,SPECS,SOURCES} ; \
+- cp $(TARBALL) $${tmp_dir}/SOURCES ; \
+- sed "s/\[INSERT_VERSION_HERE\]/$(RELEASE_VERSION)/" dkms.spec > $${tmp_dir}/SPECS/dkms.spec ; \
+- pushd $${tmp_dir} > /dev/null 2>&1; \
+- rpmbuild -ba --define "_topdir $${tmp_dir}" SPECS/dkms.spec ; \
+- popd > /dev/null 2>&1; \
+- cp $${tmp_dir}/RPMS/noarch/* $${tmp_dir}/SRPMS/* dist ; \
+- rm -rf $${tmp_dir}
+-
+-debmagic: $(TARBALL)
+- mkdir -p dist/
+- ln -s $(TARBALL) $(DEB_TMP_BUILDDIR)/$(RELEASE_NAME)_$(RELEASE_VERSION).orig.tar.gz
+- tar -C $(DEB_TMP_BUILDDIR) -xzf $(TARBALL)
+- cp -ar debian $(DEB_TMP_BUILDDIR)/$(RELEASE_STRING)/debian
+- chmod +x $(DEB_TMP_BUILDDIR)/$(RELEASE_STRING)/debian/rules
+- cd $(DEB_TMP_BUILDDIR)/$(RELEASE_STRING) ; \
+- dch -v $(RELEASE_VERSION)-0 "New upstream version, $(RELEASE_VERSION)"; \
+- dpkg-buildpackage -D -b -rfakeroot ; \
+- dpkg-buildpackage -D -S -sa -rfakeroot ; \
+- mv ../$(RELEASE_NAME)_* $(TOPDIR)/dist/ ; \
+- cd -
+-
+-debs:
+- tmp_dir=`mktemp -d --tmpdir dkms.XXXXXXXX` ; \
+- make debmagic DEB_TMP_BUILDDIR=$${tmp_dir} DIST=$(DIST); \
+- rm -rf $${tmp_dir}
+-
+-fm:
+- sed -e "s/\[INSERT_VERSION_HERE\]/$(RELEASE_VERSION)/" dkms-freshmeat.txt.in > dkms-freshmeat.txt