From owner-freebsd-hackers Mon Nov 9 09:08:35 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA24861 for freebsd-hackers-outgoing; Mon, 9 Nov 1998 09:08:35 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.54]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA24855 for ; Mon, 9 Nov 1998 09:08:34 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.9.1/8.8.8) id JAA10172 for hackers@freebsd.org; Mon, 9 Nov 1998 09:12:33 -0800 (PST) (envelope-from sgk) From: Steve Kargl Message-Id: <199811091712.JAA10172@troutmask.apl.washington.edu> Subject: linux software installation and uname To: hackers@FreeBSD.ORG Date: Mon, 9 Nov 1998 09:12:33 -0800 (PST) X-Mailer: ELM [version 2.4ME+ PL43 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Ladies and Gents, I've recently installed the Portland Groups's Fortran 90 for Linux on my system (it works!). However, during the installation from the cdrom, a install script is executed that contains a test involving "uname -s" to ensure the installation is on a system running Linux. Of course, "uname -s" on a FreeBSD system returns "FreeBSD" instead of the expected "Linux". Thus, I had to alter uname(1) to report "Linux" to install the software. With the expected availability of more commericial software for Linux, it seems necessary to provide uname(1) the capability to report "Linux" in place of "FreeBSD". -- Steve finger kargl@troutmask.apl.washington.edu http://troutmask.apl.washington.edu/~clesceri/kargl.html *** uname.c.orig Mon Nov 9 08:46:41 1998 --- uname.c Mon Nov 9 08:49:54 1998 *************** *** 105,116 **** prefix = ""; if (flags & SFLAG) { ! mib[0] = CTL_KERN; ! mib[1] = KERN_OSTYPE; ! len = sizeof(buf); ! if (sysctl(mib, 2, &buf, &len, NULL, 0) == -1) ! err(1, "sysctl"); ! (void)printf("%s%.*s", prefix, (int)len, buf); prefix = " "; } if (flags & NFLAG) { --- 105,119 ---- prefix = ""; if (flags & SFLAG) { ! if (!getenv("LINUX_UNAME")) { ! mib[0] = CTL_KERN; ! mib[1] = KERN_OSTYPE; ! len = sizeof(buf); ! if (sysctl(mib, 2, &buf, &len, NULL, 0) == -1) ! err(1, "sysctl"); ! (void)printf("%s%.*s", prefix, (int)len, buf); ! } else ! (void)printf("%sLinux", prefix); prefix = " "; } if (flags & NFLAG) { *** uname.1.orig Mon Nov 9 09:06:23 1998 --- uname.1 Mon Nov 9 09:08:56 1998 *************** *** 72,77 **** --- 72,82 ---- to standard output. .It Fl s Write the name of the operating system implementation to standard output. + If the environmental variable + .Em LINUX_UNAME + is set, then write + .Em Linux + to standard output. .It Fl v Write the version level of this release of the operating system to standard output. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message