Replace your savefile/folder with an sfs storage file

How to do things, solutions, recipes, tutorials
Message
Author
User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#61 Post by nic007 »

I go for small and very basic coding as long as it works for me. In my years with puppy, I've learnt to keep things simple. Large code texts gives me a headache and is of no interest to me really. In the end you do what's best for yourself, that's the beauty of puppy..fiddle with it till it suits your personal needs. Don't know why you have problems with saving the changes to a file you have edited, works for me (the file must obviously be part of the running filesystem). The only thing that does not save for me is changes to sound levels. This is because changes to the sound state is not saved to /initrd/pup_rw during a session but only at shutdown by running the shutdown script.

jd7654
Posts: 296
Joined: Mon 06 Apr 2015, 16:10

#62 Post by jd7654 »

Well, only thing I can say in general is:

Just be open to the idea that reducing hundreds of lines of code to just a few lines could possibly reduce functionality. And that extra code was put there for a reason, so removing it could have unintended consequences.

That's all I have to say about that.

Cheers

User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#63 Post by nic007 »

jd7654 wrote:Well, only thing I can say in general is:

Just be open to the idea that reducing hundreds of lines of code to just a few lines could possibly reduce functionality. And that extra code was put there for a reason, so removing it could have unintended consequences.

That's all I have to say about that.

Cheers
I agree with you but if a simple method works for me why should I bother further? You are free to produce the perfect solution for all puppys and all situations and share it with the puppy community...and I encourage you to do so. I'm sure the puppy community will embrace and appreciate it. It does seem as if you have some coding skills (most probably much better than my efforts which are very basic). Looking forward to see and test your efforts. Go for it!

jd7654
Posts: 296
Joined: Mon 06 Apr 2015, 16:10

#64 Post by jd7654 »

No, thanks. I like to eat the sausage, but don't necessarily want to get involved with how it is made. :wink:

I was just curious and poking around here with this sfs method. Did some scripting a long time ago, but am a piss-poor coder. I can see now looking at it and tinkering some more that there is more complexity there in the layers and the "whiteouts" files that I was seeing issues with, something the savefile script handles.

User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#65 Post by nic007 »

Deleted

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

#66 Post by greengeek »

nic007 wrote: The only thing that does not save for me is changes to sound levels. This is because changes to the sound state is not saved to /initrd/pup_rw during a session but only at shutdown by running the shutdown script.
This is something that bothers me too when I use my own methods to capture personal settings in an sfs.

I remember some time ago I used the "alsactl store" and "alsactl restore" commands to capture current audio settings during my sfs build but I forget things easily and can't immediately find the code I used.

Recently I had another look at why my sfs builder wasn't capturing my audio settings and I ended up confusing myself around the difference between usage of etc/asound.state and var/lib/alsa/asound.state. Maybe some puppies follow the ubuntu standards and others don't.

Anyway, I think you have to use "alsactl store" to create the asound.state file explicitly during sfs build. Probably also have to force "alsactl restore" during boot - but I have more experimentation to do before I can be sure of the best way.

EDIT : Another alternative I use sometimes is to place a script in /root/Startup to set specific slider levels as follows:

Code: Select all

#! /bin/bash

amixer sset "Master" 100% 
amixer sset "Speaker" 100%
amixer sset "Headphone" 100%
Don't think that helps anyone using pulseaudio though. (I don't use pulseaudio yet)
.

User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#67 Post by nic007 »

Yes, would be nice to work this out. Luckily it's not a major issue as one will generally set all your preferred volume slider settings only once and this can easily be achieved by creating a savefile and then incorporate asound.state from there to your sfs holding your changes (and then delete the savefile). Once this is done, the only temporary changes you are going to make is maybe the odd up or down volume change during a session whilst listening to something which you will do anyway.

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

#68 Post by greengeek »

What I don't know is why puppy (in /etc/init.d/10alsa) appears to look for /etc/asound.state but in my puppy that file does exist but is ignored (at least if I try a "alsactl restore"). It seems to me that the file asound.state should be in /var/lib/alsa - which is where it gets created when I do a "alsactl store". (I mostly use a Slacko 5.6 derivative).

Once that file is in it's proper place "alsactl restore" is all that's needed to get the mixer settings back exactly as I wanted them.

User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#69 Post by nic007 »

greengeek wrote:What I don't know is why puppy (in /etc/init.d/10alsa) appears to look for /etc/asound.state but in my puppy that file does exist but is ignored (at least if I try a "alsactl restore"). It seems to me that the file asound.state should be in /var/lib/alsa - which is where it gets created when I do a "alsactl store". (I mostly use a Slacko 5.6 derivative).

Once that file is in it's proper place "alsactl restore" is all that's needed to get the mixer settings back exactly as I wanted them.
Okay sorted. I run this command to save the mixer settings (included in my script now):

Code: Select all

alsactl -f /etc/asound.state store 

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#70 Post by slavvo67 »

Hi nic007:

I took your script and changed it around to suit my needs. I hope you don't mind. I basically changed it to specifically backup my PPSSPP save files into SFS and then to PET, as well. I had it include date and time at the end of the SFS and PET name so I can tell which is most recent:

#!/bin/sh
alsactl store
wait
mkdir /puppyfilesystem
mkdir /puppyfilesystem/root
mkdir /puppyfilesystem/root/.config
mkdir /puppyfilesystem/root/.config/ppsspp
mkdir /puppyfilesystem/root/.config/ppsspp/PSP
mkdir /puppyfilesystem/root/.config/ppsspp/PSP/SAVEDATA
mkdir /puppyfilesystem/root/.config/ppsspp/PSP/SYSTEM
wait
cp -a /root/.config/ppsspp/PSP/SAVEDATA/* /puppyfilesystem/root/.config/ppsspp/PSP/SAVEDATA
cp -a /root/.config/ppsspp/PSP/SYSTEM/*ini /puppyfilesystem//root/.config/ppsspp/PSP/SYSTEM
wait
cd /root/puppyfilesystem
wait
Xdialog -center -title "INITIATING!!!" --no-buttons -infobox "Backup starting PSP/SAVEDATA PSP/SYSTEM /root/INSTADATA" 0 0 3000
charles=`date +"%Y-%m-%d-%H_%M_%S"`
mksquashfs /puppyfilesystem /PPSSPP-3saves-$charles.sfs -noappend
cd /
mv puppyfilesystem PPSSPP-3saves-$charles
dir2pet -g -s -w="PPSSPP-3saves-$charles" -p=PPSSPP-3saves-$charles
wait
rm -r /PPSSPP-3saves-$charles
Xdialog -center -title "SUCCESS!!!" --no-buttons -infobox "Operation completed, exiting now" 0 0 3000
exit

Thanks,

Slavvo67

User avatar
jplt3
Posts: 118
Joined: Mon 08 Apr 2019, 20:40
Location: Planet Earth

#71 Post by jplt3 »

Thanks i will try ....

User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#72 Post by nic007 »

jplt3 wrote:Thanks i will try ....
Try this: http://www.murga-linux.com/puppy/viewto ... 28#1040928

User avatar
jplt3
Posts: 118
Joined: Mon 08 Apr 2019, 20:40
Location: Planet Earth

#73 Post by jplt3 »

Thanks

Post Reply