DSL Ideas and Suggestions :: Install scripts for Opera 6.12



Hi all,

Below you will find install scripts for the Opera web browser. I chose version 6.12 because someone told me that Opera 7.x is bloated and runs slower.  If version 6.12 (static built on QT 3.x libraries) is also slow, I can create a script to install version 6.03 (static built on QT2.x libraries).

There are two scripts: ".start_opera" and ".install_opera"

Note the period "." in front of the file name. Both of these scripts are meant to be saved in the /home/damnsmall directory.  Copy and paste each script into a text editor and save them. Then, from an xterminal shell (rxvt), type 'chmod 755 .start_opera' and then press the ENTER key. Next type 'chmod 755 .install_opera' and then press the ENTER key.

To start or install Opera, type './.start_opera' and then press the ENTER key.  If Opera is not already installed, the script will then call the .install_opera script

The idea here is to add the .start_opera script to the Fluxbox Menu tree in future releases of DSL.  Please add reply to this
post to let me know if it works for you and whether or not you have a hard disk install or are using from the live CD.

Here are the scripts:


Code Sample
#!/bin/sh
#
# .start_opera - Checks to see if the Opera Web Browser is already installed
#                and starts it up. Otherwise, run the install script.
# Rev 0 11/22/03

# Check to see if Opera is already installed
if  test -f '/usr/bin/opera'
then
    /usr/bin/opera &
    exit
fi

# Otherwise, run the insall script as root
cd /home/damnsmall
rxvt -rv -T "installing Opera..." -e sudo -u root ./.install_opera
/usr/bin/opera
exit



Code Sample
#!/bin/sh
#
# .install_opera - Downloads and installs the Opera 6.12 Web Browser for a
#                  Damn Small Linux user.
# Rev 0 11/22/03

#
# First, create a /usr tree on the ramdisk if the user is running from
# the Damn Small Linux Live CD. Why? Because the default /usr tree is
# linked to the read-only CDROM file system and new files are not allowed.
# Lets create a REAL /usr tree structure on the ramdisk and add a bunch of
# Symlinks back to the CDROM for all of the files inside the old /usr tree.
ls -l /usr | grep 'KNOPPIX' > /tmp/loadrox.tmp
if  test -s '/tmp/loadrox.tmp'
then
    echo 'System is running from a Live CD compressed image filesystem. '
    echo 'Creating a writable /usr tree on the RAM Disk...'
    cp -srd /KNOPPIX/usr/ /ramdisk
    ln -sf --target-directory=/ /ramdisk/usr
fi
rm /tmp/loadrox.tmp

# Next, download, unpack and install the Opera 6.12 Linux Static binaries
echo 'Grabbing Opera 6.12 Static Binaries...'
wget -c http://arc.opera.com/pub/opera/linux/612/final/en/i386/static/opera-6.12-20030305.1-static-qt.i386.tar.gz
tar -zxvf opera-6.12-20030305.1-static-qt.i386.tar.gz
cd opera-6.12-20030305.1-static-qt.i386
echo $'yes\n' | sh ./install.sh -s
cd /home/damnsmall

# Next, download, unpack and install the Flash plugin.
echo 'Grabbing Flash plugin...'
wget -c http://download.macromedia.com/pub/shockwave/flash/english/linux/6.0r79/install_flash_player_6_linux.tar.gz
tar -zxvf install_flash_player_6_linux.tar.gz
cp install_flash_player_6_linux/libflashplayer.so /usr/lib/opera/plugins

# Next, download, unpack and install the Slackware 8.1 OpenMotif libraries.
echo 'Grabbing OpenMotif libraries...'
wget -c http://distro.ibiblio.org/pub/Linux/distributions/slackware/slackware-8.1/extra/openmotif-2.2.1/openmotif-2.2.1-i386-1.tgz
tar -zxvf openmotif-2.2.1-i386-1.tgz
sh ./install/doinst.sh

# Before running Opera, move the newly installed libraries into
# the main /usr tree.
cd /usr
cp -r --reply=yes /home/damnsmall/usr ../
cd /home/damnsmall

# Create symlink to shared library in /usr/lib
cd /usr/lib
ln -s /usr/X11R6/lib/libXm.so.2
cd /home/damnsmall

# Create Desktop Icon for Opera
echo 'table Icon' > /home/damnsmall/.xtdesktop/opera.lnk
echo '  Type: Program' >> /home/damnsmall/.xtdesktop/opera.lnk
echo '  Caption: Opera' >> /home/damnsmall/.xtdesktop/opera.lnk
echo '  Command: opera' >> /home/damnsmall/.xtdesktop/opera.lnk
echo '  Icon: /usr/share/opera/images/opera_32x32.png' >> /home/damnsmall/.xtdesktop/opera.lnk
echo '  X: 295' >> /home/damnsmall/.xtdesktop/opera.lnk
echo '  Y: 114' >> /home/damnsmall/.xtdesktop/opera.lnk
echo 'end' >> /home/damnsmall/.xtdesktop/opera.lnk
chown damnsmall:staff /home/damnsmall/.xtdesktop/opera.lnk

