WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Google Chrome => GoogleChrome_getLatest.tcz  (Read 6119 times)

Offline xor

  • Hero Member
  • *****
  • Posts: 1262
Google Chrome => GoogleChrome_getLatest.tcz
« on: April 12, 2020, 11:16:59 PM »
Google Chrome => GoogleChrome_getLatest.tcz ( sample ; firefox_getlatest.tcz)

some internet pages only work properly with Google Chrome.

Offline andyj

  • Hero Member
  • *****
  • Posts: 1021
Re: Google Chrome => GoogleChrome_getLatest.tcz
« Reply #1 on: April 13, 2020, 06:00:24 AM »
I have a script that worked a few years ago to make a google-chrome extension, but it's not working now:

Code: [Select]
tc@box:/usr/local/google-chrome$ ./chrome
[8843:8843:0413/125249.710034:ERROR:browser_dm_token_storage_linux.cc(100)] Error: /etc/machine-id contains 0 characters (32 were expected).
Fontconfig error: Cannot load default config file: No such file: (null)
[8843:8843:0413/125249.806366:ERROR:edid_parser.cc(102)] Too short EDID data: manufacturer id
[8843:8869:0413/125249.853072:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[8843:8869:0413/125249.853145:ERROR:bus.cc(393)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
Trace/breakpoint trap

Also, Google no longer provides 32-bit chrome binaries for Linux. 64-bit only. Here's your chance to give to the community.

Offline neonix

  • Sr. Member
  • ****
  • Posts: 305
Re: Google Chrome => GoogleChrome_getLatest.tcz
« Reply #2 on: April 18, 2020, 09:58:59 PM »
Code: [Select]
Fontconfig error: Cannot load default config file: No such file: (null)
This can be solved by:
Code: [Select]
sudo ln -s /usr/local/etc/fonts/ /etc/or this script in /usr/local/tce.installed
Code: [Select]
#!/bin/sh
if [ ! -e /lib64 ]; then
        ln -s /lib /lib64
fi
if [ ! -h /etc/fonts ]; then
        ln -s /usr/local/etc/fontd /etc
fi
update-mime-database /usr/local/share/mime > /dev/null 2>&1
I'll be very happy if you create the extension.

Offline andyj

  • Hero Member
  • *****
  • Posts: 1021
Re: Google Chrome => GoogleChrome_getLatest.tcz
« Reply #3 on: April 19, 2020, 08:46:09 AM »
It's not a font problem because that isn't what's causing it to crash. Here's the full terminal output:

Code: [Select]
tc@box:~$ strace -f -o google-chrome.strace.log -s 254 google-chrome
[7416:7416:0419/150553.544599:ERROR:browser_dm_token_storage_linux.cc(100)] Error: /etc/machine-id contains 0 characters (32 were expected).
Fontconfig error: Cannot load default config file: No such file: (null)
[7416:7431:0419/150553.684207:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
[7416:7416:0419/150553.687025:ERROR:edid_parser.cc(102)] Too short EDID data: manufacturer id
MESA-LOADER: failed to retrieve device information
MESA-LOADER: failed to retrieve device information
MESA-LOADER: failed to retrieve device information
[7442:7468:0419/150554.665030:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[7442:7468:0419/150554.666190:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[7442:7468:0419/150554.667247:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[7442:7468:0419/150554.668281:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[7442:7468:0419/150554.669395:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[7442:7468:0419/150554.670471:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[7442:7468:0419/150554.671533:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[7442:7468:0419/150554.679102:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[7442:7468:0419/150554.680247:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[7442:7468:0419/150554.681262:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[7442:7468:0419/150554.682239:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[7442:7468:0419/150554.683424:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[7442:7468:0419/150554.684389:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[7442:7468:0419/150554.685399:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[7442:7468:0419/150554.686585:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[7442:7468:0419/150554.687766:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[7442:7468:0419/150554.688979:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
[7442:7468:0419/150554.695130:ERROR:gbm_wrapper.cc(271)] Failed to export buffer to dma_buf: No such file or directory (2)
Trace/breakpoint trap

I already ran strace and it didn't point to anything I could influence. Sorry, I'm not working on it any time soon. Also, at 111 MB it's really big.

Offline neonix

  • Sr. Member
  • ****
  • Posts: 305
Re: Google Chrome => GoogleChrome_getLatest.tcz
« Reply #4 on: April 19, 2020, 12:43:09 PM »
Andyj could you help me with this script. I don't know how to download google-chrome-stable_current_amd64.deb using wget from official chrome website?

script for TC11 (x86_64)
Code: [Select]
cd /tmp
mkdir /tmp/chrome
ar -x ./*.deb data.tar.xz | sudo tar fxJ data.tar.xz -C /tmp/chrome
sudo rm -rf data.tar.xz
sudo rm -rf google-chrome-stable_current_amd64.deb
cd /tmp/chrome/usr
sudo mkdir local
cd local
sudo mkdir tce.installed
cd tce.installed
tce-load -iw bash.tcz
sudo bash -c 'echo "#!/bin/sh" > chrome'
sudo bash -c 'echo "if [ ! -e /lib64 ]; then" >> chrome'
sudo bash -c 'echo "        ln -s /lib /lib64" >> chrome'
sudo bash -c 'echo "fi" >> chrome'
sudo bash -c 'echo "if [ ! -h /etc/fonts ]; then" >> chrome'
sudo bash -c 'echo "        ln -s /usr/local/etc/fonts /etc" >> chrome'
sudo bash -c 'echo "fi" >> chrome'
sudo bash -c 'echo "update-mime-database /usr/local/share/mime > /dev/null 2>&1" >> chrome'
sudo chown -R root:staff chrome
sudo chmod -R 775 chrome
cd ..
sudo mkdir share
cd share
sudo mkdir applications
cd applications
sudo bash -c 'echo "[Desktop Entry]" > chrome.desktop'
sudo bash -c 'echo "Name=chrome" >> chrome.desktop'
sudo bash -c 'echo "Exec=google-chrome-stable" >> chrome.desktop'
sudo bash -c 'echo "Icon=chrome" >> chrome.desktop'
sudo bash -c 'echo "Terminal=false" >> chrome.desktop'
sudo bash -c 'echo "X-FullPathIcon=/opt/google//chrome/product_logo_64.png" >> chrome.desktop'
sudo bash -c 'echo "Type=Application" >> chrome.desktop'
sudo bash -c 'echo "Categories=Network;WebBrowser;" >> chrome.desktop'
cd /tmp
tce-load -iw squashfs-tools.tcz
mksquashfs chrome chrome.tcz
sudo rm -rf /tmp/chrome

Offline andyj

  • Hero Member
  • *****
  • Posts: 1021
Re: Google Chrome => GoogleChrome_getLatest.tcz
« Reply #5 on: April 19, 2020, 09:35:01 PM »
Here's the script I wrote years ago. It once made a working extension. I've updated it to make an extension on TC-11, but as you already know chrome won't run. I used the rpm instead of the deb file.

Code: [Select]
#!/bin/sh -xv
#
TCZNAME="google-chrome"
TCZPATH="https://dl.google.com/linux/direct"
TCZFILE="google-chrome-stable_current_x86_64.rpm"

if [ $(/usr/bin/id -u) = 0 ]; then
  echo "Don't run as root."
  exit 1
else
  echo "Warning: This extension must be built by the user who will run chrome for sandboxing to work."
fi

### load require extensions

for a in wget squashfs-tools; do
  tce-load -i "$a" || tce-load -iwl "$a" || exit 1
done

### create extension working directories

TCZROOT=$(pwd)/tmp/"$TCZNAME"
sudo rm -rf "$TCZROOT"
TCZ="$TCZROOT"/TCZ
mkdir -p "$TCZ"

### get extension archive

cd "$TCZ"
$(which wget) -q --no-check-certificate "$TCZPATH"/"$TCZFILE"
SDIR=$(pwd)
cd "$TCZ"
rpm2cpio "$SDIR"/"$TCZFILE" | cpio -i -d || exit 1

### fixup directory tree

rm -rf etc
mkdir -p "$TCZ"/usr/local/tce.installed
mv opt/google/chrome "$TCZ"/usr/local/"$TCZNAME"
rm -rf opt
mkdir -p "$TCZ"/usr/local/share/applications

### fix paths in files

cd "$TCZ"/usr/share/applications
for a in google-chrome.desktop; do
  sed -e "s#usr/bin/google-chrome-stable#usr/local/$TCZNAME/google-chrome#" "$a" \
> "$TCZ"/usr/local/share/applications/"$TCZNAME".desktop
done

cd "$TCZ"/usr/local/"$TCZNAME"
for a in default-app-block; do
  sed -i -e "s#usr/bin/google-chrome-stable#usr/local/$TCZNAME#g" "$a"
done

cat >"$TCZNAME" <<'EOF'
#!/bin/sh
#
# Let the wrapped binary know that it has been run through the wrapper.
export CHROME_WRAPPER="$(readlink -f "$0")"
HERE="$(dirname "$CHROME_WRAPPER")"
# Always use our versions of ffmpeg libs.
[ -n "$LD_LIBRARY_PATH" ] && LD_LIBRARY_PATH="$HERE:$HERE/lib:$LD_LIBRARY_PATH" || LD_LIBRARY_PATH="$HERE:$HERE/lib"
export LD_LIBRARY_PATH
export CHROME_VERSION_TCZRA="stable"
exec "$HERE/chrome" "$@"
EOF

### fix path for sandbox

sed -i -e "/^exec /i \
export CHROME_DEVEL_SANDBOX=/usr/local/$TCZNAME/chrome-sandbox" "$TCZNAME"

### move icons

mkdir -p "$TCZ"/usr/local/share/pixmaps
cd "$TCZ"/usr/local/"$TCZNAME"
for a in product_logo_*.xpm; do
  mv "$a" "$TCZ"/usr/local/share/pixmaps/"$(echo "$a" | sed -e "s/product_logo_/$TCZNAME-/")"
done
for a in product_logo_*.png; do
  P="${a//[^0-9]/}"
  IDIR="$TCZ"/usr/local/share/icons/hicolor/${P}x${P}/apps
  mkdir -p "$IDIR"
  mv "$a" "$IDIR"/"$TCZNAME".png
done

### create desktop file for wbar

sed -i -e "/Icon=/a \
X-FullPathIcon=/usr/local/share/icons/hicolor/48x48/apps/$TCZNAME.png" \
"$TCZ"/usr/local/share/applications/"$TCZNAME".desktop
rm -rf "$TCZ"/usr/share
rm -rf "$TCZ"/usr/bin

### create extension load script

cd "$TCZ"/usr/local/tce.installed
cat >"$TCZNAME" <<EOF
#!/bin/sh
#
mkdir /lib64                                                                                   
ln -s -f /lib/ld-2.30.so /lib64/ld-linux-x86-64.so.2                                           
ln -s -f /lib/ld-2.30.so /lib64/ld-lsb-x86-64.so.3                                                 
cd /usr/local/bin
ln -s "/usr/local/$TCZNAME/$TCZNAME" "$TCZNAME"
cd "/usr/local/$TCZNAME"
EOF
cat >>"$TCZ"/usr/local/tce.installed/"$TCZNAME" <<'EOF'
SAND="$(readlink -f chrome-sandbox)"
rm chrome-sandbox
cp "$SAND" chrome-sandbox
chmod 4755 chrome-sandbox
EOF

### set ownership and permissions

sudo chown -R root:root "$TCZ"
sudo chown $USER "$TCZ"/usr/local/"$TCZNAME"/chrome
sudo chmod 4755 "$TCZ"/usr/local/"$TCZNAME"/chrome-sandbox
sudo chgrp -R staff "$TCZ"/usr/local/tce.installed
sudo chmod -R 775 "$TCZ"/usr/local/tce.installed

### make extension

cd "$TCZROOT"
mksquashfs "$TCZ" "$TCZNAME".tcz -noappend
cat >"$TCZNAME".tcz.dep <<EOF
Xorg-7.7.tcz
alsa.tcz
libcups.tcz
nss.tcz
dbus-glib.tcz
EOF

I looked at your script. You should read up on heredocs.

Offline neonix

  • Sr. Member
  • ****
  • Posts: 305
Re: Google Chrome => GoogleChrome_getLatest.tcz
« Reply #6 on: April 20, 2020, 03:08:18 AM »
Here's the script I wrote years ago. It once made a working extension. I've updated it to make an extension on TC-11, but as you already know chrome won't run. I used the rpm instead of the deb file.

I was able to run chrome.tcz with my script in TC11 (x86_64) with Xvesa and jwm. In your case chrome produce many errors but dbus, for example, is not required to run Google Blink based engine browsers. Vivaldi browser, and Opera 62 has the same problem, but there are working versions in the TC11 (x86_64) repo.

Your script also install chrome in /usr/local/, this may give some problems.
« Last Edit: April 20, 2020, 03:15:01 AM by neonix »

Offline andyj

  • Hero Member
  • *****
  • Posts: 1021
Re: Google Chrome => GoogleChrome_getLatest.tcz
« Reply #7 on: April 20, 2020, 05:40:22 AM »
By default chrome will install in /opt. Also by default everything in /opt will be saved in mydata.tgz, which would make for a really big backup file and long time waiting for the backup to finish. This is why I moved the chrome extension to /usr/local. As I recall the tricky part was getting sandboxing to work correctly.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11213
Re: Google Chrome => GoogleChrome_getLatest.tcz
« Reply #8 on: April 20, 2020, 06:10:09 AM »
Hi andyj
By default chrome will install in /opt. ...
While it may not be the norm, there's nothing that prevents you from building an extension that lives in  /opt. For example, if Chrome
wants to install itself in  /opt/Chrome/usr/local/......  then:
Code: [Select]
cd /opt
mksquashfs Chrome chrome.tcz

Quote
... Also by default everything in /opt will be saved in mydata.tgz, which would make for a really big backup file and long time waiting for the backup to finish. This is why I moved the chrome extension to /usr/local. ...
Then add  opt/Chrome  to the  /opt/.xfiletool.lst  file so it doesn't get backed up.

Or if Chrome saves settings under  /opt , then replace the blanket  opt  line in  .filetool.lst  with more specific targets.

Offline andyj

  • Hero Member
  • *****
  • Posts: 1021
Re: Google Chrome => GoogleChrome_getLatest.tcz
« Reply #9 on: April 20, 2020, 09:40:39 AM »
Yes, nothing says you can't put an extension in /opt. I'm just saying it's not a good idea unless you have to. I'm pretty sure /usr/local is the preferred location when possible. I have an extension for the MS Sql Server ODBC driver for Linux which installs into /opt because the paths are hard coded in the binaries from Microsoft. Yes, I checked with the strings command. Given where files on a typical C: drive can wind up it's no surprise that they think nothing of filesystem management. In this case it serves as an example of why making a tcz that requires /opt should be avoided if possible. An extension that requires manually editing /opt/.xfiletool.lst is probably not for the masses. That's one of the reasons I haven't submitted my msodbcsql.tcz extension. As for chrome settings, fortunately they get saved in the user home dir.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11213
Re: Google Chrome => GoogleChrome_getLatest.tcz
« Reply #10 on: April 20, 2020, 11:50:18 AM »
Hi andyj
Agree, agree, and agree. :)

...  I'm just saying it's not a good idea unless you have to. ...
I was just implying if an extension is causing you grief, you may have to (or want to). Sometimes you gotta do what you gotta do.

If I remember correctly, when Jason W was producing  SCEs (Self Contained Extensions), they were installed in  /opt.

Offline andyj

  • Hero Member
  • *****
  • Posts: 1021
Re: Google Chrome => GoogleChrome_getLatest.tcz
« Reply #11 on: April 20, 2020, 12:28:52 PM »
Sometimes you gotta do what you gotta do.

Yes, especially when dealing with this one particular vendor  ::)
... MS Sql Server ODBC driver for Linux which installs into /opt because the paths are hard coded in the binaries ...
I just wish for once they didn't feel the need to make it so painful.

Offline xor

  • Hero Member
  • *****
  • Posts: 1262
Re: Google Chrome => GoogleChrome_getLatest.tcz
« Reply #12 on: May 07, 2020, 02:06:41 AM »
Is the problem overcome!?
or why can't the problem be overcome?

Offline andyj

  • Hero Member
  • *****
  • Posts: 1021
Re: Google Chrome => GoogleChrome_getLatest.tcz
« Reply #13 on: May 07, 2020, 05:29:37 AM »
I have not worked on it since my previous post. I would not expect that to change any time soon.

Offline neonix

  • Sr. Member
  • ****
  • Posts: 305
Re: Google Chrome => GoogleChrome_getLatest.tcz
« Reply #14 on: August 09, 2020, 10:14:49 AM »
Is the problem overcome!?
or why can't the problem be overcome?
I think it's not possible to create getLastest extension because Google has changed the way how to download deb or rpm package. If you want Chrome on Tinycore you have to download it itself and don't install it in /usr/local because it won't work in this directory.