Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 08 Dec 2019, 05:37
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Browsers and Internet
'True' Chrome / Chromium portable is a no-no.....
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [10 Posts]  
Author Message
Mike Walsh


Joined: 28 Jun 2014
Posts: 5635
Location: King's Lynn, UK.

PostPosted: Sat 12 Oct 2019, 12:31    Post subject:  'True' Chrome / Chromium portable is a no-no.....
Subject description: Linux hard-coding makes it impossible
 

Afternoon, all.

Well, I know now I'm wasting my time trying to create a 'true' portable package of any Chromium 'clone'.

I've done several portable Mozilla builds, taking my cue from Fred. Not only will these allow keeping absolutely everything inside a single directory, we've discovered that they'll also support running dependencies, and even the glibc itself, from within that same directory.

I've been poking around in the murky depths of the Chromium Project this afternoon. The site's an absolute sodding nightmare to navigate around, but essentially I've learnt that the Linux version of the browser is hard-coded, at build-time, to always look for core dependencies & stuff in system paths only, and to ignore any attempts at re-directs.

Explains why my attempts over this last year or so at creating a 'portable' version of my favourite Iron browser have met with abject failure!

I know Shinobar, HoerMirAuf, and others, have created what they've called 'portable' versions of Chrome.....but in Puppy parlance, what that refers to is anything outside of the save-file/folder. The browser still creates a config directory in /root, and looks for core deps, etc, in /lib and /usr/lib.

Windows builds, naturally, are coded to be far more flexible at build-time, hence why Chromium-portable from PortableApps.com is a reality.....and the dream of something similar for Linux remains just that; a 'dream'.

Never mind. I know now I'm attempting the impossible. Laughing Laughing


Mike. Wink

_________________
MY 'PUPPY' PACKAGES

Back to top
View user's profile Send private message 
Moose On The Loose


Joined: 24 Feb 2011
Posts: 833

PostPosted: Sat 12 Oct 2019, 13:32    Post subject: Re: 'True' Chrome / Chromium portable is a no-no.....
Subject description: Linux hard-coding makes it impossible
 

Mike Walsh wrote:
Afternoon, all.

Well, I know now I'm wasting my time trying to create a 'true' portable package of any Chromium 'clone'.


How about a partial solution:
Put all the stuff on the hard drive.
Put links in the places Chrome looks.
If that works, maybe you can make a script that does all the links.
Back to top
View user's profile Send private message 
Mike Walsh


Joined: 28 Jun 2014
Posts: 5635
Location: King's Lynn, UK.

PostPosted: Sat 12 Oct 2019, 15:40    Post subject:  

@ Moose On The Loose:-

Hah! I know where you're coming from, Moose, and I appreciate the sentiment. The fact of the matter is that for something like the last 3 years I've done exactly that; shared a single version of a Chromium 'clone' between multiple Puppies, from a remote data partition, and sym-linked into each one where Pup expects to see it. I have a 'sym-link' .pet made up (nothing but symlinks!), and any time I add, or try out, a new Puppy, I just use the .pet to 'link' Pup to that remote browser install.

It works very well.

No; what I was attempting to do was to make up a truly 'portable' Chromium clone, self-contained in its own directory (just like the portable version that PortableApps.com have put together for Windoze), which, if you wanted to, could be run from a flash drive.....thus making it truly 'portable'.

Of course, I could be using completely the wrong Bash syntax. Despite the fact that I've set this portable up to use its own, built-in version of Glibc 2.19, along with certain other 'requirements', it's still resolutely searching in the file system to find them, and completely ignoring the resources already provided. Or is

Code:
export LC_ALL=C


....not the 'phrasing' to use on this occasion? Any ideas?


Mike. Wink

_________________
MY 'PUPPY' PACKAGES

Back to top
View user's profile Send private message 
williams2

Joined: 14 Dec 2018
Posts: 204

PostPosted: Sat 12 Oct 2019, 17:57    Post subject:  

LC_ALL is a locale setting.
For example, fr (French), ru (Russian), uk (United Kingdom) etc.
C is a very basic generic locale, like LC_ALL=us

You can set PATH and LD_LIBRARY_PATH and Chromium
or whatever you are running should use those variables.

For example, this should make Chromium look first in /opt/chromium
for executables and library files, then the standard paths:
Code:
export PATH=/opt/chromium:$PATH
export LD_LIBRARY_PATH=/opt/chromium:$LD_LIBRARY_PATH


If the Chromium files are not in /opt/chromium it won't work.

