Injection = Save desktop - Not required with DevRel_03

Special files or links to 3rd party application programs

Injection = Save desktop - Not required with DevRel_03

Postby jbv » Sat Aug 18, 2012 12:57 pm

This thread is here to help sort out and update our documentation.

Hold Off on this one for a little while
While it works, there are some side-affects that are still being tracked down.
A revised version is in the works. If you want to have a look and a bit of a play, then by all means, continue.

This injection patches 02-FoxyDesktop to include 3 magic scripts

To inject the patch, download both files below and place them into your "live" directory.
If you booted from a USB stick, this will be /live/image/live

Open a console/terminal screen and type:
source /live/image/live/

On the next system power-up you will have 3 new and powerful scripts .

The scripts do the following:

99-snap ... Creates a save file with the name 99-snap.squashfs in your /live/image/live directory
- This snapshot contains:
... any new files that were added to /scripts
... any changes to /root/.config which will catch any desktop tweaks you have made.
...... it also strips out known log files and a few other things that it "knows about".
... any changes to Firefox, including bookmarks and configuration changes.
...... it actually parses the Firefox config file to find the correct profile directory 8-)
...... there is an option to delete the cache if you don't want this on the next reload.
99-snap is somewhat intelligent. It will create the snapshot if one does not exit. It will make a backup of an old snapshot if one did exist.
You can turn a few things on and off within the script and these changes also get saves when you run it. To turn things on or off, use nano or leafpad and edit the script itself. Once you look inside, you should see what the options are.

99-load ... Will load 99-snap.squashfs into /tmp so you can look at it and/or tweak it.

99-save ... Will save /tmp/sqf-snap as 99-snap.squashfs while making a backup of the original file.

99-snap creates a much leaner and cleaner sqf than 95-create
As it only looks in /root and /scripts it will not catch all changes.
But, it is fast and small.

This will most likely be the last injection for a while.
From here, I hope we will be right for a little while.

This injection was updated on :
Sunday, 19 August 2012 at 09:08:08 GMT/UTC/Zulu time
If you downloaded and injected the previous version,
please download these new files and re-inject them.
See the message below for further details
Posts: 600
Joined: Sat Jul 14, 2012 2:02 am
Location: Sydney, Australia

Re: FoxyRoxy Injection = Save desktop changes

Postby jbv » Sun Aug 19, 2012 10:56 am

99-snap has been extensively revised.

You can change the functionality by editing the script.
Open /scripts/99-snap and you will see a Configurable Variables section
Simply changing an option to be either yes orno will turn a function on or off.

99-snap will perform the following for each option:

SNAProot ... if yes, will take a snapshot of all changes made in the /root/.config directory
This will usually include all program configuration changes and tweaks. Amongst the settings that are known to be saved are:
OpenBox, ROX desktop, Adeskbar, XFE, LXterminal, Leafpad, SMplayer, and a few others
This pretty much covers most of the things you are likely to tweak and play around with a bit.

SNAPscripts ... if yes, will take a snapshot of all changes made in the /scripts directory
This means that the configuration changes you made to 99-snap also get saved (pretty cool, hu :))
Any new scripts you create or any changes you make to existing scripts are also saved.

SNAPfirefox ... if yes, will take a snapshot of all changes made to your Firefox configuration
<This Thread> contains some tips for configuring Firefox.

If addition to taking a snapshot of your Firefox configuration, you have the following options:

VACUUM_FFdbs ... if yes, cleans the various SQL databases before saving the snapshot.
Note: This reduces the basic bookmark db from 10Mb to 1Mb and speeds up Firefox significantly.
It is suggested that you always leave this option set to "yes", unless you are going to delete the bookmarks totally.

NUKE_FFplaces ... if yes, will delete all History and Bookmarks. (removes the SQL database)
Note: The default for this option is "no"
If you do set to "yes", Firefox will create a new blank db when restarted.
The empty db can be anywhere from 5/10Mb in size
Warning: Firefox seems to keep some configuration data in the same SQL db file.
Therefore by removing this database, you may loose some of your configuration data.