# Clean up some junk in the /home/damnsmall directory
rm -rf /home/damnsmall/install_flash_player_6_linux
rm -rf /home/damnsmall/opera-6.12-20030305.1-static-qt.i386
rm -rf /home/damnsmall/usr
rm -rf /home/damnsmall/install
rm -rf /home/damnsmall/opera-6.12-20030305.1-static-qt.i386.tar.gz
rm -rf /home/damnsmall/install_flash_player_6_linux.tar.gz
rm -rf /home/damnsmall/openmotif-2.2.1-i386-1.tgz

# Now tell the user how to start Opera
echo 'Opera installation is complete'
echo 'Please exit from the root shell and try it out.'
echo 'To run it from the command prompt, type this on a blank line:'
echo ''
echo '# opera'
echo ''
echo 'Or if you use Enhance, click on the new Opera desktop icon'
echo 'You may need to toggle between NO ICONS and ICONS to make'
echo 'the new desktop icon appear.'

Here is the fix for the Opera install script 'restore' bug that was discovered by Roberts. More details are explained in the Rox Filer script message thread. Please use the original .start_opera script that is already posted in this thread.

Replace the .install_opera script with this new version:

Code Sample
#!/bin/sh
#
# .install_opera - Downloads and installs the Opera 6.12 Web Browser for a
#                  Damn Small Linux user.
# Rev 1 11/24/03

#
# First, create a /usr tree on the ramdisk if the user is running from
# the Damn Small Linux Live CD. Why? Because the default /usr tree is
# linked to the read-only CDROM file system and new files are not allowed.
# Lets create a REAL /usr tree structure on the ramdisk and add a bunch of
# Symlinks back to the CDROM for all of the files inside the old /usr tree.
ls -l /usr | grep 'KNOPPIX' > /tmp/loadrox.tmp
if  test -s '/tmp/loadrox.tmp'
then
    echo 'System is running from a Live CD compressed image filesystem. '
    echo 'Creating a writable /usr tree on the RAM Disk...'
    cp -srd /KNOPPIX/usr/ /ramdisk
    ln -sf --target-directory=/ /ramdisk/usr
fi
rm /tmp/loadrox.tmp

# Next, download, unpack and install the Opera 6.12 Linux Static binaries
echo 'Grabbing Opera 6.12 Static Binaries...'
wget -c http://arc.opera.com/pub/opera/linux/612/final/en/i386/static/opera-6.12-20030305.1-static-qt.i386.tar.gz
tar -zxvf opera-6.12-20030305.1-static-qt.i386.tar.gz
cd opera-6.12-20030305.1-static-qt.i386
echo $'yes\n' | sh ./install.sh -s
cd /home/damnsmall

# Next, download, unpack and install the Flash plugin.
echo 'Grabbing Flash plugin...'
wget -c http://download.macromedia.com/pub/shockwave/flash/english/linux/6.0r79/install_flash_player_6_linux.tar.gz
tar -zxvf install_flash_player_6_linux.tar.gz
cp install_flash_player_6_linux/libflashplayer.so /usr/lib/opera/plugins

# Next, download, unpack and install the Slackware 8.1 OpenMotif libraries.
echo 'Grabbing OpenMotif libraries...'
wget -c http://distro.ibiblio.org/pub/Linux/distributions/slackware/slackware-8.1/extra/openmotif-2.2.1/openmotif-2.2.1-i386-1.tgz
tar -zxvf openmotif-2.2.1-i386-1.tgz
sh ./install/doinst.sh

# Before running Opera, move the newly installed libraries into
# the main /usr tree.
cd /usr
cp -r --reply=yes /home/damnsmall/usr ../
cd /home/damnsmall

# Create symlink to shared library in /usr/lib
cd /usr/lib
ln -s /usr/X11R6/lib/libXm.so.2
cd /home/damnsmall

# Create Desktop Icon for Opera
cp /usr/share/opera/images/opera_32x32.png /home/damnsmall/.xtdesktop/opera.png
echo 'table Icon' > /home/damnsmall/.xtdesktop/opera.lnk
echo '  Type: Program' >> /home/damnsmall/.xtdesktop/opera.lnk
echo '  Caption: Opera' >> /home/damnsmall/.xtdesktop/opera.lnk
echo '  Command: sh /home/damnsmall/.start_opera' >> /home/damnsmall/.xtdesktop/opera.lnk
echo '  Icon: /home/damnsmall/.xtdesktop/opera.png' >> /home/damnsmall/.xtdesktop/opera.lnk
echo '  X: 295' >> /home/damnsmall/.xtdesktop/opera.lnk
echo '  Y: 114' >> /home/damnsmall/.xtdesktop/opera.lnk
echo 'end' >> /home/damnsmall/.xtdesktop/opera.lnk
chown damnsmall:staff /home/damnsmall/.xtdesktop/opera.lnk
chown damnsmall:staff /home/damnsmall/.xtdesktop/opera.png

