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 Tue 21 Oct 2014, 23:39
All times are UTC - 4
 Forum index » House Training » Bugs ( Submit bugs )
problem with "init" script in Slacko 5.7 and likely others
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
gyro

Joined: 28 Oct 2008
Posts: 481
Location: Brisbane, Australia

PostPosted: Fri 09 May 2014, 03:04    Post_subject:  problem with "init" script in Slacko 5.7 and likely others
Sub_title: finds save files, then ignores them
 

Recently I've been playing with the "init" scripts of both Slacko 5.7 and Dpup Wheezy 3.5.2.11. I did the testing on Slacko, but the 'init' script for Wheezy has identical code in the relevant places. So I think that the problem is not peculiar to Slacko.

Problem:
if you look at the "find" code, (in Slacko line 520)
Code:
    [ "$FND_PUPSAVES" = "" ] && FND_PUPSAVES="`find /mnt/data -maxdepth 1 -xdev -type f -iname ${DISTRO_FILE_PREFIX}save*.[234]fs | grep -v ' ' | sed -e 's%^/mnt/data%%' | tr '\n' ' '`"
It appears that even if puppy is installed in a psubdir, the save file can be in the root of the partition.
I did a fresh frugal install of Slacko in a psubdir on an ext3 partition.
I rebooted a couple of times to ensure that the save file was stable and working.
Using a different puppy on the same machine, I moved the save file from the psubdir to the root of the partition, and rebooted into my test Slako.
Lo, the save file was not used, it booted into pupmode 5.

On investigation I found that the save file had been found by the "find" code, as it was in "/initrd/tmp/PUPSAVES-complete". But it appears to have been discarded by the following code, (line 907 in Slacko 5.7)
Code:
   grep "${PSUBDIR}/" /tmp/PUPSAVES > /tmp/PUPSAVES2 #note: need this as above probing may have got some invalid hits.

So, what's the point in "find"ing the save file, if it's only going to be ignored?

Possible fixes:
1) Remove the apparently useless "find" code.
2) Remove the code that discards perfectly good save files.
3) Fix the discarding code so that it doesn't throw away good stuff.

1) and 2) look quite doable.
3) I've no idea, because I don't know what bad stuff it's trying to discard.

gyro
Back to top
View user's profile Send_private_message 
mavrothal


Joined: 24 Aug 2009
Posts: 1686

PostPosted: Fri 09 May 2014, 07:24    Post_subject:  

When the find is done, puppy does not know the boot arguments, so it finds all possible savefiles.
When the boot arguments is presented then the other savefiles are ignored.
One could add the option for additional savefiles to be considered if no savefiles are found in the puppy_folder but I believe that the option was added exactly so other savefiles will be ignored when puppy is installed in a folder.
Of course the search could be done after boot arguments were considered but given the plurality of puppy installation option and progressive developemt, I guess the idea was "find everything and eliminate latter".

_________________
Kids all over the world go around with an XO laptop. They deserve one puppy (or many) too Very Happy
Back to top
View user's profile Send_private_message 
gyro

Joined: 28 Oct 2008
Posts: 481
Location: Brisbane, Australia

PostPosted: Fri 09 May 2014, 09:07    Post_subject:  

mavrothal wrote:
When the find is done, puppy does not know the boot arguments, so it finds all possible savefiles.
When the find is being done, it certainly knows about psubdir.

gyro
Back to top
View user's profile Send_private_message 
bigpup


Joined: 11 Oct 2009
Posts: 5233
Location: Charleston S.C. USA

PostPosted: Tue 13 May 2014, 08:00    Post_subject:  

I remember something being changed in the code to control which save file gets used for what.

The thinking was if Puppy is installed to a directory all the Puppy files for it should be in that directory. If something was found outside that directory, it was not for that install, so needed to be ignored.

_________________
I have found, in trying to help people, that the things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected Shocked
Back to top
View user's profile Send_private_message 
gyro

Joined: 28 Oct 2008
Posts: 481
Location: Brisbane, Australia

PostPosted: Thu 15 May 2014, 09:00    Post_subject:  

bigpup wrote:
The thinking was if Puppy is installed to a directory all the Puppy files for it should be in that directory. If something was found outside that directory, it was not for that install, so needed to be ignored.
That's fine, but then why bother "find"ing it in the first place?
gyro
Back to top
View user's profile Send_private_message 
mikeb


Joined: 23 Nov 2006
Posts: 8344

PostPosted: Thu 15 May 2014, 09:22    Post_subject:  

You question the logic until you realise there probably was none.. Wink

mike
Back to top
View user's profile Send_private_message 
slavvo67

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

PostPosted: Thu 15 May 2014, 20:26    Post_subject:  

Ouch! That one hurt!
Back to top
View user's profile Send_private_message 
bigpup


Joined: 11 Oct 2009
Posts: 5233
Location: Charleston S.C. USA

PostPosted: Thu 15 May 2014, 21:37    Post_subject:  

A lot of Puppy code was hacked, as needed, to fix a problem.
No one ever took the time to rewrite the whole thing.
As long as the code change, worked, and did not break something else, that was all that was done.
This is an example of such hacking.

Barry K. was the main individual that controlled this.
He has moved on and left the building.

The only real testing of code is by us users.
The only real code changes are made by, again, us.

If you think you have a better way.
Code away.

We will help if we can.

Submit for inclusion into Woof-CE when you are done.

What Puppy does or does not do is all up to us.

_________________
I have found, in trying to help people, that the things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected Shocked
Back to top
View user's profile Send_private_message 
mikeb


Joined: 23 Nov 2006
Posts: 8344

PostPosted: Fri 16 May 2014, 07:47    Post_subject:  

Indeed... and projects like the save directory are opportunities to re look at the code.

I suppose the comparison is of the average cities developement growing from a small hamlet to urban sprawl with short term cludges in design along the way.

Out of the ashes the pheonix rises.....

mike
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » Bugs ( Submit bugs )
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0698s ][ Queries: 11 (0.0113s) ][ GZIP on ]