Date: Thu, 7 Dec 2000 07:50:33 +1000 From: Matthew Peacock <Mattp@innerrange.com.au> To: 'Mike Meyer' <mwm@mired.org> Cc: "Freebsd (E-mail)" <questions@freebsd.org> Subject: RE: Please help with linux compatibility Message-ID: <B1A814C42460D311B10F009027589E4E093FD2@EXCHANGE>
next in thread | raw e-mail | index | archive | help
Thanks Mike. I think for now I'll just stick with the v4 then. I'll keep my reading up and once I know what's going on I might get a bit more adventurous and try some new stuff. Thanks again, Matt -----Original Message----- From: Mike Meyer [SMTP:mwm@mired.org] Sent: Wednesday, December 06, 2000 7:01 PM To: Matthew Peacock Cc: Freebsd (E-mail) Subject: RE: Please help with linux compatibility Matthew Peacock <Mattp@innerrange.com.au> types: > Anyway, on one of the machines I have an older version of FreeBSD (v4.0). I > did a kldstat on it and it showed that linux.ko was loaded. I did a whereis > on linux.ko and it said /modules. I went to machine running the newer > version of FreeBSD (v5.0-CURRENT branch, June 2000). I went to the /modules > directory and saw that it was empty. I then ran sysinstall and tried to > reinstall the linux compatibility options. I did this but it still didn't > load the modules. I then went back into sysinstall and started looking > around. In the README it said that the version of FreeBSD I had was not for > the uninitiated FreeBSD user (me) and that it could contain a few bugs. I > assume that one of the bugs is that the linux compatibility doesn't install > properly. I was about to mention somethig like that. I wouldn't suggest running -CURRENT on a production machine, even if you are initiated. Right now is particularly rocky - there are still gotchas associated with the new SMP code (that's got a new threading/locking model, so they apply even on non-SMP systems). As for sysinstall, are you sure you're running a 5.0 sysinstall, and not one from the -STABLE branch? Sysinstall isn't updated by "make world" and friends > I didn't have anything valuable on the hard disk so I reinstalled > FreeBSD version 4. The linux stuff installed fine. I installed Wingzs (linux > spreadsheet) and it worked fine. I haven't decided yet but I'm thinking of > upgrading the v4.0 to the v5.0 disk that I have. That way I will have the > newer kernel with the linux libraries already installed. If you're talking about runinng a 5.0 kernel with 4.0 binaries, don't. There's a good chance the 4.0 linux module will crash your system if you load it into a 5.0 kernel. Even if it doesn't, you'll have *lots* of other problems. Basically, you shouldn't run a kernel and binaries that are out of sync with each other unless you know what you're doing. Things regularly change in the kernel that require rebuilding - or changing - the system utilities. If you don't have those changes in place, the utility could break or misbehave in strange ways. For kernel modules, it's even worse, because "breaking" translates pretty easily into a kernel panic. <mike > -----Original Message----- > From: Mike Meyer [SMTP:mwm@mired.org] > Sent: Monday, December 04, 2000 8:21 PM > To: Matthew Peacock > Cc: questions@freebsd.org > Subject: Re: Please help with linux compatibility > > Matthew Peacock <Mattp@innerrange.com.au> types: > > * When Installing FreeBSD I said "Yes" to the question "Would > you like > > to have linux compatibility". This then installed some > compatibility > > libraries which I assume are all the librararies that are needed. > > Ok, I don't know what asking for Linux compatability at install time > does. You need to do two things, though: 1) enable the kernel API > support for Linux, and install the linux_base port. > > > * After installation I checked the /usr/compat/linux/ shadow > > directories and saw that there wer lots of directories that were > ther. I > > looked in /usr/compat/linux/lib and saw that there were lots of > linux > > libraries there. > > That would indicate that the linux_base port was installed. You > might > verify that /compat is a symlink to /usr/compat, or /compat/linux is > a > symlink to /usr/compat/linux. > > > * Next I edited the /etc/defaults/rc.conf file and added > > LINUX_ENABLE="YES". I thought that this was a bit strange that it > said no to > > start with because I had asked for linux compatibility during > install. > > You should *never* touch anything in /etc/defaults/. Those files > hold > default values for things you set in files in /etc. In this case, > /etc/rc.conf - which should have had LINUX_ENABLE="yes" added by the > install process. > > > * I rebooted and did "kldstat". I expected to see the linux > module but > > I did not. I am running a recent version of FreeBSD (dated About > June this > > year and purchased as FreeBSD Toolkit v5). I am thinking that > maybe the > > linux compatibility module is now statically linked to the kernel. > Is this > > correct? I wasnt sure so I tried typing "linux" as the handbook > advised but > > it said that this module was unknown. > > It doesn't look like the Linux module is statically linked. You > should try loading it by hand, though. Try running "/sbin/kldload > linux", then check the console error messages. If Linux is already > already loaded, it will say "module linux already present" or words > to > that effect. If it's wasn't loaded, and the module exists, that will > load it for you. If you can't get it loaded, you won't be able to > get > them to run. > > Care to provide the exact text of the message you got from running > "linux"? There are a number of things that can be interpreted as > saying the module was unknown, but don't mean that. > > > * Anyway, after assuming that the linux compatibility is > statically > > linked, I then tried to install a few linux apps to see what would > happen. I > > got StarOffice3.1 to install and I got Wingz (spreadsheet) to > install. When > > I tried to execute these programs they both gave me the results > > "/lib/libname not found" (I cant remember the exact name of the > library but > > it did exist in the linux shadow library directory). I realised > that the > > program was still looking for where linux keeps its modules. I > therefore > > created a /lib directory and copied the linux modules from the > > /usr/compat/linux/lib directory and then tried to run the app. I > got > > "segmentation fault core dumped". > > Um - if you have the linux module loaded, it will check > /compat/linux/lib before it checks /lib. If you managed to overwrite > FreeBSD libraries with their Linux version, your system is going to > be > *very* flaky. > > > * I then consulted the manual again and it said that I should > put the > > binaries (Wingz and swriter etc) into the /usr/compat/linux/lib > directory > > and run them from there. This did not work - it just said > "/lib/libname not > > found". > > Binaries? In a lib directory? Where in the manual does it say that? > > <mike > -- > Mike Meyer <mwm@mired.org> > http://www.mired.org/home/mwm/ > Independent WWW/Unix/FreeBSD consultant, email for more > information. > -- Mike Meyer <mwm@mired.org> http://www.mired.org/home/mwm/ Independent WWW/Unix/FreeBSD consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B1A814C42460D311B10F009027589E4E093FD2>