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
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

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

#41 Post by sunburnt »

Ahhh. You mean selections. Layers refers to the union FS.
Puppy has it`s main SFS file at the bottom, add-on SFS on top of that, and the Save at the very top.
This way the files in the Save overshadow all the other layers.

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

#42 Post by greengeek »

yeah, sorry, I'm not too clear on the distinctions between fs layers and sfs layers yet.

Can someone tidy up the linux filesystem please...
(and make it easy for dummies...)

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

#43 Post by sunburnt »

SFS file has a FS that is mounted just like the Save file, or partitions, or CDs.
Any number of these items or ordinary dirs. can be unioned into one view.

It`s what allows a live CD to work, otherwise you couldn`t write to it.
And SFS files are read only too, so it makes SFS files writable also.

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

#44 Post by greengeek »

I wonder if would it be possible to build a puppy that could use a "personal sfs" that became the container for all the "user specific" info like wireless key etc.

So that a remaster could easily exclude that personal info and just pickup the base puppy plus installed apps.

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

#45 Post by sunburnt »

The dual Save file idea is just that. Remove the config. layer before remastering.

As said, the mixing of the configs. and installed apps. make for a mess.
As said, one Save file layer for apps. only, the other for everything else.

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

#46 Post by sunburnt »

Ibidem; I think your script example was for chroot into an empty dir.?

My script was including / in the union stack so everything should work. Right?
This explains the error: "/proc is already mounted", it was already working.

So why`s it fail to find the google-chrome file which I can see in the union?

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

#47 Post by Ibidem »

sunburnt wrote:Ibidem; I think your script example was for chroot into an empty dir.?

My script was including / in the union stack so everything should work. Right?
This explains the error: "/proc is already mounted", it was already working.

So why`s it fail to find the google-chrome file which I can see in the union?
Is chrome invoked in a command invoked by chroot?
For reference, this:

Code: Select all

chroot "/path/to/"  something
setup.sh
changes the root directory to /path/to, searches the PATH relative to the new root, runs the command "something" from within the new root, and then exits the chroot and runs setup.sh.

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

#48 Post by sunburnt »

That`s pretty much what my run script does.
At the bottom is the run script

Code: Select all

