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 18 Jun 2013, 17:25
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
How to utilise pre-made, empty save-file in latest pups
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count_1  
Author Message
MinHundHettePerro


Joined: 05 Feb 2009
Posts: 833
Location: SE

PostPosted: Tue 13 Nov 2012, 21:24    Post_subject:  How to utilise pre-made, empty save-file in latest pups  

Hello Smile!

The long-lost ability of a fresh pup to utilise a pre-made, empty, savefile is restored. Cool

Cannot remember exactly when it got lost - 4.3.1?, was definitely there in the 2-series, most likely also in 3-series (and 4.1.2?).

Anyway, I did miss this ability for a long time and have thought, on and off, for a few years to re-instate this function. Today, I finally got around to it Cool.

Why?
- For a tester, or a frequent installer, it saves one reboot ...
- Makes it much easier for a user to implement usage of savefile file-systems other than ext?, not requiring pup-shutdown to create the savefile ...

For pupmode 12, it was easy - just some small changes in /etc/rc.d/rc.update ...

For pupmode 13 (pmedia=ataflash and usbflash), there were kernel panics until a small change in initrd.gz, inhibiting the sourcing of a non-existant file (in pup_ro_1) ...

Diffs of changes to /etc/rc.d/rc.update and initrd.gz_/init are provided for slacko-5.3.7.1 (slacko beta 4).

Code:
--- /mnt/+mnt+home+spup5371+_bak_puppy_slacko_5.3.7.1.sfs/etc/rc.d/rc.update   2012-11-03 11:26:01.000000000 +0100
+++ rc.update   2012-11-14 00:21:27.000000000 +0100
@@ -48,6 +48,16 @@
 
 [ "$PUPMODE" = "" ] && exit
 
+# MHHP 121113, For to, again, allow for a pre-made, empty, pupsave-file in PUPOMODEs 12 &13 without loosing desktop icons etc.
+case $PUPMODE in
+  "12"|"13")
+    [ ! -d /initrd"$SAVE_LAYER"/root ] && [ ! -d /initrd"$SAVE_LAYER"/usr ] && [ ! -d /initrd"$SAVE_LAYER"/var ] && PUPMODE_org="$PUPMODE" && PUPMODE="5"
+  ;;
+  *)
+  ;;
+esac
+# /MHHP
+
 case $PUPMODE in
  "7") #tmpfs (pup_rw), hd for persistent storage (pup_ro1), ${DISTRO_PUPPYSFS} (pup_ro2).
   NEWFILESMNTPT="/initrd/pup_ro2"
@@ -181,6 +191,8 @@
  ;;
 esac
 
+[ $PUPMODE_org ] && PUPMODE="$PUPMODE_org" && unset $PUPMODE_org # MHHP 121113
+
 . $NEWFILESMNTPT/etc/DISTRO_SPECS #w020 has DISTRO_VERSION, DISTRO_BINARY_COMPAT, DISTRO_FILE_PREFIX
 
 NEWPVERSION="`grep '^DISTRO_VERSION' $NEWFILESMNTPT/etc/DISTRO_SPECS | cut -f 2 -d '=' | cut -f 2 -d '"' | cut -f 2 -d "'" | cut -f 1 -d ' '`" #110422

Code:
--- initrd-tree_org/init   2012-11-13 23:57:00.000000000 +0100
+++ initrd-tree_new/init   2012-11-14 02:18:29.000000000 +0100
@@ -1490,7 +1490,11 @@
 #older ${DISTRO_FILE_PREFIX}save.2fs <v2.16 will not have this file...
 [ ! -f $OLDFILESMNTPT/etc/rc.d/BOOTCONFIG ] && touch $OLDFILESMNTPT/etc/rc.d/BOOTCONFIG
 #note, OLDFILESMNTPT can also be "" so BOOTCONFIG needs to exist in initrd also.
-. $OLDFILESMNTPT/etc/rc.d/BOOTCONFIG #can have EXTRASFSLIST variable.
+
+# . $OLDFILESMNTPT/etc/rc.d/BOOTCONFIG #can have EXTRASFSLIST variable. # MHHP 121113
+# In case a pre-made, empty save-file is supplied, for PUPMODE 13, it cannot be touched by the previous command; sourcing a non-existant file in the following line results in kernel-panic, so let's test if $OLDFILESMNTPT/etc/rc.d/BOOTCONFIG exists, and skip sourcing if non-existant.
+[  -f $OLDFILESMNTPT/etc/rc.d/BOOTCONFIG ] && . $OLDFILESMNTPT/etc/rc.d/BOOTCONFIG #can have EXTRASFSLIST variable.
+# /MHHP
 
 #110217 very bad hack, see /etc/rc.d/rc.update, rc.shutdown.
 [ ! -f $OLDFILESMNTPT/var/local/etc_profile_at_shutdown ] && cp -f $OLDFILESMNTPT/etc/profile $OLDFILESMNTPT/var/local/etc_profile_at_shutdown


EDIT:
Yes, I should probably have mentioned that this is mainly for woofers to use, or for those wanting to play around extensively with a certain version of puppy (unsquashing - patching - re-squashing your pupxxx.sfs) Smile.


Cheers Smile/ MHHP

_________________
Celeron 2.8 GHz, 1 GiB RAM, i82845 graphics, many partitions, Pupmode 12 (13)
Mostly running Slacko & 214X
Nämen, vaf.... ln -s /dev/null MHHP
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count_1  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » HOWTO ( Solutions )
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.0434s ][ Queries: 11 (0.0062s) ][ GZIP on ]