Page 1 of 1

Grub2 "iso-boot" is really a Grub2 "image-boot"

Posted: Wed Jun 30, 2021 7:57 am
by gyrog

This is a FYI, so I'm not sure if this is the right place for it.

I was foolishly reading the actual Grub2 online documentation and noticed that it refers to using "loop" as booting an "image" file.

So, I did a litle experiment:
I created a 'puppy_upuphh+d_21.04.sfs' that contained only the ".sfs" files and 'vmlinuz' and 'initrd.gz'.
I then setup a boot of this file in 'grub.cfg' using the following:

Code: Select all

menuentry "UPupHH+D-21.04+5.sfs (sdc2)" {
  insmod ext2
  set boot_id="3702c495-ed38-4d72-ab44-667389b0597c"
  search --no-floppy --fs-uuid --set=root $boot_id
  insmod test
  probe --set=pup_id --label ($root)
  if [ "${pup_id}" = "" ]; then
    set pup_id="${boot_id}"
  fi
  insmod sfs
  set sfsfile="/sfss/UPupHH+D-21.04+5.sfs"
  loopback loop $sfsfile
  set root=(loop)
  echo "Loading vmlinuz"
  linux (loop)/vmlinuz libata.noacpi=1 net.ifnames=0 pmedia=usbhd img_dev=$pup_id img_loop=$sfsfile pfix=fsck,fsckp TZ=AEST-10
  echo "Loading initrd.gz"
  initrd (loop)/initrd.gz
}

The boot was sucessful, and after a reboot I had the following PUPSTATE (note the file-system):

Code: Select all

PUPMODE=12
PDEV1='loop0'
DEV1FS='squashfs'
PUPSFS='loop0,squashfs,/puppy_upuphh+d_21.04.sfs'
PUPSAVE='sdc2,ext4,/sfss/saves/upuphh+dsave'
PMEDIA='usbhd'
#ATADRIVES is all internal ide/pata/sata drives, excluding optical, excluding usb...
ATADRIVES='sda sdb sdc '
#ATAOPTICALDRIVES is list of non-usb optical drives...
ATAOPTICALDRIVES='sr0 '
#these directories are unionfs/aufs layers in /initrd...
RW_LAYER='/pup_rw'
SAVE_LAYER='/pup_rw'
PUP_LAYER='/pup_ro2'
#The partition that has the upuphh+dsave file is mounted here...
PUP_HOME='/mnt/dev_save'
#(in /initrd) ...note, /mnt/home is a link to it.
#this file has extra kernel drivers and firmware...
ZDRV='loop0,squashfs,/zdrv_upuphh+d_21.04.sfs'
FDRV='loop0,squashfs,/fdrv_upuphh+d_21.04.sfs'
ADRV='loop0,squashfs,/adrv_upuphh+d_21.04.sfs'
YDRV='loop0,squashfs,/ydrv_upuphh+d_21.04.sfs'
#Partition no. override on boot drive to which session is (or will be) saved...
PSAVEMARK=''
PSAVEPART='sdc2'
PSAVEDIR='/sfss/saves/'
PSUBDIR=''
PUNIONFS='aufs'
DOIMODS='yes'
DOMIBS='no'

So, not only can you boot "image" files other than ".iso" files,
it seems that using Grub2 to boot an "image" file does not boot the "image" file, it boots using the files inside the "image" file.
What's the difference?
Well the "image" file does not need to contain any "boot-loader" files, just the Puppy files.


Re: Grub2 "iso-boot" is really a Grub2 "image-boot"

Posted: Wed Jun 30, 2021 2:24 pm
by bigpup

Well the "image" file does not need to contain any "boot-loader" files, just the Puppy files.

If you are providing the boot loader.
It does not need to provide one.

What you did is more like an image of a partition or a directory/folder.

".sfs" files and 'vmlinuz' and 'initrd.gz'.

That is a working frugal install of Puppy Linux.
Instead of putting it in a folder/directory, it is in an image file.

There is always about 10 different ways to do anything, but just because you can, does not make it the best way.
But it is fun to do something a different way! :D
Thanks for the different way info!!!


Re: Grub2 "iso-boot" is really a Grub2 "image-boot"

Posted: Wed Jun 30, 2021 2:34 pm
by bigpup

Did you shutdown making a save and get it to boot using the save?


Re: Grub2 "iso-boot" is really a Grub2 "image-boot"

Posted: Wed Jun 30, 2021 10:59 pm
by 01micko
bigpup wrote: Wed Jun 30, 2021 2:34 pm

Did you shutdown making a save and get it to boot using the save?

Code: Select all

PUPMODE=12

:ugeek:


Re: Grub2 "iso-boot" is really a Grub2 "image-boot"

Posted: Thu Jul 01, 2021 2:10 pm
by gyrog

As I said this is just an FYI.
I'm just indicating that we have an option that folk might not have been aware of.

@bigpup, Yes, @01micko got it in one.
Works just like booting a ".iso" file with grub2.

Although it could be argued that the '/sbin/isoboot' file in 'initrd.gz' is incorrectly named.
But I'm not going to bother to change it.


