ports/142837: [patch] emulators/linux_base-* packages fails to install when linux.ko is not installed

Scot Hetzel swhetzel at gmail.com
Thu Jan 14 18:00:05 UTC 2010


>Number:         142837
>Category:       ports
>Synopsis:       [patch] emulators/linux_base-* packages fails to install when linux.ko is not installed
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 14 18:00:04 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Scot Hetzel
>Release:        8.0-Stable
>Organization:
>Environment:
FreeBSD dv8t01 8.0-STABLE FreeBSD 8.0-STABLE #10 r201599M: Tue Jan  5 14:29:56 CST 2010     swhetzel at dv8t01:/usr/obj/usr/src/8-stable/sys/GENERIC  amd64

>Description:
When the linux_base* ports are installed as a package, they attempt to check the compat.linux.osrelease sysctl variable to make sure that is is 2.6.16 or greater, but when the linux.ko module is not loaded this variable doesn't exist.

This causes the package to fail to install, with the error 'linuxulator is not (kld)loaded, exiting'.

The pkg-install PRE-INSTALL target does have the ability to kldload the linux.ko module, but it occurs after the check for the sysctl variable compat.linux.osrelease.
>How-To-Repeat:
#pkg_add linux_base-f10-10_2
sysctl: unknown oid 'compat.linux.osrelease'
linuxulator is not (kld)loaded, exiting
pkg_add: install script returned error status

>Fix:
The attached patch applies to the linux_base-f7, 8, 9 and 10 ports and the linux_base-fc6 ports.

Note: linux_base-fc4 is not affected.

Patch attached with submission follows:

Index: pkg-install
===================================================================
RCS file: /home/ncvs/ports/emulators/linux_base-f10/pkg-install,v
retrieving revision 1.13
diff -u -r1.13 pkg-install
--- pkg-install	12 May 2009 14:53:58 -0000	1.13
+++ pkg-install	14 Jan 2010 17:38:37 -0000
@@ -3,14 +3,6 @@
 
 case "$2" in
 PRE-INSTALL)
-	if [ "`/sbin/sysctl -n compat.linux.osrelease`"x = "x" ]; then
-		echo 'linuxulator is not (kld)loaded, exiting'
-		exit 1
-	fi
-	if [ "`/sbin/sysctl -n compat.linux.osrelease`" = "2.4.2" ]; then
-		echo 'compat.linux.osrelease: 2.4.2 is not supported, exiting'
-		exit 1
-	fi
 	if [ -z "`kldstat -v | grep -E 'linux(aout|elf)'`" ]; then
 		echo 'Linux mode is not enabled.'
 		echo 'Loading linux kernel module now...'
@@ -20,6 +12,14 @@
 			exit 1
 		fi
 	fi
+	if [ "`/sbin/sysctl -n compat.linux.osrelease`"x = "x" ]; then
+		echo 'linuxulator is not (kld)loaded, exiting'
+		exit 1
+	fi
+	if [ "`/sbin/sysctl -n compat.linux.osrelease`" = "2.4.2" ]; then
+		echo 'compat.linux.osrelease: 2.4.2 is not supported, exiting'
+		exit 1
+	fi
 	;;
 POST-INSTALL)
 	if [ -z "`grep ^linproc /etc/fstab`" ]; then


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list