Page 1 of 1

Manual set-up for BIOS and/or UEFI?

Posted: Wed Dec 27, 2023 1:51 pm
by mikewalsh

Afternoon, gang.

For a long time, I've had a Puppy-on-a-stick (128 GB SanDisk USB 3.0 Ultra 'Fit'); 32-bit Xenialpup 7.5 - one of my all-time favourites - along with around 100 GB of movies.

I reckon it's time I upgraded this setup. I'm going to move to a USB 3.2 variant of the same drive; use a more up-to-date 64-bit Puppy - haven't decided which one yet! - do everything via 'portable' apps and, while I'm at it, upgrade the boot-loader to be able to function under either BIOS or UEFI.

Now then; question for you lot. Bearing in mind that I like to do stuff manually - I can't be arsed with running installers, etc; haven't used one for years - what would be the quickest, easiest way to manually set up a bootloader for the above set-up that will handle both BIOS and UEFI?

Please don't suggest any of the multiboot solutions, because that's not what I'm after. This will be one single Puppy, along with a huge amount of data all on the same stick. Serious suggestions, please, guys; anything & everything can and will be considered, and all sensible/useful suggestions and/or advice will be appreciated. :)

TIA.

Mike. ;)


Re: Manual set-up for BIOS and/or UEFI?

Posted: Wed Dec 27, 2023 3:19 pm
by wizard

Hi Mike,

Give grub2config a try. It's included in F96CE and in BookwormPup64, can also be downloaded from the forum.
Make two partitions:
1 - 300mb fat32 (for grub)
2 - ext3 or 4 (for os, portables & movies)

Install os to partition 2 first and then grub to partition 1

wizard


Re: Manual set-up for BIOS and/or UEFI?

Posted: Wed Dec 27, 2023 3:33 pm
by fredx181

How I did : viewtopic.php?p=85041#p85041 (since I use laptop with UEFI only, no 'legacy' option).
edit: just extracting EFI-shim-1.33-puppy.zip, so you get EFI folder on the root of the small FAT partition, is enough, bootloader is installed (only need to create grub.cfg (manually ! ;) )).


Re: Manual set-up for BIOS and/or UEFI?

Posted: Wed Dec 27, 2023 4:46 pm
by mikewalsh

@wizard :-

Thanks for the suggestion, Wiz.....but that IS "using an installer" (which I did specify I didn't want to do). Reason being that in this instance, I want to figure out & see exactly what's going on.

(You know me by now, mate. Despite trying to build easy-to-use packages for everyone else, I have an "enquiring mind"; if I'm going to do this, I want to see what's happening as I do it, so's I actually understand what it IS that I'm doing! :D )

EDIT:- Well.......I've downloaded Grub2config anyway (just in case, like). I'm still unsure just how I'm going to approach this, yet; "planning" is still in the early stages, ATM! (I take it v2.0.1 is the one I want, yes?)

@fredx181 :-

Okay-y-y. Right; well, I actually have something similar in the boot partition of my big HP rig, which I placed there way back in Jan 2020 just after getting it. I was having to figure out how to boot a UEFI machine, and "borrowed" summat I found in Bill's Debian 'starter-kit' thread. Even though she's running entirely in 'Legacy' mode - at least these HP desktops don't seem to have an issue with doing this - I still placed the EFI/boot folder there anyway.......just in case.

However, it's only got the 2 items present:-

  • bootia32.efi
  • bootx64.efi

It doesn't have the other items present in the .zip file you linked me to. I take it the

  • grubia32.efi
  • grubx64.efi
  • mmia32.efi
  • mmx64.efi

.....files ARE necessary (for the purposes of booting both ways, yes?) AND the puppy.cer file (that's the Puppy 'signed' certificate, at a guess?)

Any chance of a 'sample' grub.cfg file - as a template (summat for me to peruse)? It would only need to have a single entry, I presume, since there's only going to be a single Puppy present.....

Any kind souls with a donor file I could look at? :)

Do I take it that I need to end up with both the Grub4DOS stuff + a menu.lst file, AND the EFI stuff with a grub.cfg file? Is that correct?

One final question. Are we looking at a single boot-entry that switches either way - depending on what it finds! - or are we looking at 2 separate entries (one for either mode)? I'll figure it out sooner or later, though some pointers will be appreciated! :D

TIA.

Mike. ;)


Re: Manual set-up for BIOS and/or UEFI?

Posted: Wed Dec 27, 2023 5:18 pm
by wizard

@mikewalsh

