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 Sun 26 Oct 2014, 00:09
All times are UTC - 4
 Forum index » House Training » Bugs ( Submit bugs )
Pupsave Creation at First Shutdown [Alternative Solution]
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 3 of 4 Posts_count   Goto page: Previous 1, 2, 3, 4 Next
Author Message
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
Location: Kiel,Germany

PostPosted: Sat 30 Nov 2013, 04:58    Post_subject:  

Quote:
echo "Let's begin."
echo
mount /dev/sda1 /mnt/sda1 >/dev/null 2>&1
cd /mnt/sda1
echo "Here are the names of some common Puppies:"
echo

WOW ! /dev/null for trouble shooting. Very informative. Thanks. Common in Puppyland .
Confused

_________________
«Give me GUI or Death» -- I give you [[Xx]term[inal]] [[Cc]on[s][ole]] .
Macpup user since 2010 on full installations.
People who want problems with Puppy boot frugal Razz
Back to top
View user's profile Send_private_message Visit_website 
L18L

Joined: 19 Jun 2010
Posts: 2530
Location: Moved from Hosla to www.eussenheim.de

PostPosted: Sat 30 Nov 2013, 09:12    Post_subject:  

Karl Godt wrote:
Quote:
...
echo "Here are the names of some common Puppies:"
...

WOW ! /dev/null for trouble shooting. Very informative. Thanks. Common in Puppyland .
Confused

...and here is the full list: Puppy Derivatives Laughing Laughing
Back to top
View user's profile Send_private_message 
musher0


Joined: 04 Jan 2009
Posts: 4259
Location: Gatineau (Qc), Canada

PostPosted: Sat 30 Nov 2013, 16:37    Post_subject:  

Thank you, gentlemen. Your feedback is appreciated.

@Karl:
Check for (open) sda1 partition is now done at the start in an if...else
structure.

@L18N
"some" changed to "recent".
    Your URL points to a thread on derivatives -- also of Puppy clubs. It's
    useful, but this script would need a full list of the "pupsave" file names,
    if it exists, not of the actual Puppies.

    It might be very long, so no other edit is envisioned on this sub-subject; I
    leave it to the user, to be careful.

Again, thank you both for your input.

Best regards.

musher0
~~~~~~~~~~~~~~
Edit, Nov. 30, 2013.
To the user: I've left this attachment for historical purposes, but please use the new, more precise one, located below. Thanks.
alt-pupsave-create2.zip
Description 
zip

 Download 
Filename  alt-pupsave-create2.zip 
Filesize  1.3 KB 
Downloaded  110 Time(s) 

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)

Edited_time_total
Back to top
View user's profile Send_private_message Visit_website 
musher0


Joined: 04 Jan 2009
Posts: 4259
Location: Gatineau (Qc), Canada

PostPosted: Sat 30 Nov 2013, 18:20    Post_subject:  

@L18N
This additional edit presents the list of recent pupsave filenames with
some checking within a case...esac structure. Thanks for the unlikely
"inspiration" ! Laughing

BFN.

musher0
~~~~~~~~~~
To the user:
Attachment left here for historical purposes. Please use version 4 below. Thanks.
alt-pupsave-create3.zip
Description 
zip

 Download 
Filename  alt-pupsave-create3.zip 
Filesize  1.53 KB 
Downloaded  100 Time(s) 

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)

Edited_time_total
Back to top
View user's profile Send_private_message Visit_website 
L18L

Joined: 19 Jun 2010
Posts: 2530
Location: Moved from Hosla to www.eussenheim.de

PostPosted: Sun 01 Dec 2013, 05:20    Post_subject:  

musher0 wrote:
...Thanks for the unlikely
"inspiration" ! Laughing

Maybe another inspiration:

running your script it wrote:
ls: cannot access /mnt/sda1: No such file or directory
Please mount partition /mnt/sda1 and restart the script.
If you are on a diskless station, burn your Puppy on
DVD and use it in multi-session mode; this script is of
no use to you.
#

Really, of no use for me but hopefully for others.
Back to top
View user's profile Send_private_message 
musher0


Joined: 04 Jan 2009
Posts: 4259
Location: Gatineau (Qc), Canada

PostPosted: Sun 01 Dec 2013, 10:16    Post_subject:  

L18L wrote:
musher0 wrote:
...Thanks for the unlikely
"inspiration" ! Laughing

Maybe another inspiration:

running your script it wrote:
ls: cannot access /mnt/sda1: No such file or directory
Please mount partition /mnt/sda1 and restart the script.
If you are on a diskless station, burn your Puppy on
DVD and use it in multi-session mode; this script is of
no use to you.
#

Really, of no use for me but hopefully for others.


Hi, L18L.

I realize this script will be useful for only a few users.

A clarification if I may: are you running on a diskless machine or is your
sda1 partition simply not mounted?

What is
Code:
blkid | grep "v/sr"

telling you?

Thanks in advance.

musher0
~~~~~~~~
Edit: ok, got it. Will use blkid in combination with ls for finer detection.

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send_private_message Visit_website 
musher0


Joined: 04 Jan 2009
Posts: 4259
Location: Gatineau (Qc), Canada

PostPosted: Sun 01 Dec 2013, 13:33    Post_subject:  

Hello, all.

Another edit. This version provides additionnal checks: for ntfs drive and diskless computer.
Any constructive comments will be welcome.

Best regards.

musher0
alt-pupsave-create4.tar.bz2
Description 
bz2

 Download 
Filename  alt-pupsave-create4.tar.bz2 
Filesize  1.92 KB 
Downloaded  103 Time(s) 

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send_private_message Visit_website 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
Location: Kiel,Germany