# Clean up some junk in the /home/damnsmall directory
rm -rf /home/damnsmall/install_flash_player_6_linux
rm -rf /home/damnsmall/opera-6.12-20030305.1-static-qt.i386
rm -rf /home/damnsmall/usr
rm -rf /home/damnsmall/install
rm -rf /home/damnsmall/opera-6.12-20030305.1-static-qt.i386.tar.gz
rm -rf /home/damnsmall/install_flash_player_6_linux.tar.gz
rm -rf /home/damnsmall/openmotif-2.2.1-i386-1.tgz

# Now tell the user how to start Opera
echo 'Opera installation is complete'
echo 'Please exit from the root shell and try it out.'
echo 'To run it from the command prompt, type this on a blank line:'
echo ''
echo '# opera'
echo ''
echo 'Or if you use Enhance, click on the new Opera desktop icon'
echo 'You may need to toggle between NO ICONS and ICONS to make'
echo 'the new desktop icon appear.'

I made one more improvement to the Opera Install Script.

The script no longer installs the entire OpenMotif libraries and associated junk. It only installs the shared object file that is needed by the Opera Plugin manager (libXm.so.2).

This change is especially important to LiveCD users because they only have a limited amount of Ramdisk space available and installing unneeded stuff is a waste of memory.

Replace your .install_opera script with the code below. You can still use the old .start_opera file:
Code Sample
#!/bin/sh
#
# .install_opera - Downloads and installs the Opera 6.12 Web Browser for a
#                  Damn Small Linux user.
# Rev 2 11/24/03

#
# First, create a /usr tree on the ramdisk if the user is running from
# the Damn Small Linux Live CD. Why? Because the default /usr tree is
# linked to the read-only CDROM file system and new files are not allowed.
# Lets create a REAL /usr tree structure on the ramdisk and add a bunch of
# Symlinks back to the CDROM for all of the files inside the old /usr tree.
ls -l /usr | grep 'KNOPPIX' > /tmp/loadrox.tmp
if  test -s '/tmp/loadrox.tmp'
then
    echo 'System is running from a Live CD compressed image filesystem. '
    echo 'Creating a writable /usr tree on the RAM Disk...'
    cp -srd /KNOPPIX/usr/ /ramdisk
    ln -sf --target-directory=/ /ramdisk/usr
fi
rm /tmp/loadrox.tmp

# Next, download, unpack and install the Opera 6.12 Linux Static binaries
echo 'Grabbing Opera 6.12 Static Binaries...'
wget -c http://arc.opera.com/pub/opera/linux/612/final/en/i386/static/opera-6.12-20030305.1-static-qt.i386.tar.gz
tar -zxvf opera-6.12-20030305.1-static-qt.i386.tar.gz
cd opera-6.12-20030305.1-static-qt.i386
echo $'yes\n' | sh ./install.sh -s
cd /home/damnsmall

# Next, download, unpack and install the Flash plugin.
echo 'Grabbing Flash plugin...'
wget -c http://download.macromedia.com/pub/shockwave/flash/english/linux/6.0r79/install_flash_player_6_linux.tar.gz
tar -zxvf install_flash_player_6_linux.tar.gz install_flash_player_6_linux/libflashplayer.so
cp install_flash_player_6_linux/libflashplayer.so /usr/lib/opera/plugins

# Next, download, unpack and install the Slackware 8.1 OpenMotif libraries.
echo 'Grabbing OpenMotif libraries...'
wget -c http://distro.ibiblio.org/pub/Linux/distributions/slackware/slackware-8.1/extra/openmotif-2.2.1/openmotif-2.2.1-i386-1.tgz
tar -zxvf openmotif-2.2.1-i386-1.tgz usr/X11R6/lib/libXm.so.2.2.1
cd usr/X11R6/lib/
ln -s libXm.so.2.2.1 libXm.so
ln -s libXm.so.2.2.1 libXm.so.2

# Before running Opera, move the newly installed libraries into
# the main /usr tree.
cd /usr
cp -r --reply=yes /home/damnsmall/usr ../
cd /home/damnsmall

# Create symlink to shared library in /usr/lib
cd /usr/lib
ln -s /usr/X11R6/lib/libXm.so.2
cd /home/damnsmall

