LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Patching kernel, Wifi, and No Sound with Flash+Firefox+Linux (https://www.linuxquestions.org/questions/linux-newbie-8/patching-kernel-wifi-and-no-sound-with-flash-firefox-linux-734831/)

NeddySeagoon 07-02-2009 03:19 PM

Chief Fox,

The kernel tarball is well behaved. When you untar it it makes itself a new directory. I like to build kernels in my /home/<usrername>/ directory because I don't need to be root to do it.

Move (mv) or copy (cp) the kernel tarball to your home. If you got it from kernel.org, it may already be there.
Code:

mv /path/to/kernel ~
~ is shorthand for /home/<usrername>/
untar the kernel.
Code:

tar xjf <kernel_tarball>
this will create a new directory called after the tarball. Use the
Code:

ls
command to find out its name.

If your distro provides a file /proc/config.gz zcat it to your new kernel. This is the configuration file of the running kernel.
Code:

zcat /proc/config.gz ~/<kernel_dir_name>/.config
Your old .config file may also be in /boot and in an old kernel, if you have made one from source before.
Once you have a ~/<kernel_dir_name>/.config, change into the kernel dir and you must run make oldconfig to convert your old .config into a legal .config for the new kernel.
Code:

cd ~/<kernel_dir_name>
make oldconfig

You may need to answer some questions. Press ? and read the help.
When that completes you have a valid kernel config file.
run
Code:

make
to build the kernel and it modules.
The next steps must be run as root.
Code:

make modules_install
make install

Potential problems. The above steps do not make you an initrd file, which you may need to boot a kernel made from your distros old .config file. The above does not modify grub.conf to boot your new kernel. Depending on your setup, the make install step may do that.

GlennsPref 07-02-2009 08:24 PM

Hi, Chief, sorry for sounding fragmented, let me put the steps together sequentially.

Many linux commands are similar to Dos/win, like dir, cp, cd but GNU/Linux has much more.

The directories are referenced from /

if you cd to boot/grub/ (without the /), it will look from where you are, for boot/grub.

Which may not exist.

But if you cd /boot/grub it will look from / to find the dir.
for example...
Code:

door@MusicBox:~$ cd boot/grub                                    (03-07 11:18)
cd: no such file or directory: boot/grub
door@MusicBox:~$ pwd                                            (03-07 11:18)
/home/door
door@MusicBox:~$ cd /boot/grub                                  (03-07 11:18)
door@MusicBox:/boot/grub$


Firstly, when you up-zipped/tarred the kernel to the old folder
Quote:

I copied my new kernel (linux-2.6.30.tar.bz2) to folder (/usr/src/linux-source-2.6.28).
That was the wrong thing to do, but I can understand why you might want to do that.
This is where the link to /usr/src/linux comes in, you can have many sources available, but only need to change the link to compile or build any of them (within reason)

So go back, you can delete that "/usr/src/linux-source-2.6.28" directory later if you need the space.

Start here....
move to the directory where the kernel .tar is, then (we need root (admin) access to write to /usr/src/folders, if the your shell terminal is already logged in as root, leave out the preceeding "sudo")

sudo tar cjf linux-2.6.30.tar.bz2 /usr/src/linux-2.6.30

change to the root (/) directory, type
cd / (enter) Or cd.. enter until you get there.

remove any old link...
sudo rm -rf /usr/src/linux

create a new link to the new kernel sources...
sudo ln -s /usr/src/linux-2.6.30 /usr/src/linux

now you should be ready to configure the kernel.

cd to it to make sure it's there and ls (list the files)

ls /usr/src/linux (it should be the same as /usr/src/linux-2.6.30)

save a backup copy of /boot/config to /boot/config-old

cp /boot/config /boot/config-old, (if you have done it, skip it. ;-))

Before you apply the patches, configure the kernel based on the old one (it works, right?)

cd /usr/src/linux

make oldconfig (this will apply the old /boot/.config file to the new Makefile)

You may get questions about any new stuff in the kernel, it's generally best to follow the defaults, unless you recognise something.

