The long-lost ability of a fresh pup to utilise a pre-made, empty, savefile is restored.
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 .
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).
EDIT 130818 with improvements to the rc.update patch. (Diffed against Slacko-56_4G)
Code: Select all
--- rc.update.orig 2013-08-18 14:29:09.000000000 +0200
+++ rc.update 2013-08-18 17:02:23.286719035 +0200
@@ -71,6 +71,17 @@
fi
}
+# MHHP 130818, For to, again, allow for a pre-made, empty, pupsave-file in PUPOMODEs 12 &13 without loosing desktop icons etc.
+S_LAYER=`grep '^SAVE_LAYER=' /etc/rc.d/PUPSTATE | cut -f 2 -d '='|cut -f 2 -d "'"`
+case $PUPMODE in
+ "12"|"13")
+ [ ! -d /initrd"$S_LAYER"/root ] && [ ! -d /initrd"$S_LAYER"/usr ] && [ ! -d /initrd"$S_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"
@@ -198,6 +209,8 @@
;;
esac
+[ $PUPMODE_org ] && PUPMODE="$PUPMODE_org" && unset PUPMODE_org && unset S_LAYER # MHHP 130818
+
. $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: Select all
--- 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
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) .
Cheers / MHHP