What IS a 'recommended' way to specify savefile location using GRUB (v2.03)?

Moderator: Forum moderators

Post Reply
ozboomer
Posts: 106
Joined: Sun Dec 20, 2020 12:49 am
Location: Blackburn, Australia
Has thanked: 16 times
Been thanked: 17 times

What IS a 'recommended' way to specify savefile location using GRUB (v2.03)?

Post by ozboomer »

I'm trying to work out the 'best' way to specify that I want a certain GRUB (v2.03) menu entry to look for its savefile in a specific location... and while I have an answer, it's often suggested as not being the' best' or 'most reliable' way...

The menu entry:

Code: Select all

menuentry "Puppy Linux: grumpy: VirtualBox: F96-CE (on nvme0n1p3)" {
  insmod fat

  search --no-floppy --fs-uuid --set=root 0A34A4BC34A4ABDF

  echo "Loading vmlinuz"
# The following works Ok... but presents a menu of files to load
  linux /Puppy/F96-CE/vmlinuz pmedia=atahd pdrv=Windows psubdir=/Puppy/F96-CE pfix=fsck

# fails: linux /Puppy/F96-CE/vmlinuz pmedia=atahd pdrv=Windows psubdir=/Puppy/F96-CE pfix=fsck psave=fossapup64save-GRUMPY-VM-PROD.4fs
# fails: linux /Puppy/F96-CE/vmlinuz pmedia=atahd pdrv=Windows psubdir=/Puppy/F96-CE pfix=fsck psave=Puppy/F96-CE/fossapup64save-GRUMPY-VM-PROD.4fs
# fails: linux /Puppy/F96-CE/vmlinuz pmedia=atahd pdrv=Windows psubdir=/Puppy/F96-CE pfix=fsck psave=UUID=0A34A4BC34A4ABDF:/Puppy/F96-CE/fossapup64save-GRUMPY-VM-PROD.4fs
# fails: linux /Puppy/F96-CE/vmlinuz pmedia=atahd pdrv=Windows psubdir=/Puppy/F96-CE pfix=fsck psave=UUID=b16aa104-463a-45c0-8cc6-45ed5fdc9b5c:/Puppy/F96-CE/fossapup64save-GRUMPY-VM-PROD.4fs
# WORKS! linux /Puppy/F96-CE/vmlinuz pmedia=atahd pdrv=Windows psubdir=/Puppy/F96-CE pfix=fsck psave=nvme0n1p3:/Puppy/F96-CE/fossapup64save-GRUMPY-VM-PROD.4fs
# fails: linux /Puppy/F96-CE/vmlinuz pmedia=atahd pdrv=Windows psubdir=/Puppy/F96-CE pfix=fsck psave=UUID=0A34A4BC34A4ABDF:Puppy/F96-CE/fossapup64save-GRUMPY-VM-PROD.4fs

  if [ -e /Puppy/F96-CE/local-initrd.gz ]; then
    set local_rd=/Puppy/F96-CE/local-initrd.gz
  else
    set local_rd=
  fi

  if [ -e /Puppy/F96-CE/ucode.cpio ]; then
    set ucode_rd=/Puppy/F96-CE/ucode.cpio
    echo "Loading ucode.cpio and initrd.gz"
  else
    set ucode_rd=
    echo "Loading initrd.gz"
  fi

  initrd $ucode_rd /Puppy/F96-CE/initrd.gz $local_rd

}

I get a bit confused with psave, pdrv, psubdir and others... The 'normal' kernel parameters seem to be listed, for example, at https://www.kernel.org/doc/html/v4.14/a ... eters.html ...and there is a page on the Puppy wiki ( see https://wikka.puppylinux.com/BootParametersPuppy ) and another in the old forum ( see https://oldforum.puppylinux.com/viewtopic.php?t=35003 )

...but there aren't any 'real world' examples, really, of how the different parameters are used OR how they interact... at least that I could find. For example, why does the psave with a path work, in which case, the psubdir is maybe unnecessary, particularly given the location of vmlinuz is fully pathed (off the root device)...? If you specify the psubdir, shouldn't it be unnecessary anywhere unless another file is located somewhere different?

Does anyone have any thoughts on this?

Daily Use Puppies: F96-CE (migrating), Xenial64 7.5, Slacko 6.3.2... Proud Puppy enthusiast since 2004
C, Perl, cmd/DCL/bash... for sysadmin, CLI tools... under DOS, Windoze, VMS, Linux... on PC, VAX... for 45+ years... :roll:

ozsouth
Posts: 1713
Joined: Sun Jul 12, 2020 2:38 am
Location: S.E. Australia
Has thanked: 260 times
Been thanked: 780 times

Re: What IS a 'recommended' way to specify savefile location using GRUB (v2.03)?

Post by ozsouth »

@ozboomer - if it's a static install on one pc (not a usb stick used in different pc's), pdrv is simple:
- if puppy's sfs's and your save file are on say sda5, then pdrv=sda5 will work.
I personally use gparted to give an ext3/ext4/ntfs partition a label (i.e. mypup5), then use pdrv=mypup5. That way it will be found even on a usb stick in different pc's.

dimkr
Posts: 2512
Joined: Wed Dec 30, 2020 6:14 pm
Has thanked: 53 times
Been thanked: 1267 times

Re: What IS a 'recommended' way to specify savefile location using GRUB (v2.03)?

Post by dimkr »

At least some of the documentation here should be correct. When it's incorrect, you can find your answers in the init script itself (but it's very messy and hard to read).

Post Reply

Return to “Boot”