Re: Grub2 "iso-boot" is really a Grub2 "image-boot"

Posted: Thu Jul 01, 2021 2:27 pm
by bigpup

You must of posted when I was correcting.
This was to answer 01micko.

This being a non-normal way of running Puppy.
I would like to know for sure, the save is working 100% correctly.
This was a is it working question.
I guess I could have asked differently.

Just because it goes into pupmode 12 does not make it all correctly work.

gyrog,
Just saw your post.
Thanks for info I asked.


Re: Grub2 "iso-boot" is really a Grub2 "image-boot"

Posted: Fri Jul 02, 2021 3:01 am
by Clarity

This is just as we have been doing with PUPs since beginning of 2020 when modern PUPs started using the GRUB2-EFI model..
It allows a PUP ISO file to boot giving the users ALL the same functionality of a Frugal boot, without the need to expand or place files out of the ISO onto media. At the same time, the users get ALL the same abilities including session-saves.

This has a DIRECT productivity gain for users who take advantage of that functionality presented in the modern WoofCE distros. Using SG2D for example, the user merely downloads his modern PUP and boots that ISO...thanks to the upgrades those develops added. There is NO additional utilities that need be run nor PUP space needs except the decision on saving at the end of one's session. In my case, for example, I download the PUP to /BOOTISOS and boot the USB to PUP's desktop. In this case, I download Slacko64 8.2.1 and booted to desktop in under 3.5 minutes which includes the 2.75 minutes to download the PUP. I challenge anyone/everyone to beet that with any Frugal method in existence.

The above paragraph IS NOT INTENDED to stop Frugal use. IT IS INTENDED to show a better way that provides productivity gains for anyone who chooses to take advantage of the WoofCE advancement(s) while NOT diminishing in any way the typical benefit derive in PUP desktop use.

@gyrog is leading us to know that, potentialy, the same WoofCE advancements can also allow an IMG file to be booted equally as we have with ISO file boots....I think. Am I correct?

For example: An traditional IMG file can be written to a USB including all that is necessary for that USB to boot "LIVE". Thus the resulting USB has all that is necessary for taking the user to a desktop. This is "somewhat" similar to a hybrid ISO creaing a USB excepting of course the ISO9660 issue.

But, thus far, I know of only 1 other boot helper that uses GRUB2 to boot an actual IMG file (wihtout any expansion!) to a desktop.

I would welcome to see a proven Puppy IMG file booted by the GRUB2-EFI that is "suggested". Thus, I would welcome to test a IMG that NOT only can create a USB, but also can boot its own IMG file from some library(folder) on the USB. This way, more than one PUP/DOG's ISO file or their IMG file can be booted directly from their files contained within the ISO or the IMG.

So far, it seems, that we are being led away from that boot, while at the same time, acknowledging the ability.

Can a USB be constructed that has the modern PUP's GRUB2-EFI which only has a folder with PUP/DOG ISOs AND IMGs where the folder list them for user selection? If so, I welcome that and will use that approach forever to boot all future PUPs or DOGs no matter how they are release...ISO or IMG. (ISO/IMG files are usually compressed, thus they are space savers too)

Help if we can do so.


Re: Grub2 "iso-boot" is really a Grub2 "image-boot"

Posted: Fri Jul 02, 2021 8:45 am
by rcrsn51
Clarity wrote: Fri Jul 02, 2021 3:01 am

It allows a PUP ISO file to boot giving the users ALL the same functionality of a Frugal boot ...

What if I want to change the boot options? What if I want to change kernels? What if I want to load another squashfs module at bootup?

This method only works if I am happy with the current contents of the ISO.


Re: Grub2 "iso-boot" is really a Grub2 "image-boot"

Posted: Sat Jul 03, 2021 3:38 pm
by Clarity
rcrsn51 wrote: Fri Jul 02, 2021 8:45 am

This method only works if I am happy with the current contents of the ISO.

This statement is true but misses a caveat!

DONT FORGET that any user. at boot-time, can edit the "linux" line for ANY appropriate PUP parms one feels necessary, if they choose.

So the normal PUP benefits when the PUP boot manager displays, as well as, the selections the PUP boot manager provides are always available.

Further, I know you and most everyone knows that they can remaster any PUP to create a brand-new bootable file as well as other users knowing that they can edit ANY ISO file via the enclosed ISOmaster that comes with all modern PUPs.

Thus, there is no need for me to do any Frugal ever again unless, of course, if for some reason the abilty to boot DIRECTLY from file is eliminated (I dont foresee that in current development). Booting the ISO file directly yields everything I have been accustomed to have in a PUP. Hopefully booting a PUP's IMG file, directly, will afford the same productivity benefit we have today booting an ISO file asuming development can take advantage of GRUB2 features to affort this benefit.

This technology implementation, as @gyrog and @shinobar is showing, is bringing new use-benefits to PUPs-DOGs alike.

Hope this is helpful

P.S. We must ALWAYS keep in mind that there is a difference between a user's use of any distro and developer's use. These are VERY different people. I mostly deal with users who merely want to get to desktop and use something.