If you click the start script in a roxfiler window
or an icon on the desktop
rox always includes the dir path.
So this will tell you the path of the script you clicked:
Code:
dirname "$0"


So you could do something like this:
Code:
#!/bin/sh
DIR="$(dirname "$0")"
export PATH=$DIR:$PATH
export LD_LIBRARY_PATH=$DIR:$LD_LIBRARY_PATH
exec chromium "$@"


You might need more quotation marks if there are spaces in the path names.
Back to top
View user's profile Send private message 
Mike Walsh


Joined: 28 Jun 2014
Posts: 5635
Location: King's Lynn, UK.

PostPosted: Sat 12 Oct 2019, 20:20    Post subject:  

@ williams2:-

Right.....

Okay. Try this on for size......& get your considering cap on, 'cos it might get a bit 'tricky'.

---------------------------------------------------------------------

For me, /mnt/sda1 is a large, general data partition. It got re-purposed when Win XP bit the dust 3-4 yrs ago. Now; I run a lot of stuff, remotely, from this partition between Pups....okay?

The app (Iron browser) that I'm attempting to run is located at /mnt/sda1/iron-portable/iron32/iron. However, this 'iron' directory gets sym-linked into /mnt/home of the Puppy I wish to run it from, so effectively it's /mnt/home/iron.....which puts it outside of Puppy-space.

------------------------------------------------------------------------

This directory, in addition to the Iron browser components, also contains the following:-

- A self-contained 'copy' of Tahrpup's Glibc 2.19 and all its associated dependencies, etc. This is how we get external browsers to run on older Pups, with too-old glibc components.

- A 'lib' directory, containing the GTK3, pulse & NSS components required by Iron.

- A 'hidden' .config directory, where Iron will write its profile to when it starts up for the first time (/mnt/home/iron/.config/iron).

- A script, called 'launch', which sets the browser to use the built-in glibc components. This then passes control to the

- 'iron-pup' wrapper script, which starts Iron proper, looking for the GTK3 and NSS stuff in /mnt/home/lib as it does so.

----------------------------------

The 'launch' script looks like this:-

Code:
#!/bin/sh
#
export LC_ALL=C
/mnt/home/iron/glibc219/lib/ld-linux.so.2 --library-path /mnt/home/iron/glibc219/lib:/mnt/home/iron/glibc219/usr/lib:/mnt/home/iron/glibc219/libstdc++:/usr/X11R7/lib:/mnt/home/iron /mnt/home/iron/iron-pup "$@"


Some of the older Pups still use X11R7 for X-server stuff.

---------------------------------

'iron-pup' reads as follows:-

Code:
#!/bin/sh
#
# Try to find GTK3/NSS libraries, etc.
#
export LD_LIBRARY_PATH=/mnt/home/iron/lib:$LD_LIBRARY_PATH
#
exec -a "$0" /mnt/home/iron/chrome --user-data-dir=/mnt/home/iron/.config/iron --no-sandbox --disable-infobars --ppapi-flash-path=/mnt/home/iron/lib/mozilla/plugins/libpepflashplayer.so --allow-outdated-plugins "$@"


'Lib' also contains 'libpepflashplayer.so' and its associated 'manifest.json' in a sub-directory. The phrases starting with ('--') are some of the 1001 'switches' with which you can modify many aspects of a Chromium 'clone's' behaviour.

---------------------------------------------

Now; everything here is 'ELF 32', OK? Yet, attempting to start this, and run it, in a 32-bit Puppy, I'm getting a 'Wrong ELF header' error in the terminal. There's no 64-bit stuff anywhere in sight, but AFAIK, that error means you're trying to use/run/operate the app in the wrong architecture. So; what gives?

Any ideas?