NUKE_FFbadurl ... if yes, will delete a database that Firefox is always updating in the background from Google.
This database can grow to be over 300Mb in size.
To stop Firefox from automatically updating this database you MUST turn off
Blocking of... reported attack and web forgeries in [Edit - Preferences - Security]
See <this thread> for more information.

NUKE_FFcache ... if yes, will delete/purge the cache of pages/images/etc that Firefox keeps
Changing this option to "no" will see the cache added to your snapshot. How large this becomes will depend upon the
setting you have made within Firefox. Leaving at the default of "yes" will mean that regularly visited sites may take a little longer to come up when you first access them after a restart, although Firefox should start building a new cache.

SNAP_etcmisc ... if yes, will save all changes made in the following directories.
/etc/apt ... will save any changes to your APT repositories and/or configuration
/etc/samba ... will save any changes you have made to SAMBA (SMB/Windows) networking - shares/attaches that sort of stuff
/etc/minidlna ... will save any changes you have made to miniDLNA - primarily configuration (will not save miniDLNA database)
/etc/conky ... will save any changes you have made to conky - primarily configuration (will not save conky add-ons)

Notes: If you have any other related configurations that you want to save, it is suggested that you add them to this section.
Extensions could be made to pickup other items such as the miniDLNA database, and/or conky support files. If someone has a really neat conky config that fits with FoxyRoxy and is easy to install/setup, then please post it here. Better yet, make a clean stand-alone .squashfs using 95-create/refresh/load/save and let us have a look 8-)

SNAP_etc_net ... if yes, will changes made to the following files
/etc/resolv.conf ... Network DNS details - where FoxyRoxy goes to resolve URLs
/etc/exports ... Basically, the configuration file for resources accessible (shared) using NFS
/etc/network/interfaces ... the file you would change for static IP and related things
Note: The default for this option is "no" ... It is assumed that if you change this option to "yes", you have made manual changes to your networking, you know what you are doing, and you are able to support them and yourself :)

NUKE_wh_org ... if yes, will remove a snapshot file if the file was in the previous snapshot and subsequently removed from the system.

If you think that sounded screwy, then trying to explain it is going to be even screwier :) Remember that FoxyRoxy uses container files and an overlaid filesystem. This means that you can add a file to a .sqf but it does not get deleted from the .sqf just because you deleted it from your system, because the container files are read-only. Well, that was until now... This script "cheats" and it almost did my head in while creating it. With the exception of some specific files from /etc (the network tweaks saved by setting SNAP_etc_net to "yes"), the script saves entire directories and then goes in and cleans up the "working" directory before saving the sqf. Each time you run the script, the first thing it does is see if there is an existing 99-snap.squashfs file and if there is, it loads that into the working directory and then looks in the cow directory and drops the changes into the working directory. It must do this, or just blindly copy the entire directory (which isn't really the right thing to do - so we don't do it). Okay, you're with me so far.

Here's were things get tricky. Lets say that you started the system and as part of the system startup, some of the files from 99-snap are used. You then change one of those, no problem, cow tracks it, we can spot this and therefore we only replace the file that changed when we run this script again. However if you delete a file, cow tracks this but in a different way. Instead of actually removing the file (which is really impossible) cow creates a special "whiteout" file and whenever anything tries to access the file that was deleted, cow sees this, knows the file isn't really there because it has a whiteout marker for it and so it tells the system, "nick off, there is no such file" (even though it still physically exists somewhere).

Are you still with me .... If so, I hope you will appreciate this part. What this script does is process the cow directories we are taking snapshots of and starts looking for files that have been deleted. When it finds one, it then parses the cow whiteout filename and works out what the filename is inside the snapshot sqf and it deletes that file from the working directory so that it is no longer in the sqf.... Pretty neat hu? ;)

This is a very powerful technique and I have no doubt it will be one that will be used quite a bit in the future. It has some real possibilities to help with the dreaded "how do I remove a package" dilemma, and while that one is for much later, we are now a step closer already :)

If we lost you there, welcome back. Basically; if you create a file in /scripts, take a snapshot, restart and then delete it, we will nuke it.

