Oczywiście tytuł jest mocno przesadzony, bo z LinuxConfa nie będzie żadnego pożytku, ale… Zawsze warto mieć możliwość uruchomienia programu skompilowanego dla Linuksa pod kontrolą OpenBSD. Jak to zrobić? Pełne instrukcje napisane przez Ryana Cooley’a zamieszczamy poniżej. Jak widać, instalacja emulatora jest bardzo prosta. Co prawda nie działają pod nim niektóre programy (np RealPlayer czy StarOffice), ale już wkrótce może to ulec zmianie…

The OpenBSD: GNU/Linux Emulation How-to

Ryan Cooley

RyanCooley@Yahoo.com

Copyright (C) 2001 by Ryan Cooley
Version 1.0, May 2001
The following document describes how to run GNU/Linux binary executables under OpenBSD using it’s built-in emulation support. The reader should be comfortable with basic tasks like copying, download, and be able to install the GNU/Linux program under OpenBSD.


Table of Contents

1. Kernel Configuration
2. Linux_Libs package
3. Running GNU/Linux Application
4. Getting GNU/Linux Libraries
5. Installing GNU/Linux Libraries
6. Conclusions

Kernel Configuration

By default, the OpenBSD kernel has GNU/Linux, FreeBSD, and BSDi binary compatibility enabled. If you recompile the kernel to suit your needs, make sure you do not comment the „ENABLE Linux_Compat” option, out.

Linux_Libs Package

As with any operating system, there are certain libraries required to run the programs. The base GNU/Linux system libraries are contained in an OpenBSD package named linux_libs which can be found on the OpenBSD ftp server. Assuming you are running OpenBSD v2.8, the linux_libs package is located at: ftp://ftp.openbsd.org/pub/OpenBSD/2.8/packages/i386/linux_libs-2.6.1.tgz Thanks to the powerful BSD package manager, you can install the package direct from the web server. Log in as root and type the command as follows:

pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/2.8/packages/i386/linux_libs-2.6.1.tgz

It may take some time to download the 8.5Meg package over a slow modem connection so be very patient, even if you get an error message or two.

Running a GNU/Linux Application

Once installed, you can attempt to run your program on OpenBSD just as you would under GNU/Linux. If you get an error message (which you likely will) talking about missing some file, it just means you must install the GNU/Linux package which contains that file.

Getting GNU/Linux Libraries.

Certainly, the easiest way to find and install GNU/Linux packages would be to look for your missing file in: ftp://ftp.slackware.com/pub/slackware/slackware-current/PACKAGES.TXT Once you’ve found the file, see which package it belongs to, and the location of that package. Start at ftp://ftp.slackware.com/pub/slackware/slackware-current/ and change into the directory where you package can be found. Now, I suggest downloading the package to /usr/emul/linux/ on your hard drive.

Installing GNU/Linux Libraries

To install this package, execute the following command while in the /usr/emul/linux/ directory:

tar fxvz PACKAGE_NAME
sh install/doinstall.sh

Optionally, you can now delete the downloaded package and install script folder with the command:

rm -r PACKAGE_NAME install/

Now that you have installed the libraries needed, try running that program again. If it complains about the same file, you’ve done something wrong, perhaps using the wrong folder for the GNU/Linux libraries. However, if it complains about missing a different file that before, you’re first library install was successful, now go back to step four until you have installed all the packages your program needs to successfully run.

Conclusions

OpenBSD 2.8 is unable to run several very popular GNU/Linux binaries such as Star Office, Real Player, Opera, and many more. While this may be a turn-off to some, I feel it worth mentioning that the upcoming 2.9 release has improved the emulation subsystem greatly, allowing OpenBSD users to run all of the listed programs under GNU/Linux emulation. While improved, certainly not all GNU/Linux binaries can be run, which is why I recommend using only Open Source software. This will ensure that any platform you or your company decides to switch to will be able to run all of your current software. Before Open Source, switching platforms was an almost cataclysmic even as every piece of software used needed to be replaced by a similar product on the new platform. Now, in the worst case, you might need to pay a programmer to port the source code to the new platform, which is not likely going to be a problem. But in our world today, not everything we use is Open Source, making binary compatibility, with other operating system, a great feature, and even a necessity for some.

Back To Top
Archiwalny news dodany przez użytkownika: honey.
Kliknij tutaj by zobaczyć archiwalne komentarze.

Oznaczone jako → 
Share →