DragonFly BSD

HowToFirefoxandFlashplayer

Firefox and Flashplayer on DragonFlyBSD

Unfortunately, a Flash plugin is not natively available for DragonFlyBSD. When you want to watch Flash sites, you must install Linux versions of Firefox and the Flash player to run under emulation.

Installing Linux emulation layer on DragonFlyBSD

First, you have to install the Linux emulation. This is described in the DragonFly handbook. Of course, you can install a more up-to-date-package of the Suse package, like meta-pkgs/suse100. To do the next steps, you must have your Linux emulation up and running. Do the following steps as "root".

'NOTE: You can also just install the firefox-linux package and flashplayer from pkgsrc, which is actually the preferred way.'

Installing Firefox

You should create a subdirectory where you can put in all your Linux applications. In this Howto, it's /usr/local/linuxapps.

Alternative: Using nspluginwrapper with the native Flash plugin

The method described here consists on using nspluginwrapper, from pkgsrc, with a native browser which, in theory, will perform much better if compared to a generic emulated browser.

Procedure tested against DragonFlyBSD 2.6/i386, Firefox 3.6, and flash9 on the pkgsrc-2010Q1 branch.

Note : Linux emulation support on 64Bit DragonFly is not functional at the time of writing - so you'll need to run 32Bit DragonFly if you want this to work for now.

Step 1: Setup Linux Emulation Environment

Nspluginwrapper requires that the Linux emulation infrastructure is in place in order to correctly deal with the linux format flash plugin.

Install linux compatibility packages and multimedia/libflashsupport

This installs the needed linux packages for flash support, as well as installing the core linux emulation environment, and can be done as follows:

# cd /usr/pkgsrc/multimedia/libflashsupport
# bmake package clean

Configure DragonFlyBSD to run Linux binaries

In order to use Linux emulated binaries, the linux compatibility layer needs a bit of setup.

First, load the linux emulator kernel module:

# kldload linux
# kldload aac_linux # note - not 100% sure if needed here..

Next, mount linprocfs:

# mount -t linprocfs none /usr/pkg/emul/linux/proc

Then, run Linux ldconfig to setup the linux-side library linker paths:

# /compat/linux/sbin/ldconfig

The above steps should enable the linux emulation system to work - this can be tested by running a linux command - for example:

# uname -sr                                   
DragonFly 2.6-RELEASE
# file /usr/bin/uname /compat/linux/bin/uname 
/usr/bin/uname:          ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for DragonFly 2.0.600, stripped
/compat/linux/bin/uname: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, stripped
# uname -sr                                   
DragonFly 2.6-RELEASE
# /compat/linux/bin/uname -sr                 
Linux 2.6.16
# file /bin/ls /compat/linux/bin/ls              
/bin/ls:              ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, for DragonFly 2.0.600, stripped
/compat/linux/bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, stripped
# /bin/ls -l /compat/linux/bin/ls                
-rwxr-xr-x  1 root  wheel  82640 May  6 00:38 /compat/linux/bin/ls
# /compat/linux/bin/ls -l /bin/ls                
-rwxr-xr-x  1 root wheel 82640 May  6 00:38 /bin/ls

This example shows the different binary formats, as well as the uname and path overrides provided by the emulation layer, as well as some some subtle ls formatting subtleties between the two systems.

To enable linux emulation at boot, set linux_enable='YES' in your rc.conf, and create an fstab entry for the proc filesystem.

Install nspluginwrapper and ns-flash

Now that the Linux emulation system has been configured and tested, it's time to setup the actual flash portion:

# cd /usr/pkgsrc/www/ns-pluginwrapper
# bmake package clean

This should be all that is needed - however, during my tests, I did come across some errors that were related to not having setup the emulation layer properly - these errors contained something like "Elf type '0' binary unknown" - which means that nspluginwrapper is having trouble interfacing with the linux emulation subsystem.

You can check the installation with:

# nspluginwrapper --list
/usr/pkg/lib/netscape/plugins/npwrapper.libflashplayer.so
  Original plugin: /usr/pkg/lib/netscape/plugins/libflashplayer.so
  Wrapper version string: 1.2.2
/usr/pkg/lib/netscape/plugins/npwrapper.libflashplayer.so
  Original plugin: /usr/pkg/lib/netscape/plugins/libflashplayer.so
  Wrapper version string: 1.2.2  

No idea why it lists the plugin twice. From there - use it!

even when working, you might still recieve the following message when starting firefox:

LoadPlugin: failed to initialize shared library /usr/pkg/lib/netscape/plugin

s/libflashplayer.so [Shared object "libdl.so.2" not found, required by "libflash player.so"]

which, apparently, can be ignored - as it still worked.

Audio/Video sync issues with this method

Untested - the following was mentioned by ahornung@ on the docs@ list 9/30/2010:

About this: with the libflashsupport out of pkgsrc there's an
audio<->video sync problem. Johannes Hofmann (jh33) has found and fixed
the issue, but since libflashsupport is distributed as a binary, it
didn't make its way into pkgsrc and might never do so.

He is providing a fixed version (yes, it's a trustworthy source) here:

http://flpsed.org/libflashsupport.so.gz
and here, I think:
http://leaf.dragonflybsd.org/~hofmann/libflashsupport.so

Further testing for nspluginwrapper, trying other versions, etc

If you want to try out another flash version, etc - or possibly for other linux-only plugins - the following steps apply and were previously tested using flash7 and the seamonkey browser.

Remember that you need to create ~/.mozilla/plugins first as nspluginwrapper won't do this for you. It will just silent fail.

Now enjoy! :)