.but that IS "using an installer" (which I did specify I didn't want to do).

Ah, thought you were only referring to the Puppy install.

I'd still suggest making a grub2config install and then examining the files it creates to get a better understanding of how it works.

That will also give you the example grub.cfg & menu.lst files you want.

(I take it v2.0.1 is the one I want, yes?)

yes

wizard


Re: Manual set-up for BIOS and/or UEFI?

Posted: Wed Dec 27, 2023 5:35 pm
by mikewalsh

@wizard :-

Hm. 'Kay.....sounds like a plan. TBH, it probably would be the best way to approach it, 'cos that way I would get to see what the layout looks like. Yah; might go with that. We'll see!

Mike. :thumbup:


Re: Manual set-up for BIOS and/or UEFI?

Posted: Wed Dec 27, 2023 7:33 pm
by fredx181
mikewalsh wrote:

It doesn't have the other items present in the .zip file you linked me to. I take it the

Code: Select all

grubia32.efi
grubx64.efi
mmia32.efi
mmx64.efi

.....files ARE necessary (for the purposes of booting both ways, yes?) AND the puppy.cer file (that's the Puppy 'signed' certificate, at a guess?)

Perhaps not all are necessary, all I know is that it works that way for me (maybe even with secure boot enabled, don't know).
@jamesbond knows a lot about this stuff, and on his website much info. e.g. https://lightofdawn.org/wiki/wiki.cgi/SonyLinuxUefiBoot

Any chance of a 'sample' grub.cfg file - as a template (summat for me to peruse)? It would only need to have a single entry, I presume, since there's only going to be a single Puppy present.....

Something like this,

Code: Select all

set timeout=5
# https://help.ubuntu.com/community/Grub2/Displays
color_normal=cyan/black
#menu_color_highlight=black/light-gray
menu_color_highlight=yellow/red
menu_color_normal=light-gray/black

menuentry "fossapup64 9.5 - Don't copy SFS files to RAM" {
insmod part_msdos 
insmod ext2
search --no-floppy --fs-uuid --set=root  ff46c108-01c3-4dfe-bfea-00395fdf3fd0
    linux /fossap/vmlinuz pfix=nocopy,fsck pmedia=atahd psubdir=fossap
    initrd /fossap/initrd.gz
}

menuentry "bookwormpup - Don't copy SFS files to RAM" {
insmod part_msdos 
insmod ext2
search --no-floppy --fs-uuid --set=root 34b10665-11c5-493c-9bff-f4f1e7db86f2
    linux /bwormp/vmlinuz pfix=nocopy,fsck pmedia=usbflash psubdir=bwormp i915.enable_dc=0
    initrd /bwormp/initrd.gz
}

Yes menu.lst for G4D and grub.cfg for GRUB2 .


Re: Manual set-up for BIOS and/or UEFI?

Posted: Wed Dec 27, 2023 9:32 pm
by williwaw

WHAT? Mike using grub2?

just joking. getting by fine here with manual edits of grub.cfg using grub2 in spite of all the warnings and automagic stuff implemented by the mainstream distros.

@rcrsn51 has provided multiinstaller and iso booter, maybe some menu examples to add to your library.


Re: Manual set-up for BIOS and/or UEFI?

Posted: Thu Dec 28, 2023 1:14 am
by mikewalsh

@fredx181 :-

Thanks for the example, Fred. I'll study it a bit closer when I get a chance.

@williwaw :-

Heh. Yeah, I know I've always made it quite clear how much I dislike GRUB2. But I have to accept the fact that there are fewer & fewer MBR machines out there.....and nearly every one I come across now will be UEFI of some flavour or another. And it seems that means GRUB2, 'cos G4D can't handle it.

(Most folks won't go to the trouble of setting a UEFI machine up to run in 100% 'legacy' mode. Most folks don't understand bootloaders, and won't touch them or go anywhere near them on principle. Most folks are running Windows; Windows refuses to run any other way, and is quite happy with it. Ergo sum.)

And this is "progress"..! :lol: :roll: :shock:

Such is life.

Mike. :o


Re: Manual set-up for BIOS and/or UEFI?

Posted: Thu Dec 28, 2023 3:43 pm
by fredx181
williwaw wrote:

WHAT? Mike using grub2?

just joking.

Yeah, watch Mike ! What can happen, will happen (Murphy's Law). Someday he will use Pulseaudio, Pipewire, Wayland, and... WHAT? Mike using Systemd !!??
:lol: ;)
edit: seriously now, for me personally, pulseaudio and/or pipewire: I like it (it really has some advantages compared with just alsa) , with wayland I don't have experience, and systemd ... I hate it (trauma ?!).


Re: Manual set-up for BIOS and/or UEFI?

Posted: Thu Dec 28, 2023 4:01 pm
by wizard

@mikewalsh

You will find that grub2config creates grub.cfg files that are much smaller and easier to understand than those created by larger distros.

wizard


Re: Manual set-up for BIOS and/or UEFI?

Posted: Thu Dec 28, 2023 5:18 pm
by Phoenix
mikewalsh wrote: Wed Dec 27, 2023 1:51 pm

Afternoon, gang.

For a long time, I've had a Puppy-on-a-stick (128 GB SanDisk USB 3.0 Ultra 'Fit'); 32-bit Xenialpup 7.5 - one of my all-time favourites - along with around 100 GB of movies.

I reckon it's time I upgraded this setup. I'm going to move to a USB 3.2 variant of the same drive; use a more up-to-date 64-bit Puppy - haven't decided which one yet! - do everything via 'portable' apps and, while I'm at it, upgrade the boot-loader to be able to function under either BIOS or UEFI.

Now then; question for you lot. Bearing in mind that I like to do stuff manually - I can't be arsed with running installers, etc; haven't used one for years - what would be the quickest, easiest way to manually set up a bootloader for the above set-up that will handle both BIOS and UEFI?

Please don't suggest any of the multiboot solutions, because that's not what I'm after. This will be one single Puppy, along with a huge amount of data all on the same stick. Serious suggestions, please, guys; anything & everything can and will be considered, and all sensible/useful suggestions and/or advice will be appreciated. :)

TIA.

Mike. ;)

Your puppy on a stick is never permanent in UEFI. Once you remove it before boot you'll discover the entry will delete itself and move again to the bottom once reinserted. To workaround this, you'd need to install rEFInd and refresh. Of course this may not matter.

The simplest setup for UEFI is turn off secure boot and move your USB entry up, or manually boot it via the UEFI BIOS. (Secure boot may prevent this, if you want to know 'how to' put Puppy into the local database please let me know). You don't actually need grub2. The ISO comes with own EFI files. (That will boot the grub thats included with the ISO)

Edit: For BIOS/MBR I would definitely not want to do this by hand....


Re: Manual set-up for BIOS and/or UEFI?

Posted: Thu Dec 28, 2023 5:39 pm
by mikewalsh

@wizard / @Phoenix :-

Well, I'm elbows-deep into the project ATM. I've gone with Fossapup64 9.5 (Phil's original; I can't be doing with all the farting-around with PulseAudio/Pipewire, etc.......I just want summat I can understand, and that just works).

From Fossa64 on the big HP rig, I installed Grub2config 2.0.1, and set the USB stick up to work with that. We have:-

A SanDisk USB 3.2 Ultra 'Fit' nano-sized thumb-drive, 128 GB, set-up as follows:-

  • sdc1 : FAT32, 256 MB
  • sdc2 : Ext3, 15.00 GB
  • sdc3 (the 'DATA' partition; this is where the movies will live) : Ext3, 90 GB
  • sdc4 : linux-swap, 4 GB

.....plus a few GB unformatted between sdc3 and swap.

Grub2Config set things up on sdc1, and so far it boots fine in MBR mode. At some point I'm going into the UEFI/BIOS, and will activate the UEFI stuff. I'll then see if it boots OK that way, too; if it does, it'll achieve what I wanted from it.....

Apart from that, all that remains is to copy my movies across, and set Fossa64 up the way I want it.

@wizard :-

I see what you mean about tiny .cfg files. The only bit I haven't yet figured out is why 'menu.lst' seems to be just a re-direct to 'grub.cfg'.......but if it works, who cares? :D

Cheers for the assistance so far! :thumbup:


@fredx181 :-

Like you, I loathe systemd and have no experience with Wayland. I agree that Xorg is WAY overdue for an upgrade, but most of the display server stuff runs in the background, and largely keeps out of the user's way.

PipeWire, well.......if it's along the same lines as PA, it's yet another layer of stuff introducing additional complexity. PA, I have previous experience with in my early Linux days, all of it bad! (I've tried the implementations of it in some of the newer Puppies, and it doesn't seem to have improved any; still clunky & cumbersome, and requiring far too many mouse-clicks to get anything done).

On top of all that, I have a number of personal audio-handling utilities I've built over the last few years which just 'work' with ALSA. Up to and including Phil's original Fossa64 - 9.5, the one in use here - I can drop these into any Pup, and they function as intended.....without any fuss. I prefer my Puppies to be a bit more 'mature' than most; Fossa is sufficiently new enough that it should be OK for a few years yet.

I'm quite open about the fact that I'm not a 'real' geek.......the sort that just HAS to jump on anything new the instant it becomes available. I'm just not that bothered about it! :D

Mike. ;)


Re: Manual set-up for BIOS and/or UEFI?

Posted: Thu Dec 28, 2023 5:44 pm
by Phoenix

The EFI files should be located on the FAT32 partition flagged esp under /EFI/boot.


Re: Manual set-up for BIOS and/or UEFI?

Posted: Thu Dec 28, 2023 5:57 pm
by mikewalsh

@Phoenix :-

Yeah, which brings me to summat else I was meaning to ask about. What IS the 'esp' flag.....and why not just use the 'boot' flag as normal? What's the difference?

(Okay. 'ESP' = 'EFI System Partition'.)

I guess what I'm asking is this; should I flag the boot partition as 'esp' in addition to 'boot'.......and, if I do, will it make any difference to booting on an MBR 'puter? Or will an MBR box just ignore it?

Mike. :?


Re: Manual set-up for BIOS and/or UEFI?

Posted: Thu Dec 28, 2023 6:09 pm
by Phoenix
mikewalsh wrote: Thu Dec 28, 2023 5:57 pm

@Phoenix :-

Yeah, which brings me to summat else I was meaning to ask about. What IS the 'esp' flag.....and why not just use the 'boot' flag as normal? What's the difference?

(Okay. 'ESP' = 'EFI System Partition'.)

I guess what I'm asking is this; should I flag the boot partition as 'esp' in addition to 'boot'.......and, if I do, will it make any difference to booting on an MBR 'puter? Or will an MBR box just ignore it?

Mike. :?

MBR/UEFI will blissfilly ignore each other excluding UEFI CSM mode (MBR interoperability)


Re: Manual set-up for BIOS and/or UEFI?

Posted: Thu Dec 28, 2023 9:40 pm
by wizard

@mikewalsh

sdc4 : linux-swap, 4 GB

Swap files/partitions are not recommended on USB flash drives, wears them out prematurely.

wizard


Re: Manual set-up for BIOS and/or UEFI?

Posted: Thu Dec 28, 2023 9:48 pm
by mikewalsh
wizard wrote: Thu Dec 28, 2023 9:40 pm

@mikewalsh

sdc4 : linux-swap, 4 GB

Swap files/partitions are not recommended on USB flash drives, wears them out prematurely.

wizard

@wizard :-

I always put one on, mate. Old habits die hard.......and there's no telling if the host machine will have any existing swap space, OR even how much - or little! - RAM it may have.

On this desktop rig, the huge amounts of swap I have are only there for suspend or hibernate operations. With 32GB RAM, in normal operation it never even gets looked at.....

(shrug...)

Mike. ;)


Re: Manual set-up for BIOS and/or UEFI?

Posted: Fri Dec 29, 2023 12:43 am
by mikewalsh

Well, I CAN confirm the bootloader created by Grub2Config works well in both modes. Just been trying it in full UEFI mode; it boots without fuss.

I did have a bit of fun getting her back into 'Legacy' mode. Bearing in mind that i switched her out of UEFI into 'Legacy' back in January of 2020, and she's been there ever since, it's perhaps not surprising I'd forgotten the key-sequence required to switch from UEFI -> Legacy; it's a wee bit different to that required for accessing UEFI/BIOS when already IN 'Legacy' mode.

(It's the same keys under UEFI.......but you have to use them in a slightly different order. F10 remains the same, but F9 and 'Esc' swap roles! MOST confusing.....and the manual doesn't make this at all clear.)

Anyways; media - movies, pictures, music, etc - all now copied across. Portables all functional, and behaving themselves. Just need to spend time 'customizing' and getting things how I want them, that's all that remains to be done.

This is the bit I enjoy..!

Thanks to all for assistance. You're a good bunch! :thumbup: :D

Mike. ;)


Re: Manual set-up for BIOS and/or UEFI?

Posted: Fri Dec 29, 2023 2:03 am
by wizard

@mikewalsh

the manual doesn't make this at all clear.)

Manuals.....why would they be right, usually two revisions old, we don't use no stinking manuals :lol: :lol:

wizard