Avoid "Searching for Puppy files" during bootup - revisited

Under development: PCMCIA, wireless, etc.
Message
Author
User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#31 Post by technosaurus »

WOW, I can't believe how overly complex this has become ... when it could just be a single parameter SFS= with a ',' separated list of files to mount and use full paths vs. search if an item in the list starts with '/'

Here is some blah template code example ... mount_sfs omitted for brevity ... needs to be updated for overlayfs anyhow

Code: Select all

file_missing(){
	echo "$1 not found, add the appropriate mount point to MNT="
}

autoload_sfs(){
	for MTPT in /mnt/*; do
		[ -f "$MTPT/$1" ] && mount_sfs "$MTPT/$1" && break
	done
	file_missing "$1"
}


load_sfs(){
	[ -f "$1" ] && mount_sfs "$1" || file_missing "$1"
}

mount_sfs(){
	echo "mounting $1" #etc... and so forth
}

handle_sfs_list(){
	while ([ "$1" ]) do
		case "$1" in
		/*)load_sfs "$1";;
		*)[ "$NOSEARCH" ] || autoload_sfs "$1";;
		esac
		shift
	done
}

SFS=a.sfs,/mnt/sda1/b.sfs,...
IFS=","
handle_sfs_list $SFS
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#32 Post by gyro »

technosaurus wrote:WOW, I can't believe how overly complex this has become
Some of the complexity comes from trying to efficiently integrate it into the 'init' script.
technosaurus wrote:when it could just be a single parameter SFS= with a ',' separated list of files to mount and use full paths vs. search if an item in the list starts with '/'
Are you suggesting that this code in the 'init' script

Code: Select all

#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
is obsolete?

gyro

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

Updated to version 5

#33 Post by gyro »

This version greatly simplifies the code at the expense of a little processing inefficiency.
Instead of reading the file "PUPSTATE" directly from the savefile/savefolder, it looks for it in the frugal install directory. So it doesn't have to wait until the savefile/savefolder is available before making the final decision.

To use:
1) Put patched "initrd.gz" in the frugal install directory.
2) Reboot to show that everything is still the same.
3) Copy "/etc/rc.d/PUPSTATE" to the frugal install directory.
4) Add "nosearch=sda3" as boot parameter (using appropriate partition instead of "sda3").
5) Reboot.

The "nosearch" facility can be deactivated by either removing the "nosearch" boot parameter or deleting the "PUPSTATE" file in the frugal install directory.

To add an adrv or ydrv to the boot:
1) delete the copy of "PUPSTATE" in the frugal install directory.
2) Reboot.
3) Copy "/etc/rc.d/PUPSTATE" to the frugal install directory.
4) Reboot

See first post for download.

gyro

boof
Posts: 579
Joined: Wed 26 Sep 2012, 22:53

#34 Post by boof »

have downloaded version 3 of initxxxxx file and done all preparations. USB boots until

searching for sfs files

kernel panic unable to mount VFS root fs not mounted to (2.0)

Then a "debug" readout that I can't copy & paste and machine hangs with caps lock light flashing.

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#35 Post by mikeb »

Some of the complexity comes from trying to efficiently integrate it into the 'init' script.
well that is the heart of the matter... fiddling with the window boxes is fine but sometimes its worth peeking in the basement at the foundations.

Shinobar had the same problem...large scripts trying to cater for all the hoplessly messy puppyisms and variations.

My init in initrd is around 25k...thats a lot less crap to try and work around.

Its not a diff or 2 needed but a complete rewrite/re-evaluation.

I am sure gyro you could do a much better job yourself.
see whats needed...cut out things that are hopelessly obsolete and make a script to do the job...ps the cpio initrd adds to the complexity by the way. You could add nice features like better sfs handling.

mike

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#36 Post by gyro »

@boof
I've never tried it on USB, only HD.
I'll give it a try.
gyro

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#37 Post by gyro »

@boof,
I tried both version 3 and version 5 on a fat32 sdcard.
I didn't get any kernel panic's, everything just worked as normal. When I specified a "nosearch" situation, this was simply ignored and "searching" happened as usual.
So, no crashes, but achieved nothing.

gyro

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#38 Post by gyro »

mikeb wrote:I am sure gyro you could do a much better job yourself.
Thanks for the vote of confidence.
The 'init' script is showing it's age, but to re-write it would be a large task which is unlikely to come to the top of my to-do list in the foreseeable future.
gyro

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#39 Post by mikeb »

Thats ok gyro... understandable. And you definitely have my vote :)

Actually I cheated and used puppy 2.12 init as a base...cleaned it up at first and the added a few goodies...it was originally 45k....
Sometimes it is easier to have some sort of framework to start with.

One thing that must be easier now is having usb drivers built into the kernel...all the slow/fast drive detection was messy and after all..who in their right mind would use usb 1 for a puppy...well I did...it was painful. :D
It does question the need for PUPMODE=13 but the idea of using ram for changes is valid but in a modified form... more like multisession really.

mike

boof
Posts: 579
Joined: Wed 26 Sep 2012, 22:53

#40 Post by boof »

frugal install v5 on usb with 6.0.2:gives:


booting the kernel
kernel panic cannot mount VFS: unable to mount root fs on unknown-block(2.0)

I also tried changing

nosearch sdxx to
search sdyy
but it made no difference to the msg.

###############################

seems not to have detected sdb2? Will try last line of syslinux.cfg

append initrd=initrd.gz pmedia=usbflash pfix=ram

same error

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#41 Post by gyro »

@boof
What filesystem do you have on USB?
Is it a stick or usb drive?

Could you please go back to the standard "initrd.gz" and prove that it boots Ok.
Then replace "initrd.gz" with the patched "initrd.gz", but change nothing else. Does it still boot?

gyro

boof
Posts: 579
Joined: Wed 26 Sep 2012, 22:53

#42 Post by boof »

its a usb stick, 8GB.

oem initrd.gz does not work either===does not find sfs file on usb or cd. Puppy is installed fully on sda2. and boots ok..
Last edited by boof on Wed 15 Jul 2015, 00:34, edited 1 time in total.

gcmartin

#43 Post by gcmartin »

Hello @Boof

I think @Gyro want info from this terminal command while your USB stick in plugged in.

Code: Select all

# fdisk -l
. Post it if you can.

boof
Posts: 579
Joined: Wed 26 Sep 2012, 22:53

#44 Post by boof »

Unfortunately, I'm working blind. I have no understanding of what I'm doing, tho' I will do as instructed if I can.
Attachments
pic2.png
(212.08 KiB) Downloaded 380 times

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#45 Post by mikeb »

Sounds like this problem needs a fresh thread as its not really about gyros modifications or that's how i read it.

Sounds like there is more than one initrd.gz around which may affect it... or you have boot parameters to consider.... the partitioning itself should no longer be an obstacle.

mike

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#46 Post by gyro »

@boof,
Sorry, but you need to get the release version of Tahrpup 6.0.2 working first, before you can test this modified "initrd.gz".
gyro
Last edited by gyro on Wed 15 Jul 2015, 10:10, edited 1 time in total.

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

Updated to version 6

#47 Post by gyro »

Version 6 should work with usb devices.
Version 5 could not.

I recommend that you upgrade to version 6.

See first post for downloads.

I tested this on a 4GB usbstick, doing manual frugal installs using the Tahrpup 6.0.2 files directly out of the iso, but replacing the "initrd.gz" with my patched version.
In each case I copied the puppy files onto the freshly partitioned usbstick, and then ran "Grun4Dos bootloader config", installing the "bootup loader" in the MBR of the usbstick.

Test1: all of stick formatted as fat32 by windows 8.1, worked.
Test2: 100MiB fat32 partition for booting, remainder of stick an ext4 partition containing the puppy files, worked.

gyro

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

For those using SAVEMARK

#48 Post by gyro »

Since "/mnt/home" is the partition where your savefile/savefolder is stored, it's probably more convenient to copy "PUPSTATE" there beside the savefile/savefolder.
Just ensure that the "nosearch=sd??" boot parameter specifies the partition that "PUPSTATE" was copied to.

gyro

boof
Posts: 579
Joined: Wed 26 Sep 2012, 22:53

#49 Post by boof »

BECAUSE I have updated my system, the.sfs in the iso is invalid. I can't mount it to use the universal installer. I DO wish the universal installer would install ANY puppy version, not just its own. I'm advised there is an sfs version updater in the utilities menu, but I don't recognise a name or know how to use it. Advice pls.

boof
Posts: 579
Joined: Wed 26 Sep 2012, 22:53

#50 Post by boof »

have burned iso with initrdgz V6 onto CD. Boots but can't find sfs file...

Post Reply