misc formatting tweaks per last commit
[ikiwiki.git] / docs / howtos / HowToFirefoxandFlashplayer.mdwn
1
2 # Firefox and Flashplayer on DragonFlyBSD 
3 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.
4
5 ## Installing Linux emulation layer on DragonFlyBSD 
6 First, you have to install the Linux emulation. This is described in [the DragonFly handbook](linuxemu.html). 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".
7
8 ******'NOTE: You can also just install the firefox-linux package and flashplayer from pkgsrc, which is actually the preferred way.******'
9
10 ## Installing Firefox 
11 You should create a subdirectory where you can put in all your Linux applications. In this Howto, it's /usr/local/linuxapps.
12
13
14 * Create the directory for you Linux applications
15        mkdir /usr/local/linuxapps
16     
17 * Download a Linux version of Firefox from http://www.mozilla.org and drop the file to /usr/local/linuxapps.
18     
19 * Do a
20       . cd /usr/local/linuxapps
21     
22 * Extract firefox
23       . tar xvfz firefox-*gz
24     
25 * A subdirectory /usr/local/linuxapps/firefox is created then. It contains a firefox "installation"
26     
27 * Delete the firefox installation tarball
28       . rm firefox-*gz
29     
30 * Firefox is now ready to use. You can start it with
31       . /usr/local/linuxapps/firefox/firefox
32     
33 * You may want to make a desktop link/shortcut
34     
35     ## Installing Flashplayer 
36     
37 * Download the Linux version of the Flash player from http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version#ShockwaveFlash&promoidBIOW and drop the file to /usr/local/linuxapps. Surf to the download site with your newly installed firefox, then you'll get offered the Linux version of the Flashplayer.
38     
39 * Extract the install_flash_player-file here.
40       . tar xvfz install_flash_player*gz
41     
42 * A subdirectory with the Flash player "installation" in it is created. Enter that flashplayer directory (for example, install_flash_player_7_linux)
43       . cd install_flash_player_7_linux
44     
45 * Copy the file libflashplayer.so into your firefox/plugins directory
46       . cp libflashplayer.so ../firefox/plugins
47     
48 * Copy the file flashplayer.xpt into your firefox directory
49       . cp flashplayer.xpt ../firefox
50     
51 * Delete your Flashplayer installation tarball
52           . 
53     cd ..
54 rm install_flash_player*gz
55
56 * Start Firefox now and surf to a flash site. If you don't know one, try http://autobahn.nrw.de/olsim3_1/koeln.html
57
58 * Firefox will complain now about a missing plugin. Let Firefox seek for the plugin and go through the installation of the Flashplayer extension.
59
60 * Now restart your Firefox browser
61
62 # Alternative: Using nspluginwrapper with the native Flash plugin
63
64 The method described here consists on using ***nspluginwrapper***, 
65 from ***pkgsrc***, with a native browser which, in theory, will 
66 perform much better if compared to a generic emulated browser. 
67
68 Procedure tested against DragonFlyBSD 2.6/i386, Firefox 3.6, and flash9 
69 on the pkgsrc-2010Q1 branch.
70
71 **Note** : Linux emulation support on 64Bit DragonFly is not functional
72   at the time of writing - so you'll need to run 32Bit DragonFly
73   if you want this to work for now.
74
75 ## Step 1: Setup Linux Emulation Environment
76
77 Nspluginwrapper requires that the Linux emulation infrastructure is
78 in place in order to correctly deal with the linux format flash plugin.
79
80 ### Install linux compatibility packages and multimedia/libflashsupport 
81
82   This installs the needed linux packages for flash support, as well as
83 installing the core linux emulation environment, and can be done as follows:
84
85     # cd /usr/pkgsrc/multimedia/libflashsupport
86     # bmake package clean
87
88 ### Configure DragonFlyBSD to run Linux binaries
89
90 In order to use Linux emulated binaries, the linux compatibility
91 layer needs a bit of setup. 
92
93 First, load the linux emulator kernel module:
94
95     # kldload linux
96     # kldload aac_linux # note - not 100% sure if needed here..
97
98 Next, mount linprocfs:
99
100     # mount -t linprocfs none /usr/pkg/emul/linux/proc
101
102 Then, run Linux ldconfig to setup the linux-side library linker paths:
103
104     # /compat/linux/sbin/ldconfig
105
106 The above steps should enable the linux emulation system to work - 
107 this can be tested by running a linux command - for example:
108
109     # uname -sr                                   
110     DragonFly 2.6-RELEASE
111     # file /usr/bin/uname /compat/linux/bin/uname 
112     /usr/bin/uname:          ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for DragonFly 2.0.600, stripped
113     /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
114     # uname -sr                                   
115     DragonFly 2.6-RELEASE
116     # /compat/linux/bin/uname -sr                 
117     Linux 2.6.16
118     # file /bin/ls /compat/linux/bin/ls              
119     /bin/ls:              ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, for DragonFly 2.0.600, stripped
120     /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
121     # /bin/ls -l /compat/linux/bin/ls                
122     -rwxr-xr-x  1 root  wheel  82640 May  6 00:38 /compat/linux/bin/ls
123     # /compat/linux/bin/ls -l /bin/ls                
124     -rwxr-xr-x  1 root wheel 82640 May  6 00:38 /bin/ls
125
126 This example shows the different binary formats, as well as the uname
127 and path overrides provided by the emulation layer, 
128 as well as some some subtle ls formatting subtleties between the two
129 systems.
130
131 To enable linux emulation at boot, set linux_enable='YES' in your rc.conf,
132 and create an fstab entry for the proc filesystem.
133
134 ### Install nspluginwrapper and ns-flash
135
136 Now that the Linux emulation system has been configured and tested, 
137 it's time to setup the actual flash portion:
138
139     # cd /usr/pkgsrc/www/ns-pluginwrapper
140     # bmake package clean
141
142 This should be all that is needed - however, during my tests, I
143 did come across some errors that were related to not having setup
144 the emulation layer properly - these errors contained something
145 like "Elf type '0' binary unknown" - which means that nspluginwrapper
146 is having trouble interfacing with the linux emulation subsystem.
147
148 You can check the installation with:
149
150     # nspluginwrapper --list
151     /usr/pkg/lib/netscape/plugins/npwrapper.libflashplayer.so
152       Original plugin: /usr/pkg/lib/netscape/plugins/libflashplayer.so
153       Wrapper version string: 1.2.2
154     /usr/pkg/lib/netscape/plugins/npwrapper.libflashplayer.so
155       Original plugin: /usr/pkg/lib/netscape/plugins/libflashplayer.so
156       Wrapper version string: 1.2.2  
157
158 No idea why it lists the plugin twice. From there - use it!
159
160 * Check about:plugins in your FireFox url bar - you should see:
161
162     File: npwrapper.libflashplayer.so
163     Version: Shockwave Flash 9.0 r283
164
165 * Try it out!
166
167 even when working, you might still recieve the following message when 
168 starting firefox:
169
170     LoadPlugin: failed to initialize shared library /usr/pkg/lib/netscape/plugin
171 s/libflashplayer.so [Shared object "libdl.so.2" not found, required by "libflash
172 player.so"] 
173
174 which, apparently, can be ignored - as it still worked.
175
176 ## Audio/Video sync issues with this method
177
178 Untested - the following was mentioned by ahornung@ on the docs@ list 
179 9/30/2010:
180
181     About this: with the libflashsupport out of pkgsrc there's an
182     audio<->video sync problem. Johannes Hofmann (jh33) has found and fixed
183     the issue, but since libflashsupport is distributed as a binary, it
184     didn't make its way into pkgsrc and might never do so.
185
186     He is providing a fixed version (yes, it's a trustworthy source) here:
187
188     http://flpsed.org/libflashsupport.so.gz
189     and here, I think:
190     http://leaf.dragonflybsd.org/~hofmann/libflashsupport.so
191
192 ## Further testing for nspluginwrapper, trying other versions, etc
193
194 If you want to try out another flash version, etc - or possibly
195 for other linux-only plugins - the following steps apply and 
196 were previously tested using flash7 and the seamonkey browser.
197
198 * download the Flash 7 plugin from:
199  http://fpdownload.macromedia.com/get/flashplayer/installers/archive/fp7_archive.zip and unzip it.
200  r73/install_flash_player_7_linux_r73.tar.gz is reported to work.
201 * Extract it somewhere of your choice and run,  **as normal user** :
202      
203     nspluginwrapper -i /path/to/your/flash7/libflashplayer.so
204 seamonkey
205
206 Remember that you need to create ~/.mozilla/plugins first as 
207 nspluginwrapper won't do this for you. It will just silent fail.
208
209 Now enjoy! :)