You may require the dev packages to do this, but unless you want to customise it further, you can probably skip the config part. (make xconfig, or menuconfig)

make all && make modules_install && make install.

If all goes well you should be able to boot into the new kernel just by rebooting.

If you see errors, and make stops, post those here for us to check. Don't reboot if you get errors, it may break your system!

Generally there are warnings, but rarely do they compromise the system, they are just messages.

see how you go, regards Glenn

GlennsPref 07-02-2009 08:48 PM

Configuring flash...<edit>sorry I missed sneddy's post #16, he's not wrong. :-)</edit>
try to install nspluginwrapper (netscape-plugin-wrapper)
Where does the flash files live?
Code:

locate flash
....
/usr/lib/libflashplayer.so

Once you know where it is you can copy the flash files to where they are needed.
like... ~/.mozilla/../plugins
From somewhere @LQ
Quote:

Firefox Flash plugin fails to work on x86-64 architecture

Some users have reported that the Flash plugin that is installed
with Mandriva Linux 2008 Spring One and Powerpack fails to work on
the x86-64 versions of these editions. This is because the nspluginwrapper
wrapper program, which allows the 32-bit plugin to work with the 64-bit browser,
is looking in the wrong place to find the plugin. To work around this problem,
run the following command as root in terminal:

nspluginwrapper -i /usr/lib64/mozilla/plugins/libflashplayer.so

to confirm that it worked, you can run:

nspluginwrapper -l

and you should see the libflashplayer.so file in the resulting list.
Now re-start Firefox, and the Flash plugin should work.
you could try this script.
Code:

#!/bin/bash
#/usr/lib/flash-plugin/setup
# These are the standard browser locations as found within Red Hat, Mandrake
# and SuSE Linux, and the tarball installers.
LOCATIONS="/usr/lib64/mozilla /usr/lib64/mozilla-* /usr/lib64/firefox-* /usr/lib64/seamonkey-* /usr/lib64/netscape /usr/lib64/opera /usr/lib64/firefox /usr/lib/mozilla /usr/lib/mozilla-* /usr/lib/firefox-* /usr/lib/seamonkey-* /usr/lib/netscape /usr/lib/opera /usr/lib/firefox /usr/local/netscape /usr/local/mozilla /usr/local/firefox /usr/local/seamonkey /opt/mozilla /opt/netscape /opt/firefox /opt/seamonkey"

deleteold() {
# Detect, Backup and Delete old global Flash plugins
# Old plugin files are saved in /root/oldflashplugins.tar.gz
# tar and gzip must be installed
if [ ! -f /root/oldflashplugins.tar.gz ]; then
    FILES="libflashplayer.so ShockwaveFlash.class flashplayer.xpt libgnashplugin.so"
    for DIR in $LOCATIONS
    do
        # Skip symlinks
        if [ -h $DIR ]; then continue; fi

        for F in $FILES
        do
            # Add old plugin files to backup and delete lists
            if [ -f $DIR/plugins/$F ]
            then
                BACKUPLIST="$BACKUPLIST $DIR/plugins/$F"
                DELETELIST="$DELETELIST $DIR/plugins/$F"
            fi
            # Add symbolic links to the delete list
            if [ -h $DIR/plugins/$F ]
            then
                DELETELIST="$DELETELIST $DIR/plugins/$F"
            fi
        done
    done

    # Backup and Delete files if delete list contains files.
    if [ "x$DELETELIST" != "x" ]
    then
        # If tar is available, backup files
        tar --version >& /dev/null
        if [ $? -eq 0 ]; then
            tar cfz /root/oldflashplugins.tar.gz $BACKUPLIST >& /dev/null
            rm -f $DELETELIST
            echo
            echo "NOTICE:"
            echo "Files belonging to older Flash plugins have been removed from the filesystem.  For your safety these files have been saved in /root/oldflashplugins.tar.gz.  You may remove this tarball if these files are no longer required."
        else
            echo
            echo "Error: tar is unavailable."
            echo "Unable to backup old Flash plugin files.  They were deleted in order to prevent conflicts."
        fi
    fi
fi


# Remove /etc/flash.license as it is not used anymore
[ -f /etc/flash.license ] && rm -f /etc/flash.license
}