(I'm not entirely. certain I'm using these two scripts the right way round. In the Mozilla-based portables with the glibc 'tweak', we run a launch script first that sets system variables, and instructs the browser to create & then use its own, built-in profile directory rather the standard one located in /root. This then passes control across to the other script, that sets the glibc paths and starts the browser directly from the 'firefox' binary.

You can't do this with the Chromium clones, since the entire browser code is contained within a single, enormous shared library; this is why the wrapper script is required, an essential part of which is specifying the '--user-data-dir' (profile directory) at that specific point in the start-up sequence. That's just the way they're coded to work.)



Mike. Wink

_________________
MY 'PUPPY' PACKAGES

Back to top
View user's profile Send private message 
williams2

Joined: 14 Dec 2018
Posts: 204

PostPosted: Sat 12 Oct 2019, 22:03    Post subject:  

You can get a lot of info doing this:
Code:
export LD_DEBUG=libs
run-me 2>/tmp/debug.log

where run-me is the name of the program you are running
and /tmp/debug.log is the debug log.

Maybe too much info.
Back to top
View user's profile Send private message 
williams2

Joined: 14 Dec 2018
Posts: 204

PostPosted: Sun 13 Oct 2019, 04:05    Post subject:  

You can find 64 bit files like this:
Code:
find /mnt/home/iron/chrome/ | xargs file | grep 64-bit

You can search in more than 1 dir, separated by spaces,
like this:
find /bin/ /sbin/ /lib/ ...

When you mix shared object library files,
there can be compatiblity problems.
If ld-linux.so and/or libc.so are linking with software
that was compiled for other ld-linux.so and/or libc.so,
it might not work.

It might not be possible to make the files
work compatibly.
Back to top
View user's profile Send private message 
fredx181


Joined: 11 Dec 2013
Posts: 4204
Location: holland

PostPosted: Sun 13 Oct 2019, 18:06    Post subject:  

Hi Mike,

It could be that the setup with older Glibc doesn't work with iron, but a portable setup is possible from what I tested (just like the portable FF Quantum).
I got iron from here:
https://www.srware.net/forum/viewtopic.php?f=18&t=49378
And changed the last line in the 'chrome-wrapper' script (to have profile and cache inside folder) to this:
Code:
exec $CMD_PREFIX "$HERE/chrome" --no-sandbox --disable-infobars --user-data-dir=$HERE/profile --disk-cache-dir=$HERE/profile/cache --disk-cache-size=10000000 --media-cache-size=10000000 --allow-outdated-plugins "$@"


Fred

_________________
Dog Linux website
Tinylinux blog by wiak
Back to top
View user's profile Send private message 
Mike Walsh


Joined: 28 Jun 2014
Posts: 5635
Location: King's Lynn, UK.

PostPosted: Sun 13 Oct 2019, 22:23    Post subject:  

fredx181 wrote:
Hi Mike,

It could be that the setup with older Glibc doesn't work with iron, but a portable setup is possible from what I tested (just like the portable FF Quantum).
I got iron from here:
https://www.srware.net/forum/viewtopic.php?f=18&t=49378
And changed the last line in the 'chrome-wrapper' script (to have profile and cache inside folder) to this:
Code:
exec $CMD_PREFIX "$HERE/chrome" --no-sandbox --disable-infobars --user-data-dir=$HERE/profile --disk-cache-dir=$HERE/profile/cache --disk-cache-size=10000000 --media-cache-size=10000000 --allow-outdated-plugins "$@"


Fred


@ Fred:-

The version I'm using (Iron 69) ought to work with the 'glibc219' directory, because it runs in Tahr 606.....and that's where watchdog originally sourced the components from. (I'm not using the very newest version, because NetFlix resolutely insists it can no longer 'see' the WideVine modules in the latest releases..... Rolling Eyes Go figure.)

I'll give your suggestion a try tomorrow, and see what, if anything, happens.

Cheers!


Mike. Wink

_________________
MY 'PUPPY' PACKAGES

Back to top
View user's profile Send private message 
jrb


Joined: 11 Dec 2007
Posts: 1324
Location: Smithers, BC, Canada

PostPosted: Wed 23 Oct 2019, 13:06    Post subject: Re: 'True' Chrome / Chromium portable is a no-no.....
Subject description: Linux hard-coding makes it impossible
 

Mike Walsh wrote:
Never mind. I know now I'm attempting the impossible. Laughing Laughing

Good thing I didn't read your post before I started trying to make Vivaldi-portable. Very Happy Granted, it still makes an empty folder /root/.config/vivaldi/Crash Reports, but everything else is in /initrd/mnt/dev_save/0_common/0_hardrive_apps/vivaldi226 except the Cache files which are in /tmp/vivaldi.

To get it to run in Precise-light I had to bump up to Glibc-2.26 (used a Slitaz module) and dump a bunch of libs from the Tahr repos into the Vivaldi folder. Took a bit of fiddling but I finally got it going.

I tried to get it to use a Glibc "tweak" but no luck. Finally put the Glibc-2.26 into adrv_precise_light-5.7.2.sfs and that did it.

Maybe Vivaldi is set up differently than the other clones. I'll have a look when I get some time.

Don't give up. Cool Cheers, J
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [10 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Browsers and Internet
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0607s ][ Queries: 11 (0.0086s) ][ GZIP on ]