SNAP_smoffice ... if yes, will save any changes you make to the SoftMaker Office configuration files
Note: If you have not loaded the SoftMaker Office sqf or injected SoftMaker Office, this setting won't do anything.
If you have changed the default directory for templates and these no longer reside in /root/SoftMaker you should edit this script to the new location if you want these included int he snapshot, or comment out the line altogether if it is not required.

The following files are always removed from the snapshot
All cow .whiteout files are purged/deleted/trashed/nuked
All .bak files are purged/deleted/trashed/nuked
All .log files are purged/deleted/trashed/nuked

The intent behind 99-snap
99-snap is seen as the solution to using a USB container file based OS, that you will make changes to. The intent here is to allow you to easily take a snapshot of the stuff you are likely to play within until it is "just right". The goal was to keep the snapshot file isolated from the rest of the system, and to also keep it small so that it would update quickly and easily. As a first (well, okay ... second) cut, I think this is headed down the right track. While it is possible that we will add some more functionality to 99-snap, it is not a panacea for all of the issues associated with a container file based OS such as FoxyRoxy, nor is it intended to be.

If you want to apt-get packages and trim them, you should be looking at the "95-series" of scripts and be prepared to do some manual work to trim them. The underlying thing with this type of OS is that this is not the sort of thing you will/should be doing often. If it is, then perhaps you should be reviewing weather this is the sort of OS you should be using.

In time, I hope we will develop some scripts and documentation to assist with cleaning up stuff after installing. For now, this is as good as it gets.

Posts: 600
Joined: Sat Jul 14, 2012 2:02 am
Location: Sydney, Australia

Re: FoxyRoxy Injection = Save desktop changes

Postby jbv » Sat Aug 25, 2012 1:25 pm

There may be some unforeseen consequences with this injection.

At the moment, they appear to have an impact on installing packages that add, create, change, the system services, and in particular start-up sequence.

While we were already making progress in the area of changing the start-up services, it does need a little more work. The end result of this work may be the merging of two initiatives into the one. With the two items being saving desktop/local config stuff and the saving of changes to the services started during system startup. The issue only become apparent when you try to save your newly installed package with 95-create and something that was changed during the install and is saved in 95-snap is overwritten (overlaid) by something from 99-snap

The fix will result in config details being stored in 04-FoxyConfig such that new changes made with 95-snap will be reloaded
Posts: 600
Joined: Sat Jul 14, 2012 2:02 am
Location: Sydney, Australia

Re: FoxyRoxy Injection = Save desktop changes

Postby KazzaMozz » Wed Sep 05, 2012 3:13 am

Hi Brenton
so after reading this I should only play with these and stick with
95-series ?
(sirens going fire trucks somethings happened I bet the news tonight has a heap of damage in Melbourne due to the wind)

User avatar
Posts: 332
Joined: Tue Aug 21, 2012 9:59 pm
Location: Australia

Re: FoxyRoxy Injection = Save desktop changes

Postby jbv » Wed Sep 05, 2012 5:11 am

Hi Kazza,

The 95-series will always be the scripts you will use to take a general snapshot of system wide changes. You should also use the 95-series to create/load/edit/save while trying to get a good clean sqf

99-snap only saves specific things as documented above. One issue with the current arrangement though is that the 99-snap gets reloaded after the 95-snap, so it has the potential to overwrite something that you thought you had snapped (if it was something that the 99-snap covered - please review above for details).

This gets resolved in DevRel_03 because while I will leave the script as 99-snap the sqf itself will be 05-FoxyConfig and this will load before 95-snap.squashfs

I hope this helps and does not confuse.

Posts: 600
Joined: Sat Jul 14, 2012 2:02 am
Location: Sydney, Australia

Re: FoxyRoxy Injection = Save desktop changes

Postby KazzaMozz » Wed Sep 05, 2012 6:20 am

Hi Brenton
I read re the 99-series and have only been using the 95-series. Just wondered where it was at.
No confusion no worries.
User avatar
Posts: 332
Joined: Tue Aug 21, 2012 9:59 pm
Location: Australia

Return to FoxyRoxyLinux - Addons

Who is online

Users browsing this forum: No registered users and 1 guest