Google Chrome 15 (x86)

This section is designed for your 'porteus build scripts' which create Porteus modules for your favorite applications. Scripts should work like the well-known 'SlackBuilds' with minimum user interaction.
Post Reply
User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Google Chrome 15 (x86)

Post#1 by Hamza » 02 Feb 2011, 17:02

Here's a script to build a module for the Google Chrome web browser!

Code: Select all

#!/bin/bash

# SRC = Source Link
# TMP = /tmp/$NAME folder
# TMP_SRC = /tmp/$NAME-src


SRC=http://repository.slacky.eu/slackware-13.37/network/google-chrome/15.0.874.106/google-chrome-15.0.874.106-i386-1sl.txz
DEP_1=http://repository.slacky.eu/slackware-13.37/libraries/gconfmm/2.28.2/gconfmm-2.28.2-i486-3sl.txz
DEP_3=http://repository.slacky.eu/slackware-13.37/libraries/libsigc++/2.2.9/libsigc++-2.2.9-i486-1sl.txz
DEP_4=http://repository.slacky.eu/slackware-13.37/libraries/glibmm/2.27.99.2/glibmm-2.27.99.2-i486-1sl.txz
DEP_2=http://carroll.cac.psu.edu/pub/linux/distributions/slackware/slackware-13.37/extra/google-chrome/google-chrome-pam-solibs-1.1.3-i486-1.txz
NAME='Google Chrome'
F_NAME=Google-Chrome
TMP=/tmp/$F_NAME
TMP_SRC=/tmp/$F_NAME-src
F_32=$TMP_SRC/google-chrome-15.0.874.106-i386-1sl.txz
DP_1=$TMP_SRC/gconfmm-2.28.2-i486-3sl.txz
DP_2=$TMP_SRC/libsigc++-2.2.9-i486-1sl.txz
DP_3=$TMP_SRC/glibmm-2.27.99.2-i486-1sl.txz
DP_4=$TMP_SRC/google-chrome-pam-solibs-1.1.3-i486-1.txz
CPU=`uname -m`
CWD=`pwd`
D_LAST=$TMP_SRC/chrome
WRK=$CWD/$F_NAME-$CPU.lzm

#Functions

mkfolder () {
if [ -e $1 ]; then
rm -Rf $1
else
mkdir $1
fi }

progressbar () {
# Set wget for display the progress bar only

    local flag=false c count cr=$'\r' nl=$'\n'
    while IFS='' read -d '' -rn 1 c
    do
        if $flag
        then
            printf '%c' "$c"
        else
            if [[ $c != $cr && $c != $nl ]]
            then
                count=0
            else
                ((count++))
                if ((count > 1))
                then
                    flag=true
                fi
            fi
        fi
    done
}

download () {
# Download with progressbar function

wget --progress=bar:force $1 2>&1 | progressbar

}

