Tiny Core Linux
Tiny Core Base => TCB Talk => Topic started by: Leee on May 19, 2026, 11:06:12 PM
-
I'm using Core 17.0 on x86_64
Is there a handy way to get the "immutable" attribute of a file to persist across a backup and restore cycle?
My issue is this: I have an application (emelfm2) that insists on changing the value of a certain setting in its config file to its default value when the program is closed and restarted.
Alarmingly, it does this even when the config file's ownership is changed to root:root and all write permissions are removed and the application is -not- running as root..
Using chattr to set the immutable attribute solves the problem, but doesn't survive a reboot with backup and restore because the file is restored without "immutable" set..
As one-off, I could put a line in bootsync.sh to set the immutable attribute, but that feels clumsy so I'm looking for a more elegant solution.
- use persistent HOME, which I don't want to do
- remaster the emelfm2 extension to include the config file on r/o media (which would prevent me from ever changing any other setting)
- use a different file manager, which I don't want to do
but none of those really seem ideal either.
The file in question is ~/.config/emelfm2/config-C.
The setting within the file has to do with the way file dates are displayed. There is a drop down list to select any of several preconfigured date formats (all of which are stupid) or "strftime() format provided below" with a box to enter a custom time format. When the setting resets to default, it doesn't lose the custom format, it just forgets that its supposed to actually use it.
I think emelfm2 is an abandoned application so, while it would be ideal to have the application fixed, I don't think that's going to happen. I'm comfortable with making the config file immutable and, if I have to, I'll reinstate the immutability at boot time but I'm hoping someone will mention something I've missed that allows the immutable attribute to be saved. Feel free to say, "Well, dumbhead, did you try ...."
Any ideas?
-
Hi Leee
... The file in question is ~/.config/emelfm2/config-C. ...
I just tried it under TC14 x86_64.
I selected strftime() and set the custom format to %Y%m%d.
Then I hit Apply and then Commit.
I closed emelfm2 and then opened it. The config file retained the custom format.
I then closed emelfm2 again. The config file reverted to "Default".
The config file also contains this note:
# emelFM2 (v 0.9.1)
# This is the emelFM2 configuration data file.
# It will be overwritten each time the program is run!
-
Hi Leee
... The file in question is ~/.config/emelfm2/config-C. ...
I just tried it under TC14 x86_64.
I selected strftime() and set the custom format to %Y%m%d.
Then I hit Apply and then Commit.
I closed emelfm2 and then opened it. The config file retained the custom format.
I then closed emelfm2 again. The config file reverted to "Default".
The config file also contains this note:
# emelFM2 (v 0.9.1)
# This is the emelFM2 configuration data file.
# It will be overwritten each time the program is run!
Yes that is my experience, too - it reverts the file the -second- time the application is restarted. Actually, I think it reverts when the program -closes- the second time.
I've seen that comment about the config getting overwritten but that is the file that gets updated when you make config changes in the applications UI, and it seems to be the only file with anything having to do with the date format. FWIW, I'm not (for once) making manual edits to the file - only using the application's settings interface - I just want my settings to "stick".
-
Can you just
chmod u-w ~/.config/emelfm2/config-Cso the app can't write to it.
-
Can you just chmod u-w ~/.config/emelfm2/config-Cso the app can't write to it.
That was the first thing I tried. It writes to it anyway. I find that annoying, but even more annoying is that changing the file ownership to root:root gets exactly the same result - it writes to the file anyway. In the mean time, actions that I -wish- would be performed as root are denied.
-
OK, Now we have to take tough measures.
Just try to:
sudo chattr +i ~/.config/emelfm2/config-C
And what file system do you use ?
Maybe you are using a file system that does not use any user rights.
That's why you can't get it to work.