======= Script: chrome 
#!/bin/sh
cd ${0%/*}/.AppPkg
export Pkg="chrome-24_i386"
./setup google-chrome --user-data-dir=profile --disk-cache-size=20971520 &

======= Script: setup 
#!/bin/sh 
#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>   Mnt. Sq. Files & Union, Run App. 
if [ "$1" ];then
	echo -e "\n\n###  Run:  $Pkg\n"
	App="$Pkg/$Pkg.app"									### Mount App. Sq. File
	Sq="$Pkg/$Pkg.sq"
	[ ! -d $App ]&& echo -e "###  ERROR:  NO App. Dir.:  $Pkg.app\n" && exit
	[ ! "`ls $App`" ]&& if [ -f "$Sq" ];then				# IF app dir. empty
		mount -t squashfs -o loop $Sq $App					# IF Sq. file, mnt.
		[ $? -gt 0 ]&&
			echo -e "###  ERROR:  Fail Mount App. File:  $Pkg.sq\n" && exit
		echo -e "#  Mount App. Sq. File:  $Pkg.sq\n"
	fi
### Mount union fs
	unionfs-fuse $Pkg/$Pkg.rw=RW:$Pkg/$Pkg.app=RO:/=RO $Pkg/$Pkg.u
	[ $? -gt 0 ]&&
		echo -e "###  ERROR:  Fail Mount Union:  $Pkg.u\n" && setup &
	echo -e "#  Mount Union:  $Pkg.u\n"
	./run $@ &												### Run hook file

else #>>>>>>>>>>>>>>>>>>>>>>>>>>>>	Delete Dependency Link, Unmount Sq. Files.
	echo -e "###  End:  $Pkg\n"
	umount -f $Pkg/$Pkg.u				    				# Unmount union fs
	[ $? -eq 0 ]&& echo -e "#  UnMount Union:  $Pkg.u\n" ||
		echo -e "###  ERROR:  Fail UnMount Union:  $Pkg.u\n"
	Mnt=`mount`
	App=`echo "$Mnt" |grep $Pkg.app`
	if [ "$App" ];then umount -d $Pkg/$Pkg.app				# Unmount App. file
		[ $? -eq 0 ]&& echo -e "#  UnMount App. Sq. File:  $Pkg.sq\n" ||
			echo -e "###  ERROR:  Fail UnMount App. File:  $Pkg.sq\n"
	fi
fi

======= Script: run 
chroot $Pkg/$Pkg.u $@
./setup &
I tried this setup with avidemux and it can`t find the exec. file also.
Chrome`s wrapper script errors oddly, when it can find it.
But xMahjongg runs great with the exact same setup. Really weird...

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

#49 Post by Ibidem »

I've modified the shell scripts in ways that should be synonymous with your version.
sunburnt wrote:That`s pretty much what my run script does.
At the bottom is the run script

Code: Select all

======= Script: chrome 
#!/bin/sh
cd ${0%/*}/.AppPkg
export Pkg="chrome-24_i386"
./setup google-chrome --user-data-dir=profile --disk-cache-size=20971520 &

======= Script: setup 
#!/bin/sh 
#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>   Mnt. Sq. Files & Union, Run App. 
if [ "$1" ];then
	echo -e "\n\n###  Run:  $Pkg\n"
	App="$Pkg/$Pkg.app"									### Mount App. Sq. File
	Sq="$Pkg/$Pkg.sq"
	[ ! -d $App ]&& echo -e "###  ERROR:  NO App. Dir.:  $Pkg.app\n" && exit
	[ ! "`ls $App`" ]&& if [ -f "$Sq" ];then				# IF app dir. empty
		mount -t squashfs -o loop $Sq $App	||
			{ echo -e "###  ERROR:  Fail Mount App. File:  $Pkg.sq\n" && exit }
		echo -e "#  Mount App. Sq. File:  $Pkg.sq\n"
	fi
### Mount union fs
#this ought to exit on failure, surely?
	unionfs-fuse $Pkg/$Pkg.rw=RW:$Pkg/$Pkg.app=RO:/=RO $Pkg/$Pkg.u  || { echo -e "###  ERROR:  Fail Mount Union:  $Pkg.u\n" && setup & }
	echo -e "#  Mount Union:  $Pkg.u\n"
	./run $@ &					### Run hook file

else 
	echo -e "###  End:  $Pkg\n"
	umount -f $Pkg/$Pkg.u && echo -e "#  UnMount Union:  $Pkg.u\n" ||
		echo -e "###  ERROR:  Fail UnMount Union:  $Pkg.u\n"
	Mnt=`mount`
	App=`echo "$Mnt" |grep $Pkg.app`
	if [ "$App" ];then umount -d $Pkg/$Pkg.app && \
               echo -e "#  UnMount App. Sq. File:  $Pkg.sq\n" || \
               echo -e "###  ERROR:  Fail UnMount App. File:  $Pkg.sq\n"
	fi
fi

======= Script: run 
chroot $Pkg/$Pkg.u $@
./setup &
I tried this setup with avidemux and it can`t find the exec. file also.
Chrome`s wrapper script errors oddly, when it can find it.
But xMahjongg runs great with the exact same setup. Really weird...
OK, so the "setup &" is unmounting everything...
Let's see if I'm following the logic (BTW, it seems clearer with a code block per file, and your commenting style somehow seems to obscure it):

Code: Select all

chrome
#cd .AppPkg; mount union
# run google-chrome --user-data-dir=profile --disk-cache-size=20971520 &
# == chroot $Pkg/$Pkg.u google-chrome --user-data-dir=profile --disk-cache-size=20971520 
# when this exits we run:
# setup &
Which suggests that your code will not work with wrappers that execute things in the background...
Also, you might check the return values from unionfs-fuse: it looks like a nonzero return would cause that sort of issue.

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

#50 Post by amigo »

I agree with Ibidem about backgrounding the ./setup command.
I hadn't forgotten about this thread. Instead I had been experimenting here on my system as a normal user. Actually, suing chroot by itself is impossible as a normal user -even if using sudo! (The same will actually apply to mount itself.)

So I had been looking for other solutions and came across 'schroot' -but it needs configuring for individual chroots -although it claims to be safer than real chroot. But then, I found fakechroot which seems to solve the problem nicely. Both schroot and fakechroot are debian projects so they should be in the repos you are using.

I hadn't asked before, but what system exactly are you trsing this all on. If you are running as root or running some puppy derivative, then your results are not gonna reflect any sort of reality for people using other systems.

Anyway, I just got a chroot working here using unionfs-fuse and fakechroot without any problems at all. I had downloaded the chrome browser a couple of days ago and first got it working normally to avoid any mix-ups. Apparently the chrome builds have less dependencies than using the real chromium. I'll try to get an example chrome-in-union working tomorrow and post the results.

Post Reply