Avoid "Searching for Puppy files" during bootup - revisited

Under development: PCMCIA, wireless, etc.
Message
Author
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...

User avatar
Marv
Posts: 1264
Joined: Wed 04 May 2005, 13:47
Location: SW Wisconsin

Re: Updated to version 5

#51 Post by Marv »

gyro wrote: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
I followed and tested through version 3. For me adding and keeping track of another file in the boot directory for each pup is a dealbreaker. One of the beauties of the frugal installs for me always has been the small and uniform number of files to keep track of and maintain (I juggle multiple pups on most of my platforms). Back to my 3 line "ignore=usb" patch.

Just my humble opinion. I greatly respect and support those willing to maintain and support the foundations of puppy.
Pups currently in kennel :D Older LxPupSc and X-slacko-4.4 for my users; LxPupSc, LxPupSc64 and upupEF for me. All good pups indeed, and all running savefiles for look'n'feel only. Browsers, etc. solely from SFS.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#52 Post by technosaurus »

gyro wrote:
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
It's the only part that isn't obsolete. When you install puppy, the installer script knows where it puts stuff amongst other things. You have to develop the installer in conjunction with init.
Don't fix installer deficiencies with init workarounds that slow down boots.
How many *DRVs do there need to be before you just have a list?
Why does init need to search for stuff if it's not a usb install?

