Bind mounts do the same job as links. Links are better.!

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#21 Post by amigo »

Hmm, you may be needing to mount /proc in the chroot so that needed stuff is avialable -like /proc/partitions, /proc/mounts and others.
chroot, mount /proc, then exec the app...

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#22 Post by sunburnt »

Thanks amigo; I don`t intend to bother you with diagnosing apps.

Here`s the run file:

Code: Select all

chroot $Pkg/$Pkg.u /proc
$@
./setup &

# The error is completely different:
chroot: can't execute '/proc': Permission denied
./run: line 2: google-chrome: command not found
No change when I tried it with: unionfs-fuse -o allow_other

### Update: I put "pwd" and "ls" commands to test it.
I had to use "sleep 30" as "read K" didn`t work inside the chroot.
Here`s the errors:

Code: Select all

#  Mount Union:  chrome-24_i386.u
/

ls: cannot access /usr/bin/google-chrome: No such file or directory

ls: cannot access /opt/google/chrome/google-chrome: No such file or directory

./run: line 9: google-chrome: command not found
But when I look in the union`s paths the files ARE there.!!!

# I`m going to start another forum thread for help with these apps.
.

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#23 Post by amigo »

"can't execute '/proc'"
The last errors are because the chroot is failing. This does all relate to the method you are trying. You need to mount proc inside the chroot. The last argument to chroot is the command to run inside the chroot -/bin/sh would be the 'manual' way to enter the chroot. Since you need to run more than one comand, you can cat them together into a variable:
CHROOT_CMD="mount /proc; mount /sys; ..."

$@
./setup &
Is this script receiving some parameters in $@? And, is the setup script really in '/' of the chroot?

Try setting up a chroot manually so you can get in there and see better what is going on and how it works. You shouldn't be needing to use LD_LIBRARY_PATH at all.
Last edited by amigo on Wed 23 Jan 2013, 08:25, edited 1 time in total.

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#24 Post by sunburnt »

