rpms/akmods/devel akmods, 1.3, 1.4 akmods.spec, 1.3, 1.4 akmodsposttrans, 1.1, 1.2

Thorsten Leemhuis thl at rpmfusion.org
Sun Feb 1 14:21:31 CET 2009


Author: thl

Update of /cvs/free/rpms/akmods/devel
In directory se02.es.rpmfusion.net:/tmp/cvs-serv300

Modified Files:
	akmods akmods.spec akmodsposttrans 
Log Message:
* Sun Feb 01 2009 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info - 0.3.6-1
- update to 0.3.6
-- better posttrans support
-- remove some leftovers from daemon stuff
-- fix a few minor bugs
-- use lockfile



Index: akmods
===================================================================
RCS file: /cvs/free/rpms/akmods/devel/akmods,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- akmods	29 Jan 2009 18:14:41 -0000	1.3
+++ akmods	1 Feb 2009 13:21:31 -0000	1.4
@@ -27,12 +27,12 @@
 #
 # ToDo:
 # - use yum on install required kernel-devel pacakges?
-# - subprocess on dameon stop?
 # - better way to detect if a earlier build failed or succeed
-# - manpage
-# - make use of the new posttrans hook in kenrel package?
-# - locking?
 # - special kernel "all" (all that are installed with a matching -devel package; could be called from posttrans in akmods packages)
+# - manpage
+# - make it configurable if kmod building is done with nohup
+# - check on shutdown if akmods is still running and let it finish before continuing
+# - make it configurable if kmod from the repo replace local ones
 
 # global vars
 myprog="akmods"
@@ -54,7 +54,7 @@
 	shift
 
 	# output to console
-	if [[ ! ${daemon} ]] && (( ${verboselevel} >= ${this_verbose} )) ; then
+	if (( ${verboselevel} >= ${this_verbose} )) ; then
 		if [[ "${1}" == "--success" ]] ; then
 			echo_success
 			continue_line=""
@@ -100,10 +100,10 @@
 	# remove tmpfiles
 	remove_tmpdir
 
-	# remove pidfile
-	[[ "${daemon}" ]] && rm -f /var/run/${myprog}.pid
+	# remove lockfile
+	rm -f /var/cache/akmods/.lockfile
 
-	exit 128
+	exit ${1:-128}
 }
 trap "finally" ABRT EXIT HUP INT QUIT
 
@@ -152,7 +152,7 @@
 		kernels="$(uname -r)"
 	fi
 
-	# we get the echo_{success,failure} stuff and the daemon method from there
+	# we get the echo_{success,failure} stuff from there
 	if [[ -r /etc/rc.d/init.d/functions ]]; then
 		source /etc/rc.d/init.d/functions
 	else
@@ -192,12 +192,15 @@
 	fi
 
 	# tools needed
-	for tool in akmodsbuild chown sed rpmdev-vercmp; do
+	for tool in akmodsbuild chown lockfile sed rpmdev-vercmp; do
 		if ! which "${tool}" &> /dev/null ; then
 			echo -n "${tool} not found" >&2
 			echo_failure; echo; exit 1
 		fi
 	done
+
+	# create lockfile and wait till we get it
+	lockfile -s 2 -l 1800 "/var/cache/akmods/.lockfile"
 }
 
 buildinstall_kmod()
@@ -418,10 +421,10 @@
 			if [[ ! "${1}" ]] ; then
 				echo "ERROR: Please provide the kernel-version to build for together with --kernel" >&2
 				exit 1
-			elif [[ ! -r /usr/src/kernels/"${1}"/Makefile ]] || [[ ! -r  /lib/modules/${1}/build/Makefile ]]; then
+			elif [[ ! -r /usr/src/kernels/"${1}"/Makefile ]] && [[ ! -r /lib/modules/${1}/build/Makefile ]]; then
 				echo "Could not find files needed to compile modules for ${1}"
 				exit 1
-			elif [[ -r /usr/src/kernels/"${1}"/Makefile ]] && [[ ! -r  /boot/vmlinuz-"${1}" ]]; then
+			elif [[ -r /usr/src/kernels/"${1}"/Makefile ]] && [[ ! -r /boot/vmlinuz-"${1}" ]]; then
 				# this is a red hat / fedora kernel-devel package, but the kernel for it is not installed
 				# kmodtool would adds a dep on that kernel when building; thus when we'd try to install the 
 				# rpms we'd run into a missing-dep problem. Thus we prevent that case
@@ -453,8 +456,13 @@
 			alwaystry=true
 			shift
 			;;
-		--from-posttrans|--from-init|--from-akmod)
-			# does nothing (yet!)
+		--from-init)
+			# just in case: remove stale lockfile is it exists:
+			rm -f /var/cache/akmods/.lockfile
+			shift
+			;;
+		--from-posttrans|--from-kernel-posttrans|--from-akmod-posttrans)
+			# ignored
 			shift
 			;;
 		--verbose)
@@ -490,4 +498,4 @@
 done
 
 # finished :)
-finally
+finally 0


Index: akmods.spec
===================================================================
RCS file: /cvs/free/rpms/akmods/devel/akmods.spec,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- akmods.spec	29 Jan 2009 18:14:41 -0000	1.3
+++ akmods.spec	1 Feb 2009 13:21:31 -0000	1.4
@@ -1,5 +1,5 @@
 Name:           akmods
-Version:        0.3.5
+Version:        0.3.6
 Release:        1%{?dist}
 Summary:        Automatic kmods build and install tool 
 
@@ -16,8 +16,10 @@
 
 BuildArch:      noarch
 
+# not picked up automatically
+Requires:       %{_bindir}/nohup
+
 # needed for actually building kmods:
-#Requires:       %{_bindir}/inotifywait
 Requires:       %{_bindir}/rpmdev-vercmp
 Requires:       kmodtool >= 1-9
 
@@ -101,6 +103,13 @@
 %{_mandir}/man1/*
 
 %changelog
+* Sun Feb 01 2009 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info - 0.3.6-1
+- update to 0.3.6
+-- better posttrans support
+-- remove some leftovers from daemon stuff
+-- fix a few minor bugs
+-- use lockfile
+
 * Thu Jan 29 2009 Thorsten Leemhuis <fedora [AT] leemhuis [DOT] info - 0.3.5-1
 - update to 0.3.5, fixes #340
 


Index: akmodsposttrans
===================================================================
RCS file: /cvs/free/rpms/akmods/devel/akmodsposttrans,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- akmodsposttrans	2 Oct 2008 17:28:11 -0000	1.1
+++ akmodsposttrans	1 Feb 2009 13:21:31 -0000	1.2
@@ -34,4 +34,4 @@
 fi
 
 # needs to run in background as rpmdb might be locked otherwise
-nohup /usr/sbin/akmods --from-posttrans --kernels ${1} &> /dev/null &
+nohup /usr/sbin/akmods --from-kernel-posttrans --kernels ${1} &> /dev/null &



More information about the rpmfusion-commits mailing list