A basic init to X can be done in ~10 lines of c and start in less than half a second (I've done it) search for nanosaurus if your curious.
Did you know jwm has a <StartupCommand> tag that could do most of the rest of the stuff that's in the init?
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

#53 Post by gyro »

@technosaurus
I think you are suggesting that the "init" script could do with a rewrite. I agree. But that's beyond the scope of this little project.
gyro

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

version 4 released

#54 Post by gyro »

I have uploaded a version 4.
This is a continuation of the version 3 concepts, but it uses a "nosearch" boot parameter instead of a "pupsave" parameter.
This is because a "pupsave" parameter could be interpreted as simply defining the pupsave to use. Using "nosearch" should avoid any such an incorrect impression.

gyro

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

#55 Post by boof »

I have puppy_slacko_5.7.iso It won't boot from usb because it can't find the sfs file.

If I expand this iso into into sub files, the initrd.gz file exists and is some 1MB.

If I then expand initrd.gz, The initrd file shows up as empty, having only 1 empty line for text shown in geany.

I can't locate where or how to patch the files to get this to work.

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#56 Post by rufwoof »

boof wrote:I have puppy_slacko_5.7.iso It won't boot from usb because it can't find the sfs file.

If I expand this iso into into sub files, the initrd.gz file exists and is some 1MB.

If I then expand initrd.gz, The initrd file shows up as empty, having only 1 empty line for text shown in geany.

I can't locate where or how to patch the files to get this to work.
How are you 'expanding' the initrd.gz file.

The usual way is to create a sub directory beneath where the initrd.gz file is then change directory into that new directory and

zcat ../initrd.gz | cpio -id

Personally I like to drop the puppy sfs into the initrd file i.e. I copy puppy*.sfs into tha sub directory and then reform using

find | cpio -o -H newc > ../initrd

and then compress that if desired. If you change your grub boot loader to point to initrd instead of initrd.gz then you don't need to compress it. To re-extract a non compressed initrd you use cat ../initrd | cpio -id

As I drop puppy sfs into initrd I changed init script code to not bother searching elsewhere

Code: Select all

#first look inside initrd...
[ -f /${PUPXXXSFS} ] && PUPSFS="rootfs,rootfs,/${PUPXXXSFS}"
[ -f /${ZDRVSFS} ] && ZDRV="rootfs,rootfs,/${ZDRVSFS}"
[ -f /${ADRVSFS} ] && ADRV="rootfs,rootfs,/${ADRVSFS}"
[ -f /${YDRVSFS} ] && YDRV="rootfs,rootfs,/${YDRVSFS}"

# Rufwoof if in initrd (my default) then don't bother spending time searching elsewhere
if [ "$PUPSFS" = "" ]; then # Rufwoof added
  search_func ata #110425
...
...
...
   if [ "$VMLINUZ" = "" -o "$PUPSFS" = "" -o "$SAVEPART" = "" ];then
     search_func usb
   fi
  fi

fi # Rufwoof added

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

#57 Post by gyro »

@boof,

You need to have a fully functioning puppy before worrying about this stuff. It won't help the "can't find puppy.....sfs" problem.

To help with editing the "init" script you could try this topic http://murga-linux.com/puppy/viewtopic.php?t=72842

gyro

User avatar
smokey01
Posts: 2813
Joined: Sat 30 Dec 2006, 23:15
Location: South Australia :-(
Contact:

#58 Post by smokey01 »

boof wrote:I have puppy_slacko_5.7.iso It won't boot from usb because it can't find the sfs file.

If I expand this iso into into sub files, the initrd.gz file exists and is some 1MB.

If I then expand initrd.gz, The initrd file shows up as empty, having only 1 empty line for text shown in geany.

I can't locate where or how to patch the files to get this to work.
Boof I always put all files pertaing to a distro in the same directory. This keeps things tidy and contained.

Recently I created a USB Flash Drive with two partitions. The first partition was formatted to fat32 and the second ext2 (linux).
The distro's were slacko-5.7 and precise-5.7.1. The reason I did this was so I could create a save folder on the second partition.

The USB was originally created with MultiPup-6.0 r22. After that I used gparted to reduce the size of the fat32 partition and created a second partition which I formatted to ext2 as previously stated.

The information below from CatDude shows how I achieved this:
CatDude wrote: The flashdrive has two partitions: 1x Fat32 (sdb1) and 1x Ext2(sdb2)

If you wish to put your savefile on a different partition to that from which you boot,
add the following to the kernel line (just temporary at the grub screen):

PSAVEMARK=2

Use the RAM stanza, and tack PSAVEMARK=2 on the end.

When you reboot, it will create the savefile on (sdb2)
it also creates a subdirectory named identical to the one you are booting from.

Another way is to create a file called SAVEMARK is the pup directory. The only contents of the file is the partition number EG: 2



Contents of (sdb1)
# tree -a
.
├── boot
│   └── grub
│   ├── menu.lst
│   ├── Multipup
│   ├── stage1
│   └── stage2
├── index.txt
├── precise-5.7.1
│   ├── boot.cat
│   ├── boot.msg
│   ├── help2.msg
│   ├── help.msg
│   ├── initrd.gz
│   ├── isolinux.bin
│   ├── isolinux.cfg
│   ├── logo.16
│   ├── menu.lst
│   ├── OLDmenu.lst
│   ├── puppy_precise_5.7.1.sfs
│   ├── README.HTM
│   ├── SAVEMARK ( Content is: 2 (only 1 line ??) )
│   └── vmlinuz
└── slacko-5.7-NO-pae
├── boot.cat
├── boot.msg
├── help2.msg
├── help.msg
├── initrd.gz
├── isolinux.bin
├── isolinux.cfg
├── logo.16
├── menu.lst
├── puppy_slacko_5.7.sfs
├── README.HTM
├── SAVEMARK ( Content is: 2 (only 1 line ??) )
└── vmlinuz

4 directories, 32 files
#


Contents of (sdb2)
# tree -a
.
├── fsckme.flg ( Content is: sdb2,ext2,/precise-5.7.1/precisesave-usbtest1.3fs (only 1 line ??) )
├── lost+found
├── precise-5.7.1
│   └── precisesave-usbtest1.3fs
├── pupdesk.flg ( Content is: ati (only 1 line ??) )
└── slacko-5.7-NO-pae
└── slackosave.3fs

3 directories, 4 files
Cheers & thanks CatDude.

hamoudoudou

my usb, Fat32

#59 Post by hamoudoudou »

my usb, Fat32
Pupsaves are stored in same partition Fat32, no need to create a linux one
Attachments
fat32.jpg
Just not to imagine more complicated
(26.02 KiB) Downloaded 194 times

HerrBert
Posts: 152
Joined: Thu 03 Nov 2016, 15:11
Location: NRW, Germany

#60 Post by HerrBert »

i was kind of disappointed, this is only for tahr6.0.2.
so i gathered information i found and did it on slacko5.7.0.
just another minimally invasive approach:

line 806 added:

Code: Select all

if [ "$PDEV1" -a "$PSUBDIR" ];then
 FSTYPE=$(echo "$PCPARTSALL" | grep "$PDEV1" | cut -f2 -d'|')
 mount -t $FSTYPE /dev/$PDEV1 /mnt/data
 [ -e /mnt/data/$PSUBDIR/PUPSTATE ] && . /mnt/data/$PSUBDIR/PUPSTATE && SKIPSEARCH="yes"
 umount /mnt/data
fi
if [ "$SKIPSEARCH" != "yes" ];then
813
blabla...
989
(now new) line 990 added:

Code: Select all

fi #END SKIPSEARCHING
how it works:
if i specify pdev1=[partition_puppy_lives_on] AND psubdir=[path_to_puppy] as bootparameter AND a copy of /etc/rc.d/PUPSTATE is found in /mnt/$PDEV1$PSUBDIR, searching for puppy-files is skipped. any other case init behaves like normal cd|pristine|whatsoevercalled boot.

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

#61 Post by gyro »

This is a fairly old topic, and does not apply to the "init" script found in current woof-ce Puppies.
In the currrent "init", searching can be avoided by simply specifying "pupsfs=<name, label or uuid of partition> and "psubdir=<sub-directory within partition>" as boot parmaters, e.g. "pupsfs=Work psubdir=/puppy/xenial".

gyro

HerrBert
Posts: 152
Joined: Thu 03 Nov 2016, 15:11
Location: NRW, Germany

#62 Post by HerrBert »

gyro wrote:This is a fairly old topic, and does not apply to the "init" script found in current woof-ce Puppies.
...
correct, but not everybody (can) run(s) current puppies.
stuck to older hardware, i have to try to get the best out of 'older' puppies.

regards

Post Reply