Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 25 May 2017, 23:56
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
Replace your savefile/folder with an sfs storage file
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 5 of 5 [70 Posts]   Goto page: Previous 1, 2, 3, 4, 5
Author Message
nic007


Joined: 13 Nov 2011
Posts: 1994
Location: Cradle of Humankind

PostPosted: Wed 15 Mar 2017, 11:29    Post subject:  

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.
Back to top
View user's profile Send private message 
jd7654

Joined: 06 Apr 2015
Posts: 123

PostPosted: Thu 16 Mar 2017, 01:24    Post subject:  

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
Back to top
View user's profile Send private message 
nic007


Joined: 13 Nov 2011
Posts: 1994
Location: Cradle of Humankind

PostPosted: Thu 16 Mar 2017, 02:35    Post subject:  

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!
Back to top
View user's profile Send private message 
jd7654

Joined: 06 Apr 2015
Posts: 123

PostPosted: Thu 16 Mar 2017, 03:39    Post subject:  

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.
Back to top
View user's profile Send private message 
nic007


Joined: 13 Nov 2011
Posts: 1994
Location: Cradle of Humankind

PostPosted: Thu 16 Mar 2017, 04:26    Post subject:  

Deleted
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 4576
Location: New Zealand

PostPosted: Fri 17 Mar 2017, 14:35    Post subject:  

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:
#! /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)
.
Back to top
View user's profile Send private message 
nic007


Joined: 13 Nov 2011
Posts: 1994
Location: Cradle of Humankind

PostPosted: Fri 17 Mar 2017, 16:06    Post subject:  

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.
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 4576
Location: New Zealand

PostPosted: Sat 18 Mar 2017, 01:18    Post subject:  

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.
Back to top
View user's profile Send private message 
nic007


Joined: 13 Nov 2011
Posts: 1994
Location: Cradle of Humankind

PostPosted: Mon 20 Mar 2017, 05:26    Post subject:  

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:
alsactl -f /etc/asound.state store
Back to top
View user's profile Send private message 
slavvo67

Joined: 12 Oct 2012
Posts: 1353
Location: The other Mr. 305

PostPosted: Thu 06 Apr 2017, 17:36    Post subject:  

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
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 5 of 5 [70 Posts]   Goto page: Previous 1, 2, 3, 4, 5
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1490s ][ Queries: 15 (0.0111s) ][ GZIP on ]