detectbrowsers() {
# Detect Mozilla plugin compatible browsers
for DIR in $LOCATIONS
do
    # Skip symlinks
    if [ -h $DIR ]; then continue; fi
    if [ -d $DIR/plugins ]; then export LIST="$LIST $DIR"; fi
done
}

link() {
# Link Mozilla plugin compatible browsers
for DIR in $LIST
do
    ln -sf /usr/lib/flash-plugin/libflashplayer.so $DIR/plugins/libflashplayer.so
    ln -sf /usr/lib64/flash-plugin/libflashplayer.so $DIR/plugins/libflashplayer.so
done
}

deletelinks() {
# Delete symlinks
# Remove Mozilla plugin compatible browsers
for DIR in $LIST
do
    rm -f $DIR/plugins/libflashplayer.so
done
}

#=======================
# Main Section
#=======================
# Pre-Uninstall
if [ "$1" = "preun" ]; then
    detectbrowsers
    deletelinks
    exit 0
fi

# Installation
if [ "$1" = "install" ]; then
    deleteold
    detectbrowsers
    link
    exit 0
fi

# Upgrade
if [ "$1" = "upgrade" ]; then
    detectbrowsers
    link
    exit 0
fi

# Manual Setup

detectbrowsers
link

There are quite a few possibilities of why and where it is installed.

I ended up making a script for my system, and I used to use it, but have not for a while.

It has clips of text from the install and debug info too.

