From owner-freebsd-emulation@FreeBSD.ORG Sat Mar 22 00:57:22 2008 Return-Path: Delivered-To: freebsd-emulation@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE90E1065670 for ; Sat, 22 Mar 2008 00:57:22 +0000 (UTC) (envelope-from bsam@ipt.ru) Received: from services.ipt.ru (services.ipt.ru [194.62.233.110]) by mx1.freebsd.org (Postfix) with ESMTP id 6B3EA8FC16 for ; Sat, 22 Mar 2008 00:57:22 +0000 (UTC) (envelope-from bsam@ipt.ru) Received: from [85.173.17.109] (helo=localhost.my.domain) by services.ipt.ru with esmtpa (Exim 4.54 (FreeBSD)) id 1Jcs2y-000KIB-Rc; Sat, 22 Mar 2008 03:57:21 +0300 To: Alexander Leidinger References: <07011489@ipt.ru> <20080321115227.zkcrs6rvc4c8s004@webmail.leidinger.net> From: Boris Samorodov Date: Sat, 22 Mar 2008 03:56:49 +0300 In-Reply-To: <20080321115227.zkcrs6rvc4c8s004@webmail.leidinger.net> (Alexander Leidinger's message of "Fri\, 21 Mar 2008 11\:52\:27 +0100") Message-ID: <98037310@ipt.ru> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-emulation@FreeBSD.org Subject: Re: add LINUX_OSRELEASE to bsd.linux-rpm.mk X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Mar 2008 00:57:23 -0000 On Fri, 21 Mar 2008 11:52:27 +0100 Alexander Leidinger wrote: > Quoting Boris Samorodov (from Fri, 21 Mar 2008 02:25:50 +0300): > > I propose the following patch to bsd.linux-rpm.mk. It introduces a new > > variable LINUX_OSRELEASE which is evaluated at bsd.linux-rpm.mk unless > > it has been already defined. > What's the big picture (in the sense of: how do you want to use it)? Well, it were you who asked about The Big Picture. ;-) OK, we a speaking about the day when 2.6.16 is a default value. To say in short, I assume that this variable will be used by every linux port (well, may be except infrastructure ports). E.g. if someone is going to install, say print/acroread7, then the system should detect which ports (upon which acroread depends): either x11-toolkits/linux-pango (current 2.4.2 port) or x11-toolkits/linux_k26-pango (future 2.6.16 port). That may be done by using: 1) the value from compat.linux.osrelease sysctl; 2) OSREL value (e.g. if OSREL>8000XX, etc.); 3) a pre-defined value; 4) checking for a file (contents). The first one is more strict. The system is configured (linux kernel module loaded, compat.linux.osrelease sysctl is set). There should be no side effects or astonishments when running a linux application. The second one can be used but only when we get at least one branch with non 2.4.2 linux emulation by default. The third one may be usefull for package building/jails (though this case needs some more investigation). The forth one may also be used, but seems to be non-reliable: . files tend to change their names (redhat-release, fedora-release, etc.) and internal structure; . files may got staled after OS upgrading and so on. So, the value of LINUX_OSRELEASE is used to set a value to a new variable LINUX_PORT_SUFFIX. Here is a proof of concept (though it partially works for me). The idea (as usual is stolen from our x11/gnome (thanks!) teams. Ah, don't pay attention to actual paths, they are given only as examples. ----- .if ${LINUX_OSRELEASE} == "2.6.16" LINUX_PORT_SUFFIX= _k26 .else LINUX_PORT_SUFFIX= .endif expat_FILE= ${LINUXBASE}/usr/lib/libexpat.so.0 expat_k26_FILE= ${LINUXBASE}/lib/libexpat.so.1 expat_DETECT= ${expat${LINUX_PORT_SUFFIX}_FILE} expat_PORT= ${PORTSDIR}/textproc/linux${LINUX_PORT_SUFFIX}-expat ----- The value ${expat_DETECT}:${expat_PORT} will be: . ${LINUXBASE}/usr/lib/libexpat.so.0:${PORTSDIR}/textproc/linux-expat (for LINUX_OSRELEASE other than 2.6.16); . ${LINUXBASE}/lib/libexpat.so.1:${PORTSDIR}/textproc/linux_k26-expat (for 2.6.16). Then a port's Makefile may use a variable USE_LINUX_APPS to show used linux infrastructure ports (instead of using them at XXX_DEPENDS): ----- USE_LINUX_APPS= expat ----- What will we get? Here you are. We get two (but not limited to "two") groups of linux infrastructure ports. Other linux applications just use the needed group automagically. > Depending on the usage, it may be overkill to use it in linux-rpm.mk > and it would be better to just use it directly when it is needed. If > you want to use it in nearly every linux port, then sure, go ahead. > But if it is just a handful of ports, I would like to understand the > implications. If you have something which uses this already, just show > it. If not, I would say we are not in a hurry to add this now and we > can talk about it, if there's something to show. That concept may be introduced now even before the default for linux.osrelease is changed. Current linux infrastructure ports may not be touched -- they'll work as usual. Other linux ports may be transferred one-by-one. And we'll get some application testing with new linux infrastructure ports before official annouce of the change. That path seems to be soft and quiet, with least astonishment. WBR -- bsam