Page 2 of 4

Posted: Thu 09 Jul 2015, 04:04
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

Posted: Mon 13 Jul 2015, 04:39
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

Updated to version 5

Posted: Mon 13 Jul 2015, 07:34
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

Posted: Mon 13 Jul 2015, 08:13
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.

Posted: Mon 13 Jul 2015, 09:08
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

Posted: Mon 13 Jul 2015, 11:57
by gyro
@boof
I've never tried it on USB, only HD.
I'll give it a try.
gyro

Posted: Mon 13 Jul 2015, 13:15
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

Posted: Mon 13 Jul 2015, 13:30
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

Posted: Mon 13 Jul 2015, 15:57
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

Posted: Mon 13 Jul 2015, 20:39
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

Posted: Tue 14 Jul 2015, 07:17
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

Posted: Tue 14 Jul 2015, 15:15
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..

Posted: Tue 14 Jul 2015, 18:37
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.

Posted: Wed 15 Jul 2015, 00:33
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.

Posted: Wed 15 Jul 2015, 08:44
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

Posted: Wed 15 Jul 2015, 09:56
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

Updated to version 6

Posted: Wed 15 Jul 2015, 10:10
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

For those using SAVEMARK

Posted: Wed 15 Jul 2015, 10:16
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

Posted: Thu 16 Jul 2015, 03:17
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.

Posted: Fri 17 Jul 2015, 09:34
by boof
have burned iso with initrdgz V6 onto CD. Boots but can't find sfs file...