ports/148097: suggested addition to liux_base-* packages to set osreales variable correctly

Christoph Weber-Fahr cwf-ml at arcor.de
Thu Jun 24 00:50:04 UTC 2010


>Number:         148097
>Category:       ports
>Synopsis:       suggested addition to liux_base-* packages to set osreales variable correctly
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 24 00:50:03 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Christoph Weber-Fahr
>Release:        FreeBSD 7.3
>Organization:
Vodafone
>Environment:
FreeBSD xxx.yyy.zzz.de 7.3-RELEASE FreeBSD 7.3-RELEASE #0: Mon Jun  7 14:29:18 UTC 2010     root at buildXXXX.yyy.net:/usr/obj/usr/src/sys/DL380DNS  amd64

>Description:
Right now the linux compatibility kernel module supports 2 abi versions: 2.4.2 and 2.6.16.   2.4.2 is the default, the other one can be set via a sysctl variable. 

But the current versions of all linux_base-*packages need the 2.6.16 setting. Unfortunately, though, the packages don't have any mechanism in place o actually set this permanently.

I venture to guess the maintainers wanted the user to put this setting into /etc/sysctl.conf . But, aside from the fact that at least the binary package installation makes no mention of this, this creates a unique problem: 

/etc/rc.d/sysctl (which implements sysctl.conf) is run *before* /etc/rc.d/abi (which loads the kernel module). So, at this point the osrelease setting fails silently. Later on (very late, actually) /etc/rc.d/sysctl is invoked a second time by /etc/rc.d/securelevel, which then sets the variable correctly. 

But unfortunatley, at this time, many third party package start scripts from /usr/local/etc/rc.d/ have already been run. Most of them either use REQUIRE LOGIN or no such setting at all, both of which results in them being run before securelevel. 

Any of those needing linux_base fail silently. 

Now, a workaround would be to have each linux-dependent package use "REQUIRE securelevel". But that is counter-intuitive and might even bring up other problems, especially if you actually use securelevel.

The correct way of course is to have the osrelease variable set earlier. A simple way to do this is for the respective linux_base package to install its own small start script that can run much earlier without any  adverse consequences. 

I include such a script below and suggest it or something similar to be added to all linux_base-* packagesand installed by them to /usr/local/etc/rc.d/


>How-To-Repeat:

>Fix:
#!/bin/sh
#
# PROVIDE: linuxversion
# REQUIRE: abi
# BEFORE:  DAEMON
#
#

. /etc/rc.subr

name="linuxversion"
stop_cmd=":"
start_cmd="linuxversion_start"
reload_cmd="linuxversion_start"

linuxversion_start()
{
        echo "Settimg Linux ABI version:"
        sysctl compat.linux.osrelease=2.6.16
}

load_rc_config $name
run_rc_command "$1"


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



More information about the freebsd-ports-bugs mailing list