PostPosted: Sun 01 Dec 2013, 17:32    Post_subject:  

There is the
Code:
mkdir -p /mnt/"$DRV"
missing..

Still /dev/null ..

No rox /mnt/"$DRV" .. to check for progress at least at the end ..

If I get error messages a clear will erase them ..

Nicely written and readable, but content is less than the eye .
Back to top
View user's profile Send_private_message Visit_website 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
Location: Kiel,Germany

PostPosted: Sun 01 Dec 2013, 17:59    Post_subject:  

And almost forgotten to mention that error checks are missing .

Code:
mkdir -p /mnt/"$DRV"
mount /dev/"$DRV" /mnt/"$DRV"
[ $? = 0 ] || { echo "Sorry.. unable to mount  /dev/$DRV /mnt/$DRV . Exiting.";exit 1; }
# Thanks to Karl_Godt for the feedback. Nov. 30, 2013.


Code:
dd if=/dev/zero of="$NOM"save-arf.2fs bs=1k count=393000
[ $? = 0 ] || { echo "Sorry.. unable to create savefile correctly. Exiting."; return 1; }
mkfs.ext2 -q -m 0 -F "$NOM"save-arf.2fs
[ $? = 0 ] || { echo "Sorry.. unable to create filesystem in savefile. Exiting."; return 1; }
return 0


Code:
       create
       [ $? = 0 ] || { echo "Some error occurred. Exiting. Sorry."; exit 1; }
       ;;


Code:
      if [ "$A" = "y" ];then
      create
      [ "$?" = 0 ] || { echo "Some error occurred. Exiting. Sorry."; exit 1; }
Back to top
View user's profile Send_private_message Visit_website 
musher0


Joined: 04 Jan 2009
Posts: 4259
Location: Gatineau (Qc), Canada

PostPosted: Sun 01 Dec 2013, 19:16    Post_subject:  

Karl Godt wrote:
There is the
Code:
mkdir -p /mnt/"$DRV"
missing..

Still /dev/null ..

No rox /mnt/"$DRV" .. to check for progress at least at the end ..

If I get error messages a clear will erase them ..

Nicely written and readable, but content is less than the eye .


Hi, Karl.

The above are now incorporated. Thanks.

As to your suggestions in the following post, the error check for the
"create" function is a good idea. The other ones seem to be more
trouble than they're worth, though.

I double-checked and the >/dev/null 2>&1 actually prevents an error,
given the context. Also, in the sequence
Code:
if [ "$A" = "y" ];then

(line 91). the "else" statement is the error catcher. There is no need to
specifically error-catch the error-catcher, I think; the logic of the if-else-fi
structure does it.

Paranoia can be a virtuous sickness, you know. Wink

So here is version 5.

BFN.

musher0
alt-pupsave-create5.tar.bz2
Description 
bz2

 Download 
Filename  alt-pupsave-create5.tar.bz2 
Filesize  1.97 KB 
Downloaded  96 Time(s) 

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send_private_message Visit_website 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
Location: Kiel,Germany

PostPosted: Sun 01 Dec 2013, 21:59    Post_subject:  

Banned 2 weeks for bad code.
Banned 2 additional weeks for being undiscerning , unregenerate and hanging tough.


Razz
Back to top
View user's profile Send_private_message Visit_website 
musher0


Joined: 04 Jan 2009
Posts: 4259
Location: Gatineau (Qc), Canada

PostPosted: Mon 02 Dec 2013, 05:19    Post_subject:  

Karl Godt wrote:
Banned 2 weeks for bad code.
Banned 2 additional weeks for being undiscerning , unregenerate and hanging tough.

Razz


hehe

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send_private_message Visit_website 
L18L

Joined: 19 Jun 2010
Posts: 2530
Location: Moved from Hosla to www.eussenheim.de

PostPosted: Mon 02 Dec 2013, 05:47    Post_subject:  

musher0 wrote:
Karl Godt wrote:
Banned 2 weeks for bad code.
Banned 2 additional weeks for being undiscerning , unregenerate and hanging tough.

Razz


hehe

Thus poor musher0 will have to wait for my answer until 30 of december Crying or Very sad
Back to top
View user's profile Send_private_message 
musher0


Joined: 04 Jan 2009
Posts: 4259
Location: Gatineau (Qc), Canada

PostPosted: Mon 02 Dec 2013, 06:14    Post_subject:  

L18L wrote:
musher0 wrote:
Karl Godt wrote:
Banned 2 weeks for bad code.
Banned 2 additional weeks for being undiscerning , unregenerate and hanging tough.

Razz


hehe

Thus poor musher0 will have to wait for my answer until 30 of december Crying or Very sad


What a big loss that will be. Very Happy Twisted Evil

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send_private_message Visit_website 
musher0


Joined: 04 Jan 2009
Posts: 4259
Location: Gatineau (Qc), Canada

PostPosted: Mon 02 Dec 2013, 07:11    Post_subject:  

Hello, all.

Here is version 5a. Only a cosmetic change:
Removed the thanks to the two crackpots above. Wink Twisted Evil

musher0
alt-pupsave-create5a.zip
Description 
zip

 Download 
Filename  alt-pupsave-create5a.zip 
Filesize  1.96 KB 
Downloaded  108 Time(s) 

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send_private_message Visit_website 
Display_posts:   Sort by:   
Page 3 of 4 Posts_count   Goto page: Previous 1, 2, 3, 4 Next
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.0970s ][ Queries: 13 (0.0096s) ][ GZIP on ]