The time now is Sat 27 Feb 2021, 12:35
All times are UTC - 4 |
Page 1 of 5 [62 Posts] |
Goto page: 1, 2, 3, 4, 5 Next |
Author |
Message |
gyro
Joined: 28 Oct 2008 Posts: 1799 Location: Brisbane, Australia
|
Posted: Thu 25 Jun 2015, 05:27 Post subject:
Avoid "Searching for Puppy files" during bootup - revisited Subject description: now a version 4 and a version 6 - works with usb |
|
This has been inspired by Wognath's topic by a very very similar name, http://www.murga-linux.com/puppy/viewtopic.php?t=99212.
In particular his comment "The idea is that once Puppy has been run, all the info found in the Searching... section is recorded in PUPSTATE."
However I've implemented the concept in a rather different way, hence the different topic.
The most significant difference is that the "init" script is patched from the start.
Version 3:
Withdrawn, continued as version4.
Version 4:
It continues to work just like the standard "init" until you specify a "nosearch" boot parameter. e.g "nosearch=sda3:/tahr/tahrsave.2fs".
Then it uses the specified file/directory as the savefile/savefolder, bypasses the "Searching for Puppy files" code, and includes the "/etc/rc.d/PUPSTATE" file from the savefile/savefolder, thus setting all the relevant variables that are usually set via the "Searching for Puppy files" code.
At least 1 boot must be done with the savefile/savefolder in place to ensure that "PUPSTATE" is appropriately setup, before the "nosearch" boot parameter is specified.
The "init" script will revert to normal processing, if the "nosearch" boot parameter is removed, or "pfix=ram" is specified.
So if you want to add a ydrv, move the ydrv file into the frugal install directory, reboot without the "nosearch" parameter, reboot with the "nosearch" parameter.
Version 5:
Withdrawn, could not work with usb devices.
Version 6:
Same as version 5 but fixed to work with usb devices.
Searching for puppy files is avoided if a "nosearch" boot parameter specifies the partition containing a copy of the file "PUPSTATE" in the frugal install directory, e.g. "nosearch=sda3".
See later post for version 5 for more info.
You don't need to patch the "init" script yourself, you only need a patched "initrd.gz" for your particular puppy.
This has been tested in pupmode=12.
It should work in pupmode=13, and might work in pupmode=6 and pupmode=7.
Patched "initrd.gz" files for tahrpup 6.0.2 are available here:
noPAE: initrd_nosearch_nopae.gz
PAE: initrd_nosearch_pae.gz
Edit: these have been withdrawn, they crash if the specified file does not exist.
Please use version 4.
Edit: Uploaded version 4 of patch. A major rewrite to avoid extra mount and umount.
Patched "initrd.gz" files for tahrpup 6.0.2 are available here:
noPAE: http://www.fishprogs.software/puppy/tahr602/initrd_nosearch_nopae-4.gz
PAE: http://www.fishprogs.software/puppy/tahr602/initrd_nosearch_pae-4.gz
Edit: version 5
A major rewrite to simplify the code.
Edit: version 6
Fixed to work with usb devices.
Patched "initrd.gz" files for tahrpup 6.0.2 are available here:
noPAE: http://www.fishprogs.software/puppy/tahr602/initrd_nosearch_nopae-6.gz
PAE: http://www.fishprogs.software/puppy/tahr602/initrd_nosearch_pae-6.gz
Download, rename to "initrd.gz", move to frugal install directory, reboot.
I have also attached a gziped patch file for the "init" script in "initrd.gz".
Download, gunzip to produce "init.nosearch-6.diff", extract "init" from "initrd.gz", patch "init" with "init.nosearch-6.diff", re-compress "initrd.gz" containing patched "init", reboot.
gyro
 |
Description |
gunzip to produce file "init.nosearch-4.diff"
|

Download |
Filename |
init.nosearch-4.diff.gz |
Filesize |
1.62 KB |
Downloaded |
405 Time(s) |
Description |
gunzip to produce file "init.nosearch-6.diff"
|

Download |
Filename |
init.nosearch-6.diff.gz |
Filesize |
714 Bytes |
Downloaded |
437 Time(s) |
Last edited by gyro on Wed 19 Aug 2015, 10:11; edited 11 times in total
|
Back to top
|
|
 |
Keef

Joined: 20 Dec 2007 Posts: 1001 Location: Staffordshire
|
Posted: Thu 25 Jun 2015, 15:42 Post subject:
|
|
Just tested the tahrpup noPAE initrd.gz on an internal HDD install, using a save folder. Found it instantly.
Nothing else to add really - it does wot it says on the tin.
|
Back to top
|
|
 |
greengeek

Joined: 20 Jul 2010 Posts: 5834 Location: Republic of Novo Zelande
|
Posted: Thu 25 Jun 2015, 18:56 Post subject:
|
|
Do you think this method could work if identifying the partition by UUID number rather than sdx number?
|
Back to top
|
|
 |
mavrothal