txz2xzm () {
# Convert Slackware's Pkgs in Porteus modules
PATH=.:$(dirname $0):/usr/lib:$PATH
. liblinuxlive || exit 1

TMPDIR=/tmp/txz2xzm$$

installpkg -root $TMPDIR $1
if [ $? != 0 ]; then echo "error installing $NAME"; exit; fi

# optimalization procedures, this doesn't hurt
find $TMPDIR/usr{/local,/}{man,info} -type l -name "*.gz" 2>/dev/null | xargs -r gunzip -f
find $TMPDIR/usr{/local,/}{man,info} -type f -name "*.gz" 2>/dev/null | xargs -r gunzip
rm -f $TMPDIR/{usr,usr/local,var}/man/cat*/*
rm -f $TMPDIR/install > /dev/null 2>&1

mksquashfs $TMPDIR "$2" -b 256K
if [ $? != 0 ]; then echo "error building $NAME"; exit; fi

rm -Rf $TMPDIR

}

dir2xzm () {
# Compress directory in module
PATH=.:$(dirname $0):/usr/lib:$PATH
. liblinuxlive || exit 1

if [ ! -d "$1" -o "$2" = "" ]; then
   echo
   echo "Convert directory tree into .xzm compressed module"
   echo "usage: $0 source_directory output_file.xzm"
   exit 1
fi

create_module "$1" "$2"
if [ $? != 0 ]; then echo "error building compressed image"; exit 1; fi

}

xzm2dir () {
# Unpack module in directory
if [ ! -d "$2" ]; then
   echo 
   echo "Convert .xzm compressed module back into directory tree"
   echo "usage: $0 source_file.xzm existing_output_directory"
   exit 1
fi

PATH=.:$(dirname $0):/usr/lib:$PATH
. liblinuxlive || exit 1

unsquashfs -f -dest "$2" "$1"
}

cleaner () {

# Cleanning of the system
if [ -d $TMP ]; then 
rm -Rf $TMP
fi

if [ -d $TMP_SRC ]; then 
rm -Rf $TMP_SRC
fi

if [ -d /tmp/$F_NAME-merged ]; then 
rm -Rf /tmp/$F_NAME-merged
fi
}


echo "What is your name ?"
read builder
if [ "$builder" = "" ]; then
builder=porteus
fi

CPU=`uname -m`
VER_APP=12.0.742.91


CWD=`pwd`
F_LAST=$CWD/${F_NAME}-$VER_APP-1$builder.xzm
LOG_XZM=$CWD/${F_NAME}-$VER_APP-1$builder.log


clear
echo "===============> PORTEUS <==============="
echo
echo "Welcome to $NAME Installer for Porteus"
echo "Press any key to begin the installation"
read

clear

echo "Downloading...."
cleaner
mkfolder $TMP
mkfolder $TMP_SRC
cd $TMP_SRC

download $SRC
download $DEP_1
download $DEP_2
download $DEP_3
download $DEP_4



checker () {
if [ -e "$1" ]; then
echo $1 : OK
else 
echo $1 : Failed
exit
fi

}

echo "Checking of files..."
checker $F_32
checker $DP_1
checker $DP_2
checker $DP_3
checker $DP_4


echo "Preparing of $NAME..."
mkdir /tmp/${F_NAME}-merged
cd $TMP_SRC
for x in `ls *.t?z`; do installpkg -root /tmp/$F_NAME-merged $x; done


clear
if [ -d /tmp/$F_NAME-merged ]; then
echo "Building the module..."
echo "Type your block size for compression of the module OR press ENTER"
echo "Block Sizes available :"
echo "64K"
echo "128K"
echo "256K"
echo "512K"
echo "1024K"
echo "Type your block size : "
read B_SIZE
if [ "$B_SIZE" != "" ]; then
if [ -e $F_LAST ]; then 
rm -Rf $F_LAST
fi
mksquashfs /tmp/$F_NAME-merged $F_LAST -b $B_SIZE
else
if [ -e $F_LAST ]; then 
rm -Rf $F_LAST
fi
mksquashfs /tmp/$F_NAME-merged $F_LAST -b 256K
fi
else
echo "Build failed!"
fi


clear

if [ -e "$F_LAST" ]; then
echo "===============> PORTEUS <==============="
echo "Your module $NAME is ready!"
echo "Thanks to the Porteus Community!"
echo "-----------------------------------------"
echo "Your module is saved in the folder $CWD"
echo "-----------------------------------------"
echo "Cleaning the system..."
rm -Rf $TMP
rm -Rf $TMP_SRC
if [ -e $LOG_XZM ]; then rm -Rf $LOG_XZM
fi
touch $LOG_XZM
LOG_PKGS=`cd /tmp/$F_NAME-merged/var/log/packages && ls -1`
touch $LOG_XZM
echo '=====> Compiled on Porteus <=====' >> $LOG_XZM
echo 'Compiled with success' >> $LOG_XZM
echo 'App: '$NAME >> $LOG_XZM
echo '=== Version ===' >> $LOG_XZM
echo $VER_APP >> $LOG_XZM
echo '=== Name of Builder ===' >> $LOG_XZM
echo $builder >> $LOG_XZM
echo '=== Included Packages ===' >> $LOG_XZM
echo $LOG_PKGS >> $LOG_XZM 
echo '=== Settings ===' >> $LOG_XZM
echo '$TMP: '$TMP >> $LOG_XZM
echo 'TMP_SRC: '$TMP_SRC >> $LOG_XZM
echo '=== CPU ===' >> $LOG_XZM
echo $CPU >> $LOG_XZM
echo '==== Support Details ====' >> $LOG_XZM
echo $MCH_FULL >> $LOG_XZM
rm -Rf /tmp/${F_NAME}-merged
else
   clear
   echo "Build failed!"
   echo "Please report this bug to the Porteus Forum!"
echo "Do you make a log?"
read ans_log
if [ "$ans_log" = "y" ]; then
LOG_PKGS=`cd /tmp/$F_NAME-merged/var/log/packages && ls -1`
touch $LOG_XZM
echo '=====> Compiled on Porteus <=====' >> $LOG_XZM
echo 'Compiled without success' >> $LOG_XZM
echo 'App: '$NAME >> $LOG_XZM
echo '=== Version ===' >> $LOG_XZM
echo $VER_APP >> $LOG_XZM
echo '=== Name of Builder ===' >> $LOG_XZM
echo $builder >> $LOG_XZM
echo '=== Included Packages ===' >> $LOG_XZM
echo $LOG_PKGS >> $LOG_XZM 
echo '=== Settings ===' >> $LOG_XZM
echo '$TMP: '$TMP >> $LOG_XZM
echo 'TMP_SRC: '$TMP_SRC >> $LOG_XZM
echo '=== CPU ===' >> $LOG_XZM
echo $CPU >> $LOG_XZM
echo '==== Support Details ====' >> $LOG_XZM
echo $MCH_FULL >> $LOG_XZM

   echo "Cleaning the system"
   cleaner
   rm -Rf /tmp/${F_NAME}-merged
fi
fi
Enjoy !
Last edited by Hamza on 23 Nov 2011, 11:24, edited 3 times in total.
NjVFQzY2Rg==

User avatar
Btown
White ninja
White ninja
Posts: 12
Joined: 27 Jan 2011, 06:33
Location: Australia

Re: Google Chrome 8

Post#2 by Btown » 02 Feb 2011, 17:35

@karis
out of curiosity have you dismantle slackyd? i think instead of manually "http individual .txz" for source n dep it automatically "wget" it.

Anyway will try to dismanle it tomorrow as it is almost 1 am in jkt.
Portable n flexible ~ My kind of OS

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Google Chrome 8

Post#3 by Hamza » 02 Feb 2011, 17:36

Yes , it download all packages necessary for Google Chrome with wget

Regards,
NjVFQzY2Rg==

rnport
Black ninja
Black ninja
Posts: 98
Joined: 01 May 2011, 00:55

Re: Google Chrome 8

Post#4 by rnport » 18 May 2011, 03:21

Can the script be modified to get latest google-chrome-stable ?

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Google Chrome 8

Post#5 by Hamza » 18 May 2011, 04:38

Yes, It will be modified when the final will be out.
NjVFQzY2Rg==

rnport
Black ninja
Black ninja
Posts: 98
Joined: 01 May 2011, 00:55

Re: Google Chrome 8

Post#6 by rnport » 18 May 2011, 05:38

Great work.

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Google Chrome 12 (x86)

Post#7 by Hamza » 21 Jul 2011, 13:01

Updated for Porteus V1.0
NjVFQzY2Rg==

Virii
White ninja
White ninja
Posts: 15
Joined: 22 Sep 2011, 12:44
Location: Somewhere

Re: Google Chrome 12 (x86)

Post#8 by Virii » 28 Sep 2011, 14:22

This doesn't work for me, and just drops me back to the prompt after failing.

http://pastebin.com/1viP4xEr

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Google Chrome 12 (x86)

Post#9 by Hamza » 28 Sep 2011, 16:37

That is not a script's issue.
There is only a new version of Google Chrome available and the old one has been removed from slacky's servers.

I updated the script with new version link.
NjVFQzY2Rg==

Virii
White ninja
White ninja
Posts: 15
Joined: 22 Sep 2011, 12:44
Location: Somewhere

Re: Google Chrome 12 (x86)

Post#10 by Virii » 30 Sep 2011, 01:31

It's a no-go, but I suppose I could try chromium if it's dependencies aren't humongous.

http://pastebin.com/cv4TH9wJ

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Google Chrome 12 (x86)

Post#11 by Hamza » 30 Sep 2011, 15:43

Try Again, and let me know if doesn't works again.

Ciao!
NjVFQzY2Rg==

Virii
White ninja
White ninja
Posts: 15
Joined: 22 Sep 2011, 12:44
Location: Somewhere

Re: Google Chrome 12 (x86)

Post#12 by Virii » 30 Sep 2011, 22:50

Well... this time the script created a module that is usable with some post-install modifications. I'd say that all problems relate to path, or permissions.

Here's the rundown in the order they need to be overcome.

Problem #1;

Code: Select all

/opt/google/chrome/google-chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
This effects normal, and root users obviously. I installed the default Porteus v1.0 firefox module for the missing lib(s).

Problem #2;

Code: Select all

[2765:2765:192102115:FATAL:zygote_host_linux.cc(133)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /opt/google/chrome/chrome-sandbox is mode 4755 and owned by root.
This is corrected by the command 'chmod 4755 /opt/google/chrome/chrome-sandbox', which requires root privileges. At this point root users can run Chrome.

Problem #3;

Code: Select all

[2821:2834:258374406:ERROR:shared_memory_posix.cc(172)] Creating shared memory in /dev/shm/.com.google.Chrome.bHI8hx failed: Permission denied
[2821:2834:258374829:ERROR:shared_memory_posix.cc(175)] Unable to access(W_OK|X_OK) /dev/shm: Permission denied
[2821:2834:258374872:FATAL:shared_memory_posix.cc(177)] This is frequently caused by incorrect permissions on /dev/shm.  Try 'sudo chmod 1777 /dev/shm' to fix.
This problem only effects normal users (guest), and is an additional step past what root users need. Open a terminal, su, enter your password, and run the following command 'chmod 1777 /dev/shm'. Chrome will now run.


Problem #4;

Code: Select all

[2891:2891:309084028:ERROR:browser_main.cc(1022)] Gtk: Unable to locate theme engine in module_path: "clearlooks",
[2891:2891:309084723:ERROR:browser_main.cc(1022)] Gtk: Unable to locate theme engine in module_path: "clearlooks",
[2891:2891:309085895:ERROR:browser_main.cc(1022)] Gtk: Unable to locate theme engine in module_path: "clearlooks",
[2891:2891:309098971:ERROR:browser_main.cc(1022)] Gtk: Unable to locate theme engine in module_path: "mist",
[2891:2909:314942879:ERROR:nss_util.cc(419)] Error initializing NSS with a persistent database (sql:/home/guest/.pki/nssdb): libsoftokn3.so: cannot open shared object file: No such file or directory
[2891:2909:314943209:ERROR:nss_util.cc(428)] Error initializing NSS without a persistent database: NSS error code: -5925
I'm not sure if any of the errors past not finding the themes is important, so I've included this output from Chrome once it's run. It appears to have a missing library of some sort.

Problem #5;

This is not exactly a problem per say, but one of completeness. The generated XZM module doesn't use the standard paths, has no menu entries/icons setup, and instead ends up in the '/opt/google/chrome' directory. There isn't a symlinks/script extracted to the '/usr/bin' folder to call the '/opt/google/chrome/google-chrome' file. I simply created a script for myself, which works for now.

Root user only;

Code: Select all

#!/bin/bash
# 

chmod 4755 /opt/google/chrome/chrome-sandbox
cd /opt/google/chrome/
./google-chrome --user-data-dir=$HOME/.config/google-chrome/
I made the file executable via chmod, named it chrome, and dropped it into my '/porteus/rootcopy/usr/local/bin/' directory.

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Google Chrome 12 (x86)

Post#13 by Hamza » 01 Oct 2011, 08:48

libsoftokn3.so: cannot open shared object file: No such file or directory
For missing dep,
Try to install this lib

All others problems are related to Google Chrome's package and not my script.

Good Job! :)
NjVFQzY2Rg==

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Google Chrome 15 (x86)

Post#14 by Hamza » 23 Nov 2011, 11:25

Updated to 15.
NjVFQzY2Rg==

Post Reply