# Create Desktop Icon for Opera
cp /usr/share/opera/images/opera_32x32.png /home/damnsmall/.xtdesktop/opera.png
echo 'table Icon' > /home/damnsmall/.xtdesktop/opera.lnk
echo '  Type: Program' >> /home/damnsmall/.xtdesktop/opera.lnk
echo '  Caption: Opera' >> /home/damnsmall/.xtdesktop/opera.lnk
echo '  Command: sh /home/damnsmall/.start_opera' >> /home/damnsmall/.xtdesktop/opera.lnk
echo '  Icon: /home/damnsmall/.xtdesktop/opera.png' >> /home/damnsmall/.xtdesktop/opera.lnk
echo '  X: 295' >> /home/damnsmall/.xtdesktop/opera.lnk
echo '  Y: 114' >> /home/damnsmall/.xtdesktop/opera.lnk
echo 'end' >> /home/damnsmall/.xtdesktop/opera.lnk
chown damnsmall:staff /home/damnsmall/.xtdesktop/opera.lnk
chown damnsmall:staff /home/damnsmall/.xtdesktop/opera.png

# Clean up some junk in the /home/damnsmall directory
rm -rf /home/damnsmall/install_flash_player_6_linux
rm -rf /home/damnsmall/opera-6.12-20030305.1-static-qt.i386
rm -rf /home/damnsmall/usr
rm -rf /home/damnsmall/opera-6.12-20030305.1-static-qt.i386.tar.gz
rm -rf /home/damnsmall/install_flash_player_6_linux.tar.gz
rm -rf /home/damnsmall/openmotif-2.2.1-i386-1.tgz

# Now tell the user how to start Opera
echo 'Opera installation is complete'
echo 'Please exit from the root shell and try it out.'
echo 'To run it from the command prompt, type this on a blank line:'
echo ''
echo '# opera'
echo ''
echo 'Or if you use Enhance, click on the new Opera desktop icon'
echo 'You may need to toggle between NO ICONS and ICONS to make'
echo 'the new desktop icon appear.'

Cbagger01,
Ok, you have asked for some feedback. Please don't take this as being too critical. This is what I was trying to do...
DSL runs very good on older and less capabale hardware. So, I recently "rescued" an old laptop from the "recycle bin". It has no hardrive and is a 233Mhz,32MB, floppy and CDROM. It runs DSL very good. Of course, I cannot load and run Firebird. But, having heard that Opera is much smaller I decided to give the Opera script a try. I used the very latest script thinking that maybe it would be even less in size requirements. The results...
The script would not get past the relinking phase of moving /usr to /ramdisk. Error messages of "no space left on device" kept scrolling by. Which is really not quite true. By moving /usr to /ramdisk is using many inodes. In fact that is what happened to the ramdisk.

total blocks 5273  4437 free   Seems like alot still avaiable
total inodes 3711       0 free   Here is the problem!

Therefore the system reports "no space left on device"

What are the requirements to try to install Opera? If opera is static, is it at all possible to modify the install Opera script to use /opt thereby eliminating the need to move the /usr and using up so many inodes? Moving /opt an empty dir would be easy, but would Opera? I leave that question up to you, our Opera script expert. Or if you think I am crazy for trying this, you can let me know that too.

Roberts,

Thanks for the information. I tried out the script on a Pentium 60 32MB RAM running against the liveCD and got the same results.  A solution for this INODES problem would be for the maintainer of DSL (John) to increase the number of INODES / MB disk space as part of the boot scipts. At the point where mkfs is run to create the /ramdisk (or /dev/shm), the "-i" switch should be added to the command line and a larger number of INODES per unit of disk space should be specified.

Anyways, I have gone ahead and modified the .start_opera and .install_opera scripts to no longer use the /usr tree for files. All of the files are now stored in the /home/damnsmall tree.

I know that this is a "non-standard" way to install software as opposed to other linux distributions, but DSL is also supposed to be a liveCD and therefore some things must be done differently. The other advantage of installing in the /home/damnsmall directory is that it allows the liveCD user to backup the entire installation to flash disk (minimum size 32MB) and bring it back to life during boot time using the "knoppix restore" function.

I had to figure out a way to install the Openmotif library libXM.so.2 to a location on the ramdisk (/home/damnsmall/lib). The Opera plugin manager is trying to find the file in the normal location /usr/lib or /lib, but these locations are located on the read-only compressed filesystem. Finally, I found that if you specify the new PATH in an environment variable (export LD_LIBRARY_PATH=/home/damnsmall/lib) the plugins will work correctly. However, this means that you MUST start Opera by using the .start_opera script or by clicking on the Desktop Icon. If you type "opera" on the command line, Opera will start but the plugins will not work correctly.

Next Page...
original here.