Joined: 24 Aug 2009 Posts: 3108
|
Posted: Fri 26 Jun 2015, 03:51 Post subject:
|
|
In my system with 2 disks and 6 partitions $pupsave is 2900-3200msec (depending on mode and partition) faster that the normal init.
One issue that you may want to fix is that it crashes the system if savefile/folder is not found (renamed, misspelled etc). You may want to add a condition that the file/folder/partition exists.
_________________ == Here is how to solve your Linux problems fast ==
|
Back to top
|
|
 |
mikeb

Joined: 23 Nov 2006 Posts: 11331
|
Posted: Fri 26 Jun 2015, 04:44 Post subject:
|
|
Once again gyro doing what should have been done in the first place
fair play to yer ...
Puppy has a pile of boot options ending up pretty much with the slax approach of configuring the system from the vmlinuz line rather than guessing what it is... so it might as well accept that this is how it is and.... erm stop guessing... give it a profession feel eh and yes sooo much faster... in my case if it IS guessing it limits how much of that is done which at least saves time... guessing is really for first boots and quick tests rather than installed systems after all.
mike
|
Back to top
|
|
 |
gyro
Joined: 28 Oct 2008 Posts: 1799 Location: Brisbane, Australia
|
Posted: Fri 26 Jun 2015, 08:53 Post subject:
|
|
mavrothal wrote: | In my system with 2 disks and 6 partitions $pupsave is 2900-3200msec (depending on mode and partition) faster that the normal init. | I make no claims about the speed benefit. I just wanted to prove it could be done another way.
mavrothal wrote: | One issue that you may want to fix is that it crashes the system if savefile/folder is not found (renamed, misspelled etc). You may want to add a condition that the file/folder/partition exists. | Thanks, good catch. Yes, in all my testing I always got it right.
Not as simple as it would seem, since no partition mounted at the time the decision is made, but It should be possible, I'll hopefully get back with an updated patch.
My site is currently down, so I probably won't have replacement "initrd.gz" files.
gyro
Last edited by gyro on Fri 26 Jun 2015, 09:04; edited 1 time in total
|
Back to top
|
|
 |
gyro
Joined: 28 Oct 2008 Posts: 1799 Location: Brisbane, Australia
|
Posted: Fri 26 Jun 2015, 08:59 Post subject:
|
|
Confession:
I forgot to acknowledge technosaurus, who recommended the "pupsfs", "zdrv", "adrv" and "ydrv" boot parameters that are already in "init". My "pupsave" parameter is based on that code, and uses the same format.
gyro
|
Back to top
|
|
 |
mavrothal

Joined: 24 Aug 2009 Posts: 3108
|
Posted: Fri 26 Jun 2015, 10:05 Post subject:
|
|
gyro wrote: | the "pupsfs", "zdrv", "adrv" and "ydrv" boot parameters that are already in "init". |
And they are also missing any checks, so typos result in broken systems
I guess a test_presence() should be setup to to verify the parameters are valid though this may defy the speed up purpose.
_________________ == Here is how to solve your Linux problems fast ==
|
Back to top
|
|
 |
gyro
Joined: 28 Oct 2008 Posts: 1799 Location: Brisbane, Australia
|
Posted: Fri 26 Jun 2015, 11:06 Post subject:
updated patch to init.nosearch-2.diff |
|
I've updated the patch to "init.nosearch-2.diff".
This now checks if the specified savefile/savefolder exists on the specified partition, before skipping "Searching" code.
If the file is not found it writes an error message to the console, and continues on to "Searching" code.
Mounting and umounting a partition just to test the existence of a single file, seems a bit excessive, but that's the obvious way. The decision has to be made before the "Searching" code, (where partitions get mounted).
@mavrothal
The technosaurus parameters setup some variables and then continue into the "Seraching" code, so maybe the testing for the existence of the file could be delayed till after the partition is mounted, but before any "find" commands.
I have not done any testing of these other parameters.
gyro
|
Back to top
|
|
 |
gyro
Joined: 28 Oct 2008 Posts: 1799 Location: Brisbane, Australia
|
Posted: Fri 26 Jun 2015, 11:14 Post subject:
|
|
greengeek wrote: | Do you think this method could work if identifying the partition by UUID number rather than sdx number? | Theoretically it could, but that would require some script code to translate the UUID into the appropriate sdx.
(I have no enthusiasm for even attempting this.)
gyro
|
Back to top
|
|
 |
gyro
Joined: 28 Oct 2008 Posts: 1799 Location: Brisbane, Australia
|
Posted: Fri 26 Jun 2015, 11:21 Post subject:
|
|
@Keef
Thanks for testing.
Unfortunately the version you have, crashes if you misspell the name of the file, as mavrothal discovered.
The fixed version is only available as a patch file, since my site is down.
gyro
|
Back to top
|
|
 |
mavrothal

