freememapplet_tray v2.8.6 and v2.8.6f - includes source
Version 2.8.4 and 2.8.4x
Added more validation of input from PUPSTATE to both.
Also added check for file existence to v2.8.4x, this brings its resilience to be on a par with v2.8.4.
V2.8.4x contains binaries this time. The other files can easily be copied from v2.8.4, if required.
Hopefully this is the end, well at least until someone else finds a bug.
gyro
Also added check for file existence to v2.8.4x, this brings its resilience to be on a par with v2.8.4.
V2.8.4x contains binaries this time. The other files can easily be copied from v2.8.4, if required.
Hopefully this is the end, well at least until someone else finds a bug.
gyro
Last edited by gyro on Sat 19 Sep 2015, 05:23, edited 1 time in total.
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
gyro, I don't know if I did something wrong, but when I try to run freememapplet_tray32 in Slacko5.6 I get a "SAVE_LAYER line is missing or badly formated." error.
I have no need for a SAVE_LAYER.
My /etc/rc.d/PUPSTATE reads
I have no need for a SAVE_LAYER.
My /etc/rc.d/PUPSTATE reads
Code: Select all
PUPMODE=5
PDEV1='sdb1'
DEV1FS='vfat'
PUPSFS='sdb1,vfat,/pup_slacko/puppy_slacko_5.6.sfs'
PUPSAVE=''
PMEDIA='usbflash'
#ATADRIVES is all internal ide/pata/sata drives, excluding optical, excluding usb...
ATADRIVES='sda '
#ATAOPTICALDRIVES is list of non-usb optical drives...
ATAOPTICALDRIVES='sr0 sr1 '
#these directories are unionfs/aufs layers in /initrd...
SAVE_LAYER=''
PUP_LAYER='/pup_ro2'
#The partition that has the slackosave file is mounted here...
PUP_HOME=''
#(in /initrd) ...note, /mnt/home is a link to it.
#this file has extra kernel drivers and firmware...
ZDRV=''
#complete set of modules in the initrd (moved to main f.s.)...
ZDRVINIT='no'
#Partition no. override on boot drive to which session is (or will be) saved...
PSAVEMARK=''
PSUBDIR='/pup_slacko'
Hi MochiMoppel
Indeed it looks all along as if the case for pupmode=5 has just been testing '/initrd' without adding anything in the concatenation (nothing to add). Of course testing any valid writeable directory in the system would give the same amount of space available (which when running fully in RAM would be whatever RAM is left).
I propose this patch to add a case for pupmode=5 (this is against 2.8.4x)
Indeed it looks all along as if the case for pupmode=5 has just been testing '/initrd' without adding anything in the concatenation (nothing to add). Of course testing any valid writeable directory in the system would give the same amount of space available (which when running fully in RAM would be whatever RAM is left).
I propose this patch to add a case for pupmode=5 (this is against 2.8.4x)
Code: Select all
--- freememapplet_tray.c.x 2015-09-18 10:18:30.000000000 +1000
+++ freememapplet_tray.c 2015-09-18 15:32:37.853326180 +1000
@@ -55,6 +55,7 @@
gboolean pupSavefile = FALSE;
gboolean fullInstall = FALSE;
+gboolean firstRun = FALSE;
gboolean Update(gpointer ptr);
@@ -79,7 +80,7 @@
gboolean Update(gpointer ptr) {
//read free personal storage...
- if (fullInstall)
+ if ((fullInstall) || (firstRun))
getFileSystemData("/");
else
getFileSystemData(save_layer_dir);
@@ -220,6 +221,10 @@
fullInstall = TRUE;
haveSaveLayer = TRUE;
}
+ else if (g_str_has_suffix(curLine, "=5"))
+ {
+ firstRun = TRUE;
+ }
}
else if (g_str_has_prefix(curLine, "PUPSAVE="))
{
@@ -262,7 +267,7 @@
g_free(linesString);
g_strfreev(linesArray);
- if ((havePupstate) && (haveSaveLayer))
+ if ((havePupstate) && ((haveSaveLayer) || (firstRun)))
{
gtk_init(&argc, &argv);
tray_icon = create_tray_icon();
Puppy Linux Blog - contact me for access
Hi MochiMoppel,
Yes it's complaining that there's nothing in "SAVE_LAYER". It won't do just "/initrd" anymore.
Would it make sense to set "save_layer_dir" to "/" if there is a PUPSTATE file but the SAVE_LAYER value is empty?
Note: The exit versions have a problem if "getFileSystemData" returns 0, the following code:means that the icon is never setup, so the program is in the tray, but it's just a blank. A right click on the spot it should be in produces a menu. Not good.
So it's quite important to make sure that there is always a valid value for "save_layer_dir" before it is decided not to exit.
gyro
Yes it's complaining that there's nothing in "SAVE_LAYER". It won't do just "/initrd" anymore.
Would it make sense to set "save_layer_dir" to "/" if there is a PUPSTATE file but the SAVE_LAYER value is empty?
Note: The exit versions have a problem if "getFileSystemData" returns 0, the following code:
Code: Select all
if (sizefreeprev == sizefree)
return TRUE; //unchanged.
So it's quite important to make sure that there is always a valid value for "save_layer_dir" before it is decided not to exit.
gyro
Yes.gyro wrote:Would it make sense to set "save_layer_dir" to "/" if there is a PUPSTATE file but the SAVE_LAYER value is empty?
Which would by definition exclude any mount points.I wrote:Of course testing any valid writeable directory(snip)
Puppy Linux Blog - contact me for access
That should work.gyro wrote:Hi 01micko,
"save_file_dir" doesn't have to be a writeable directory, in fact it just has to be an existing file in the relevant partition.
I will produce another "x" version that has no special pupmode testing, but uses "/" if it can't get anything from "SAVE_LAYER".
gyro
Thanks for your efforts.
Puppy Linux Blog - contact me for access
Version 2.8.5x
This version exits if it can't find a PUPSTATE file.
It also exists if there is no SAVE_LAYER line or if there is a directory specified by the SAVE_LAYER line but it does not exist.
Note: In a frugal install if "/" is used, it shows the partition of "pup_rw". In pupmode=5 and pupmode=13 I think that this is the tempfs that contains "pup_rw".
gyro
It also exists if there is no SAVE_LAYER line or if there is a directory specified by the SAVE_LAYER line but it does not exist.
Note: In a frugal install if "/" is used, it shows the partition of "pup_rw". In pupmode=5 and pupmode=13 I think that this is the tempfs that contains "pup_rw".
gyro
Last edited by gyro on Sat 19 Sep 2015, 05:15, edited 1 time in total.
We just did a circle
Again now failing in full installs due to lack of "SAVE_LAYER" line.
Again now failing in full installs due to lack of "SAVE_LAYER" line.
Puppy Linux Blog - contact me for access
yes.gyro wrote:Not a big problem, provided that it has a PUPSTATE file.01micko wrote:Again now failing in full installs due to lack of "SAVE_LAYER" line.
It does have a PUPSTATE file does't it??
gyro
Puppy Linux Blog - contact me for access
Version 2.8.6x
Yet another version.
This one exits if there is no PUPSTATE file.
If it gets something from the "SAVE_LAYER" line then it must result in an existing file, if not it exits.
If it doesn't get anything from a "SAVE_LAYER" line then it uses "/".
This means that it strongly protects itself from the dreaded zero.
Under pupmode=12, the result will be the same if it gets a valid '/pup_rw' or it uses '/', since '/' means it uses the aufs write layer which is the savefile/savefolder.
Under pupmode=13, a valid '/pup_ro1' will give information on the savefile/savefolder. But if it uses '/' then it will give information on the tmpfs that contains 'pup_rw'.
Again the tar file includes some binaries.
gyro
This one exits if there is no PUPSTATE file.
If it gets something from the "SAVE_LAYER" line then it must result in an existing file, if not it exits.
If it doesn't get anything from a "SAVE_LAYER" line then it uses "/".
This means that it strongly protects itself from the dreaded zero.
Under pupmode=12, the result will be the same if it gets a valid '/pup_rw' or it uses '/', since '/' means it uses the aufs write layer which is the savefile/savefolder.
Under pupmode=13, a valid '/pup_ro1' will give information on the savefile/savefolder. But if it uses '/' then it will give information on the tmpfs that contains 'pup_rw'.
Again the tar file includes some binaries.
gyro
Version 2.8.6x
Seems I forgot to attach the file.
gyro
gyro
- Attachments
-
- freememapplet-2.8.6x.tar.gz
- extract to directory
- (12.1 KiB) Downloaded 223 times
Passed my tests in pupmodes 2, 5 and 12 (with savfile and savefolder).
Thanks
Thanks
Puppy Linux Blog - contact me for access
Hi gyro
Well I reckon this is the end of development as it seems stable throughout different installations.
I took the liberty to upload 2.8.6 to ibiblio sources <<-- http://distro.ibiblio.org/puppylinux/so ... .6.tar.bz2. This was mainly to facilitate downloading and building from a script.
All I did was strip out the binaries and pot files and rebuilt the archive with bz2 compression to distinguish from your package.
If you don't mind, I'd like to make a post in the translations section so we can get some .po files for different languages, or you can do it if you like.
Thanks again for your efforts.
Well I reckon this is the end of development as it seems stable throughout different installations.
I took the liberty to upload 2.8.6 to ibiblio sources <<-- http://distro.ibiblio.org/puppylinux/so ... .6.tar.bz2. This was mainly to facilitate downloading and building from a script.
All I did was strip out the binaries and pot files and rebuilt the archive with bz2 compression to distinguish from your package.
If you don't mind, I'd like to make a post in the translations section so we can get some .po files for different languages, or you can do it if you like.
Thanks again for your efforts.
Puppy Linux Blog - contact me for access
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
Provided binary seems to run OK in Slacko5.6 (after creating /usr/share/pixmaps/puppy and copying the .svg files).
However what I always find irritating in new puppies is the strange "full green" icon (container_4.svg), right in the screenshot. Looks empty to me because the opaqueness is wrong when compared with the "almost full" icon (container_3.svg). I like the old one (left in screenshot) much better and would like to keep it when - some day - upgrading to a newer Puppy. My question: Where does Slacko5.6 store these icons? I can't find them
However what I always find irritating in new puppies is the strange "full green" icon (container_4.svg), right in the screenshot. Looks empty to me because the opaqueness is wrong when compared with the "almost full" icon (container_3.svg). I like the old one (left in screenshot) much better and would like to keep it when - some day - upgrading to a newer Puppy. My question: Where does Slacko5.6 store these icons? I can't find them
- Attachments
-
- freemem_icons.png
- (1.77 KiB) Downloaded 166 times
They are builtin. XPM's can be included in C source. I'll attach them for you, but you'll have to change the icon names in the source.
- Attachments
-
- freemem_xpm.tar.gz
- (557 Bytes) Downloaded 215 times
Puppy Linux Blog - contact me for access