Chroot, that`s what I thought, the union seems to be working ( more or less...).

I tried your suggestion on Chrome and Xfe and both jam at the chroot command and I have to unmount it all.
Xfe runs with the original commands, but can`t find /share stuff ( it`s there...) and /.Choices permission error.
Xfe isn`t a complex app., just icons and a config. file in /share.

xMahjongg runs nice and fast, no problems ( I guess not that odd...).
And it`s using the original commands:

Code: Select all

chroot $Pkg/$Pkg.u $@
./setup &
The thing that I noticed that amazed me was, the setup file is outside the chroot, but it still runs.!!!
There`s a lot of wacky stuff going on with this setup, need to get a handle on it for it to be useful.

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#25 Post by amigo »

My, you are up early! You posted as I was editing my last post.
Really, try setting one up manually so you can really understand the union and then the chroot. Use a simpler example -xmahjongg should be good -it probably writes to /var/games (scores) and maybe looks for a conf file besides /usr/bin and /usr/lib?

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#26 Post by sunburnt »

It`s 2 am here but I stay up late a bit, I`m about to go to sleep.

The chroot wants an exec., it doesn`t jam if I use: chroot (union) pwd

xMahjongg has no config. or /var files, just game graphics in /share
Xfe runs but can`t find some deps. in /share ( what`s different? )
Chrome can`t even find it`s main exec. script: google-chrome
And it reports:

Code: Select all

/ ( pwd command )
mount: proc already mounted
./run: line 3: google-chrome: command not found
It sounds like your saying a bunch of stuff needs mounting for it to find files in the union?

As I said, the files are there, the union does seem to be working.
Chroot looks to be the bugger upper, it seems to mess with file access.

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#27 Post by amigo »

A couple of questions? Where did you get chrome from? Is it packaged in some way as a *.deb?

I think mhddfs is not really the right tool -it expects every layer to be read-write which is not gonna be the case if using squahsfs *images*.
unionfs-fuse is also in the repos so you should be able to use it just as well -it's gonna provide better control.

Can you install chrome normally and verify that it actually works on your system? If so, we can go to next step by creating a normal chroot environment manually.

Ibidem
Posts: 549
Joined: Wed 26 May 2010, 03:31
Location: State of Jefferson

#28 Post by Ibidem »

FYI, I'd enter a chroot with something like this (loosely based on my script plus a couple changes)

Code: Select all

#!/bin/sh
cd $1 && shift && \
for d in dev dev/pts proc sys
do
   mkdir $d ; mount --bind /$d ./$d
done
mkdir etc; cp /etc/resolv.conf etc/
chroot ./ $@
dev/pts is mainly for terminals, sys is rarely needed (only for runtime configuration of the kernel), proc is usually not needed. You may want to add dev/shm for shared memory, delete resolv.conf to prevent network access, add etc/hosts or etc/fstab, or $HOME/somedir, and so on.
Usage would be about like so:

Code: Select all

chrootin /opt/chrome  /usr/bin/chromewrapper http://www.murga-linux.com/puppy
where /opt/chrome/usr/bin/chromewrapper is the command executed.
Note the need to add a shell inside the chroot if you want to run scripts!

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#29 Post by sunburnt »

amigo; From Google for Ubuntu: https://www.google.com/intl/en/chrome/browser/

After I posted the 3 AppPkg scripts I changed to unionfs-fuse from Ubuntu Precise.
Both it and mhddfs had the same problem of the files not being found.
The 2 commands I`ve tried:

Code: Select all

#	unionfs-fuse $Pkg/$Pkg.rw=RW:$Pkg/$Pkg.app=RO:/=RO $Pkg/$Pkg.u
	unionfs-fuse -o allow_other $Pkg/$Pkg.rw=RW:$Pkg/$Pkg.app=RO:/=RO $Pkg/$Pkg.u
I`m posting this from Chrome-24 that I originally got working with my "Links & Paths" method.


Ibidem; This is a union setup: a Save layer ( dir.) on a Chrome layer ( Sq. file ) on /.
chroot to / should allow a normal operating system shouldn`t it?
I look at the union and all the files are there: Save, Chrome, and /.
But the run script errors saying it can`t find the Chrome wrapper script.


If it takes a lot of code to make this work, then it`s not much better than my "Links & Paths" method.

My starting criteria was: 1 method that will work for everything ( a Silver Bullet ).

Tiny Core has scm apps., I noticed that they use many different methods for making them.

Ibidem
Posts: 549
Joined: Wed 26 May 2010, 03:31
Location: State of Jefferson

#30 Post by Ibidem »

sunburnt wrote: The 2 commands I`ve tried:

Code: Select all

#	unionfs-fuse $Pkg/$Pkg.rw=RW:$Pkg/$Pkg.app=RO:/=RO $Pkg/$Pkg.u
	unionfs-fuse -o allow_other $Pkg/$Pkg.rw=RW:$Pkg/$Pkg.app=RO:/=RO $Pkg/$Pkg.u
I`m posting this from Chrome-24 that I originally got working with my "Links & Paths" method.


Ibidem; This is a union setup: a Save layer ( dir.) on a Chrome layer ( Sq. file ) on /.
chroot to / should allow a normal operating system shouldn`t it?
I look at the union and all the files are there: Save, Chrome, and /.
But the run script errors saying it can`t find the Chrome wrapper script.


If it takes a lot of code to make this work, then it`s not much better than my "Links & Paths" method.
Looking at the command line I think you're mounting the union including / on an app directory, rather than on /.
In other words, after all the union stuff finishes, you need to have a union root with an appdir layer. Instead, you have / as a layer in a union appdir. This will only work if you somehow remount stuff in different locations (I know it's possible...) or chroot in.

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#31 Post by sunburnt »

Ibidem; Correct. My post on the first page shows the 3 files that run it ( It`s old now ).

First is a unique script that exports the pkg. name+ver., runs script 2 passing app. exec. and args.
Second is a generic script, mounts Sq. files and unionfs-fuse, runs script 3 passing app. exec. and args.
Third is a generic tiny ( 31 b ) "hook" script that does chroot and runs the app`s. exec.

There`s a RW config. dir. layer, on a RO app. dir. layer, on a RO / layer, all on a union dir.
Chroot into the union dir. and all 3 layers should be accessible as / . Right?
I look at the union dir. and all of the layers ARE there. Chroot isn`t playing nice.
xMahjongg runs just fine in this setup, but so far nothing else works.

### I`m now thinking of different ways to use the union without chroot.
I thought of 5 unions, Save layers mounted on each: /etc, /var, /opt, /root, /usr/share
Each of them like this: unionfs-fuse /tmp/OS/etc=RW:/tmp/OS/sq.mnt/etc=RO /etc
Links in /etc point to the AppPkg /etc dir. So the config. files are in AppPkg.

Also 1 union like Puppy ( chroot ) with a Save layer of only configs. and links on / .
No App. installs in Save because there`s no need to with AppPkgs.

For Puppy I`ve said before that there should be 2 Save files, for configs. and apps.
.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#32 Post by greengeek »

sunburnt wrote:I like the idea of many slide-out panels.
I posted a concept of labeled colored bars anywhere along the screen sides. hover to slide-out.
On a single left side panel: desktop buttons, drive/partition buttons, task-bar buttons, and tray.
Task-bar and drive/partition buttons are stacked vertically so lots of them fit in a small space.
Another left side panel bar labeled menu is a slide-out apps. menu that can also be DnD on.
Desktop icons get covered up, but the bars and panels are on-top, so drag-hover-select-drop.
Desktop icons are messy, slide-out panels organize items and the desktop`s clean and pristine.
Excellent idea, especially for netbooks.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#33 Post by greengeek »

sunburnt wrote:For Puppy I`ve said before that there should be 2 Save files, for configs. and apps.
.
Another excellent idea - config files could contain all personal info (wireless key etc) and be completely separate from other app additions (and hopefully portable to all future puppies...)

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#34 Post by sunburnt »

Thanks greengeek; All "loose file" apps. in one layer, and everything else in the other.

Portable to the future... Never gonna happen, they keep changing everything.
JWM has changed, and the apps. change for no reason at all it seems.
GTK folks redo all kinds of stuff on a regular basis, and so do many others.
Only the base Linux O.S. stuff stays the same, neer as I can tell...

Standards. IF they don`t wanna, it`s okay, then they`re just not compatible.
What if Firefox`s user base fell because they didn`t follow "app. standards".
Last edited by sunburnt on Thu 24 Jan 2013, 07:50, edited 1 time in total.

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#35 Post by jpeps »

Exactly. It's a much better idea to keep backups and config notes somewhere that you can browse before screwing up the new distro. It's way too easy to forget what you've configured.

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#36 Post by sunburnt »

jpeps; And mixing the apps. and those config. files make for a real mess.
Make it easy to do separate backups of the configs. and also the apps.

Speaking of mixing, how about /root and /home for configs. and user files?
At least put the config. files in a hidden sub dir. so the noobs don`t bork it.
Last edited by sunburnt on Thu 24 Jan 2013, 07:57, edited 2 times in total.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#37 Post by greengeek »

sunburnt wrote:Portable to the future... Never gonna happen, they keep changing everything.
True enough. But if you set a well designed precedent others will quickly adopt/modify it. I think thats a great idea to have a separate savefile for personal settings/private data. I'm gonna give that idea 12.5 out of 10

- puppy distro layer
- app layer
- personal layer
Last edited by greengeek on Thu 24 Jan 2013, 08:00, edited 1 time in total.

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#38 Post by sunburnt »

You have the layers reversed. And config. not personal.

I`d like to think you`re right, but I don`t see any historical evidence for it.
Especially the big app. guys, they really don`t care.
It`s the "Uncle Bill" syndrome, "Do it my way or not at all...".

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#39 Post by greengeek »

sunburnt wrote:It`s the "Uncle Bill" syndrome, "Do it my way or not at all...".
Possibly so, but did Uncle Bill foresee Android? I doubt he did, yet Android gives many users a data experience they are happy with. Good ideas that give the end user the experience they want can sometimes win through in the modern market regardless of the origin.

I hope you get some breakthroughs with your preferred puppy architecture - I think you have some ideas here that users will appreciate.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#40 Post by greengeek »

sunburnt wrote:You have the layers reversed. And config. not personal.
Not sure why you say that...
Choice 1 would be to select the puppy you prefer.
Choice 2 would be to select the range of apps someone else has added to the puppy. (eg: "multimedia pack", or " "science pack")
Choice 3 would be to graft your own personal (private) settings over the top of everything. (eg: "wireless key", and/or "local language") etc

Post Reply