Joined: 24 Aug 2009 Posts: 3108
|
Posted: Fri 26 Jun 2015, 11:28 Post subject:
Re: updated patch to init.nosearch-2.diff |
|
gyro wrote: |
@mavrothal
The technosaurus parameters setup some variables and then continue into the "Seraching" code, so maybe the testing for the existence of the file could be delayed till after the partition is mounted, but before any "find" commands.
I have not done any testing of these other parameters.
|
Yes they all break the installation.
The following patch works for me, though we could delay the $file.sfs definitions for after ALLPARTS is recorded so the propepart_init call can be avoided. Though as is is not a major delay.
Code: | --- a/init 2015-06-26 18:23:04.840026666 +0300
+++ b/init 2015-06-26 18:20:52.070017775 +0300
@@ -599,12 +599,22 @@
[ $PSUBDIR ] && [ "`echo -n "$PSUBDIR" | cut -c 1`" != "/" ] && PSUBDIR="/${PSUBDIR}" #add leading /.
+test_presence() {
+ FILEEXISTS=''
+ PARTITION="$(echo "$1" | cut -f1 -d ':')"
+ FILETOCHECK="$(echo "$1" | cut -f2 -d ':')"
+ FSTYPE=$(probepart_init -k| grep "$PARTITION" | cut -f2 -d '|')
+ mount -t $FSTYPE /dev/$PARTITION /mnt/data
+ [ -e /mnt/data/$FILETOCHECK ] && FILEEXISTS="true"
+ umount /mnt/data
+}
+
#100915 requested by technosaurus (formats get changed further down)...
-[ $pupsfs ] && PUPSFS=$pupsfs #format partition:<path><filename> ex: sda2:/wary071/wary_071.sfs
-[ $zdrv ] && ZDRV=$zdrv #ex: sda2:/wary071/zdrv_071.sfs
-[ $adrv ] && ADRV=$adrv
-[ $ydrv ] && YDRV=$ydrv
-[ $pupsave ] && PUPSAVE=$pupsave #format partition:<path><filename> ex: sda2:/wary071/warysave.2fs
+[ $pupsfs ] && test_presence $pupsfs && [ "$FILEEXISTS" = "true" ] && PUPSFS=$pupsfs #format partition:<path><filename> ex: sda2:/wary071/wary_071.sfs
+[ $zdrv ] && test_presence $zdrv && [ "$FILEEXISTS" = "true" ] && ZDRV=$zdrv #ex: sda2:/wary071/zdrv_071.sfs
+[ $adrv ] && test_presence $adrv && [ "$FILEEXISTS" = "true" ] && ADRV=$adrv
+[ $ydrv ] && test_presence $ydrv && [ "$FILEEXISTS" = "true" ] && YDRV=$ydrv
+[ $pupsave ] && test_presence $pupsave && [ "$FILEEXISTS" = "true" ] && PUPSAVE=$pupsave #format partition:<path><filename> ex: sda2:/wary071/warysave.2fs
[ $underdog ] && UNDERDOG=$underdog #120130 specify partition for Underdog Linux (refer also underdog.lnx).
|
Ooops, didn't see version 2
Oh well I think all $file.sfs need fixing and my patch is for all of them
_________________ == Here is how to solve your Linux problems fast ==
|
Back to top
|
|
 |
gyro
Joined: 28 Oct 2008 Posts: 1799 Location: Brisbane, Australia
|
Posted: Fri 26 Jun 2015, 11:34 Post subject:
|
|
@mavrothal
I shouldn't allow myself to be limited to the obvious.
I think the decision and hence the check of the existence of the file can be delayed until later in the code.
I'll try my idea tomorrow.
gyro
|
Back to top
|
|
 |
gyro
Joined: 28 Oct 2008 Posts: 1799 Location: Brisbane, Australia
|
Posted: Fri 26 Jun 2015, 11:52 Post subject:
Re: updated patch to init.nosearch-2.diff |
|
mavrothal wrote: | though we could delay the $file.sfs definitions for after ALLPARTS is recorded so the propepart_init call can be avoided. Though as is is not a major delay. | If you look at the code for these right at the beginning of the "Searching" section you will see that some of the decoding is already done.
But I want to play with moving the checks even further down into the code that already mounts the partitions.
I thing that it would be nice to have checks for the the sfs file parameters anyway, even if we never bother seriously implementing the "pupsave" parameter.
gyro
|
Back to top
|
|
 |
mavrothal

Joined: 24 Aug 2009 Posts: 3108
|
Posted: Fri 26 Jun 2015, 11:58 Post subject:
|
|
gyro wrote: |
I'll try my idea tomorrow.
|
OK.
Another concern is the psavemark. In this case we have to make sure that main sfs etc are still found properly when pupsave is defined (though I just looked at the code to see if/how your change may affect this. Did not tested it)
gyro wrote: | If you look at the code for these right at the beginning of the "Searching" section you will see that some of the decoding is already done |
Yes I had seen this though I believe is recorded to /tmp logs at a latter pont
_________________ == Here is how to solve your Linux problems fast ==
|
Back to top
|
|
 |
|
Page 1 of 5 [62 Posts] |
Goto page: 1, 2, 3, 4, 5 Next |
|
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
|