Heaps of redundant/commented text (#)

first run...
locate libflashplayer.so && locate npflash.so
then edit this, changing the addresses to match your system.
libflashplayer-linking-script.sh
Code:

#! /bin/bash
echo "Flash Player 10.0 x86_64 Alpha"
locate libflashplayer.so && locate npflash.so
# door@MusicBox:~$ locate libflashplayer.so && locate npflash.so
# sorted list, by address....
# /home/door/.mozilla/plugins/libflashplayer.so
# /home/door/.mozilla/plugins/npflash.so
# /home/door/build/libflashplayer.so
# /home/door/build/npflash.so
# /root/.mozilla/plugins/libflashplayer.so
# /root/.mozilla/plugins/npflash.so
# /usr/lib/browser-plugins/libflashplayer.so
# /usr/lib/netscape/plugins/libflashplayer.so
# /usr/lib/flash-plugin/libflashplayer.so
# /usr/lib/flash-plugin/npflash.so
# /usr/lib/mozilla/plugins/libflashplayer.so
# /usr/lib/mozilla/plugins/npflash.so
# /usr/lib64/browser-plugins/libflashplayer.so
# /usr/lib64/browser-plugins/npflash.so
# /usr/lib64/flash-plugin/libflashplayer.so
# /usr/lib64/mozilla/plugins/libflashplayer.so
# /usr/lib64/mozilla/plugins/npwrapper.libflashplayer.so
# /usr/lib64/mozilla/plugins/npflash.so

echo "backup old libflashplayer files including npwrapper, if available...."
sudo cp /usr/lib/flash-plugin/libflashplayer.so /usr/lib/flash-plugin/libflashplayer.so.old
sudo cp /usr/lib/flash-plugin/npflash.so /usr/lib/flash-plugin/npflash.so.old
sudo cp /home/door/.mozilla/plugins/libflashplayer.so /home/door/.mozilla/plugins/libflashplayer.so.old
sudo cp /usr/lib/flash-plugin/npflash.so /usr/lib/flash-plugin/npflash.so.old

echo "uncomment when upgrading"
# sudo rm -rf /usr/lib/flash-plugin/libflashplayer.so
# sudo rm -rf /usr/lib/flash-plugin/npflash.so
# sudo rm -rf /usr/lib64/firefox 3.0.11/plugins/libflashplayer.so
# sudo rm -rf /usr/lib64/flash-plugin/npflash.so
# sudo rm -rf /usr/lib64/mozilla/plugins/libflashplayer.so
# sudo rm -rf /usr/lib64/flash-plugin/npflash.so
# sudo rm -rf /home/door/.mozilla/plugins/libflashplayer.so

echo "check dirs exist, if not make dir......"
sudo mkdir /usr/lib/flash-plugin
sudo mkdir /usr/lib64/flash-plugin
sudo mkdir /usr/lib64/browser-plugins
sudo mkdir /usr/lib/browser-plugins
sudo mkdir /usr/lib64/mozilla/plugins

# "Make sure you have unpacked the flash package to "
echo "The new files unpacked to ~/build, and copied to relevent dirs."
sudo cp /home/door/build/libflashplayer.so /usr/lib/browser-plugins/libflashplayer.so
sudo cp /home/door/build/libflashplayer.so /usr/lib64/flash-plugin/libflashplayer.so
sudo cp /home/door/build/libflashplayer.so /usr/lib/flash-plugin/libflashplayer.so
sudo cp /home/door/build/libflashplayer.so /usr/lib64/browser-plugins/libflashplayer.so
sudo cp /home/door/build/npflash.so /usr/lib/flash-plugin/npflash.so
sudo cp /home/door/build/npflash.so /usr/lib64/browser-plugins/npflash.so
sudo ln -s /usr/lib/flash-plugin/libflashplayer.so /home/door/.mozilla/plugins/libflashplayer.so
sudo ln -s /usr/lib/flash-plugin/npflash.so /home/door/.mozilla/plugins/npflash.so
sudo ln -s /usr/lib/flash-plugin/libflashplayer.so /usr/lib/mozilla/plugins/libflashplayer.so
sudo ln -s /usr/lib/flash-plugin/npflash.so /usr/lib/mozilla/plugins/npflash.so
sudo ln -s /usr/lib/flash-plugin/libflashplayer.so /usr/lib/netscape/plugins/libflashplayer.so
sudo ln -s /usr/lib/flash-plugin/npflash.so /usr/lib/netscape/plugins/npflash.so
sudo ln -s /usr/lib/flash-plugin/libflashplayer.so /usr/lib64/mozilla/plugins/libflashplayer.so
sudo ln -s /usr/lib/flash-plugin/npflash.so /usr/lib64/mozilla/plugins/npflash.so
sudo ln -s /usr/lib/flash-plugin/libflashplayer.so /root/.mozilla/plugins/libflashplayer.so
sudo ln -s /usr/lib/flash-plugin/npflash.so /root/.mozilla/plugins/npflash.so
echo "all done! check the text above for errors, ...."

updated...

full text, libflashplayer-linking-script.sh, this is for an older system,

but you may see what I mean.
Code:

#! /bin/bash
echo "Flash Player 10.0 x86_64 Alpha"
locate libflashplayer.so && locate npflash.so

# places
# root@GamesBox:~/bin# updatedb
# root@GamesBox:~/bin# locate npflash.so
# /home/glenn/.mozilla/plugins/npflash.so
# /home/glenn/build/npflash.so
# /usr/lib/flash-plugin/npflash.so
# /usr/lib/mozilla/plugins/npflash.so
# /usr/lib/netscape/plugins/npflash.so
# /usr/lib64/mozilla/plugins/npflash.so
# root@GamesBox:~/bin# locate libflashplayer.so
# /home/glenn/.mozilla/plugins/libflashplayer.so
# /home/glenn/build/libflashplayer.so
# /usr/lib/flash-plugin/libflashplayer.so
# /usr/lib/mozilla/plugins/libflashplayer.so
# /usr/lib/netscape/plugins/libflashplayer.so
# /usr/lib64/mozilla/plugins/libflashplayer.so
#
# rpm packages
# flash-player-plugin-10.0.22.87-1plf2009.1.i586.rpm        (7.3kb)
# flash-0.4.10-8mdk.i586.rpm                npflash.so        (198.9kb)
#sudo rpm -Uvh /home/glenn/local/Archive/2009.1/i586/flash-player-plugin-10.0.22.87-1plf2009.1.i586.rpm
#sudo rpm -Uvh /home/glenn/local/Archive/2009.1/i586/flash-0.4.10-8mdk.i586.rpm
# A pre-release version of Flash Player 10.0 for x86_64 is now available from Adobe Labs.
# To install it, copy libflashplayer.so to your 64 bit browser plugins directory
# (such as /usr/lib64/browser-plugins/).
# Note that this is alpha quality software, and is likely to have bugs.
# Reading the Release Notes is advised.
#
# Important! If you are using nspluginwrapper,
# be sure to remove any npwrapper.libflashplayer.so files that may be present on your system,
# as these are likely to conflict with the 64 bit plugin.
#
#
##/home/glenn/build/libflashplayer.so
##/home/glenn/build/npflash.so
#/usr/lib64/browser-plugins/

# (26-05 14:14)
# urpmi --noclean flash
# Package flash-0.4.10-8mdk.i586 is already installed                                                             
# glenn@GamesBox:~/bin$ urpmi --noclean flash-player
# The following package has to be removed for others to be upgraded:                                               
# FlashPlayer-9.0.31.0-1mde2007.0.i586                                                                             
#  (due to conflicts with flash-player-plugin-10.0.22.87-1plf2009.1.i586) (y/N) y                                 
# To satisfy dependencies, the following package is going to be installed:                                         
#    Package                        Version      Release      Arch                                               
# (medium "Local_2009.1-i586")                                                                                     
#  flash-player-plugin            10.0.22.87  1plf2009.1    i586                                                 
# 6.7MB of disk space will be freed.                                                                               
# 7.3KB of packages will be retrieved.                                                                             
# Proceed with the installation of one package? (Y/n)                                                             
#
#
# installing flash-player-plugin-10.0.22.87-1plf2009.1.i586.rpm from //home/glenn/local/Archive/2009.1/i586
# Preparing...                    ################################################################################
#      1/1: flash-player-plugin  ################################################################################
# removing package FlashPlayer-9.0.31.0-1mde2007.0.i586                                                           
# Note that by downloading the Adobe Flash Player you indicate your acceptance of                                 
# the EULA, available from http://www.adobe.com/products/eulas/players/flash/                                     
# Downloading from http://fpdownload.macromedia.com/get/flashplayer/current/flash-plugin-10.0.22.87-release.i386.rpm:
#  % Total    % Received % Xferd  Average Speed  Time    Time    Time  Current
#                                  Dload  Upload  Total  Spent    Left  Speed
# 100 3970k  100 3970k    0    0  188k      0  0:00:21  0:00:21 --:--:--  179k
# Installation successful.
# Install nspluginwrapper if you want to use the plugin with 64bit browsers too.
# glenn@GamesBox:~/bin$                                                                                (26-05 14:15)
# glenn@GamesBox:~/bin$ urpmi --noclean nspluginwrapper
# To satisfy dependencies, the following packages are going to be installed:
#    Package                        Version      Release      Arch
# (medium "2009.1-fis.unb.br_Main-Backports")
#  nspluginwrapper                1.3.0        1mdv2009.1    x86_64
#  nspluginwrapper-i386          1.3.0        1mdv2009.1    x86_64
# 384KB of additional disk space will be used.
# 151KB of packages will be retrieved.
# Proceed with the installation of the 2 packages? (Y/n)
#
#    http://mirror.fis.unb.br/pub/linux/MandrivaLinux/official/2009.1/x86_64/media/main/backports/nspluginwrapper-1.3.0-1mdv2009.1.x86_64.rpm
#    http://mirror.fis.unb.br/pub/linux/MandrivaLinux/official/2009.1/x86_64/media/main/backports/nspluginwrapper-i386-1.3.0-1mdv2009.1.x86_64.rpm
# installing nspluginwrapper-1.3.0-1mdv2009.1.x86_64.rpm nspluginwrapper-i386-1.3.0-1mdv2009.1.x86_64.rpm from /var/cache/urpmi/rpms
# Preparing...                    ################################################################################
#      1/2: nspluginwrapper-i386  ################################################################################
#      2/2: nspluginwrapper      ################################################################################
# Auto-install plugins from /usr/lib/mozilla/plugins
# Looking for plugins in /usr/lib/mozilla/plugins
# Install plugin /usr/lib/mozilla/plugins/npflash.so
#  into /usr/lib64/mozilla/plugins/npwrapper.npflash.so
# Install plugin /usr/lib/mozilla/plugins/libflashplayer.so
#  into /usr/lib64/mozilla/plugins/npwrapper.libflashplayer.so
# Auto-install plugins from /usr/lib64/mozilla/plugins
# Looking for plugins in /usr/lib64/mozilla/plugins
# Install plugin /usr/lib64/mozilla/plugins/npflash.so
#  into /usr/lib64/mozilla/plugins/npwrapper.npflash.so
# *** NSPlugin Viewer  *** ERROR: /usr/lib64/mozilla/plugins/libflashplayer.so: wrong ELF class: ELFCLASS64
# Auto-install plugins from /root/.mozilla/plugins
# Looking for plugins in /root/.mozilla/plugins
# nspluginwrapper: no appropriate viewer found for /usr/lib64/mozilla/plugins/libflashplayer.so
# nspluginwrapper: no appropriate viewer found for /usr/lib/flash-plugin/libflashplayer.so
# glenn@GamesBox:~/bin$                                                   


echo "backup old libflashplayer files including npwrapper, if available...."
sudo cp /usr/lib/flash-plugin/libflashplayer.so /usr/lib/flash-plugin/libflashplayer.so.old
sudo cp /home/glenn/.mozilla/plugins/libflashplayer.so
sudo cp /home/glenn/My_system/backup/GamesBox/home/glenn/.mozilla/plugins/npwrapper.libflashplayer.so

sudo rm -rf /usr/lib/flash-plugin/libflashplayer.so
sudo rm -rf /usr/lib64/firefox-3.0.8/plugins/libflashplayer.so
sudo rm -rf /usr/lib64/mozilla/plugins/libflashplayer.so

echo "check dirs exist, if not make dir......"
sudo mkdir /usr/lib/flash-plugin
sudo mkdir /usr/lib64/flash-plugin
sudo mkdir /usr/lib64/browser-plugins
sudo mkdir /usr/lib/browser-plugins


sudo cp /home/glenn/build/libflashplayer.so /usr/lib/browser-plugins/libflashplayer.so
sudo cp /home/glenn/build/libflashplayer.so /usr/lib64/flash-plugin/libflashplayer.so
sudo cp /home/glenn/build/libflashplayer.so /usr/lib/flash-plugin/libflashplayer.so
sudo cp /home/glenn/build/libflashplayer.so /usr/lib64/browser-plugins/libflashplayer.so
sudo cp /home/glenn/build/npflash.so /usr/lib/flash-plugin/npflash.so
sudo cp /home/glenn/build/npflash.so /usr/lib64/browser-plugins/npflash.so
sudo ln -s /usr/lib/flash-plugin/libflashplayer.so /home/glenn/.mozilla/plugins/libflashplayer.so
sudo ln -s /usr/lib/flash-plugin/npflash.so /home/glenn/.mozilla/plugins/npflash.so
sudo ln -s /usr/lib/flash-plugin/libflashplayer.so /usr/lib/mozilla/plugins/libflashplayer.so
sudo ln -s /usr/lib/flash-plugin/npflash.so /usr/lib/mozilla/plugins/npflash.so
sudo ln -s /usr/lib/flash-plugin/libflashplayer.so /usr/lib/netscape/plugins/libflashplayer.so
sudo ln -s /usr/lib/flash-plugin/npflash.so /usr/lib/netscape/plugins/npflash.so
sudo ln -s /usr/lib/flash-plugin/libflashplayer.so /usr/lib64/mozilla/plugins/libflashplayer.so
sudo ln -s /usr/lib/flash-plugin/npflash.so /usr/lib64/mozilla/plugins/npflash.so
sudo ln -s /usr/lib/flash-plugin/libflashplayer.so /root/.mozilla/plugins/libflashplayer.so
sudo ln -s /usr/lib/flash-plugin/npflash.so /root/.mozilla/plugins/npflash.so


see how you go.

Regards Glenn


All times are GMT -5. The time now is 04:15 PM.