How to create a Multi-Porteus Boot USB flash drive?

Technical issues/questions of an intermediate or advanced nature.
User avatar
cad
Black ninja
Black ninja
Posts: 69
Joined: 06 Nov 2020, 22:40
Distribution: XFCE 5.01 x86_64 + 4.0 i586

How to create a Multi-Porteus Boot USB flash drive?

Post#1 by cad » 03 Oct 2023, 22:05

Hi everyone, it's been a bit since my last post...

Basically, I would like to achieve what I did a while ago here: How to use 'mkisofs' to create Multi-Porteus Boot ISOs (DVDs) (Post by ncmprhnsbl #80149) with DVD's - but this time with a USB flash drive.

I'm trying to install different versions of Porteus (3.1, 4.0 and 5.01) so that they can be booted from the same USB key. My boot USB drive (created with Porteus Installer from the 5.01 XFCE cdrom) works wonderfully well to boot 5.01, and now the challenge is to find a way to also boot the other versions from the same stick. I have tried putting separate directories (Por3.1, Por4.0, etc.) containing the "boot" and "porteus" folders in the USB key's root directory and playing with the porteus.cfg file in a number of ways, to no avail. In the case of the multi-boot DVD mentioned above, it was easily done by burning the DVD's with 'mkisofs'.

What's a good way to do this with a USB key?

Thanks...

Rapha_
Shogun
Shogun
Posts: 238
Joined: 12 Jun 2021, 21:59
Distribution: Xfce 4.12 - 5.rc3 - x86_64
Location: France

How to create a Multi-Porteus Boot USB flash drive?

Post#2 by Rapha_ » 04 Oct 2023, 00:58

On the USB key you already have :

- /boot/syslinux/
- /Porteus

add :
/iso
(copy your iso into it)

you can add in (/boot/syslinux/):

/boot_porteus-3.1
/boot_porteus-4
/boot_porteus-5

(copy each content of their associated syslinux folder into it)

Next,
add the lines associated with each version

But modify them a little like this :

Code: Select all

LABEL ISO-01
MENU LABEL Iso (porteus-3.1-xfce)
KERNEL /boot/syslinux/boot_porteus-3.1/vmlinuz
INITRD /boot/syslinux/boot_porteus-3.1/initrd.xz
APPEND from=UUID:STrING-0F-ChARACtERS/Iso/porteus-3.1-xfce-x86_64.iso  extramod=UUID:STrING-0F-ChARACtERS/porteus/modules/porteus-3
TEXT HELP
from=UUID:STrING-0F-ChARACtERS/Iso/porteus-3.1-xfce-x86_64.iso
extramod=UUID:STrING-0F-ChARACtERS/porteus/modules/porteus-3
ENDTEXT

LABEL ISO-02
MENU LABEL Iso (porteus-4-xfce)
KERNEL /boot/syslinux/boot_porteus-4/vmlinuz
INITRD /boot/syslinux/boot_porteus-4/initrd.xz
APPEND from=UUID:STrING-0F-ChARACtERS/Iso/porteus-4-xfce-x86_64.iso  extramod=UUID:STrING-0F-ChARACtERS/porteus/modules/porteus-4
TEXT HELP
from=UUID:STrING-0F-ChARACtERS/Iso/porteus-4-xfce-x86_64.iso
extramod=UUID:STrING-0F-ChARACtERS/porteus/modules/porteus-4
ENDTEXT

LABEL ISO-03
MENU LABEL Iso (porteus-5-xfce)
KERNEL /boot/syslinux/boot_porteus-5/vmlinuz
INITRD /boot/syslinux/boot_porteus-5/initrd.xz
APPEND from=UUID:STrING-0F-ChARACtERS/Iso/porteus-5-xfce-x86_64.iso  extramod=UUID:STrING-0F-ChARACtERS/porteus/modules/porteus-5
TEXT HELP
from=UUID:STrING-0F-ChARACtERS/Iso/porteus-5-xfce-x86_64.iso
extramod=UUID:STrING-0F-ChARACtERS/porteus/modules/porteus-5
ENDTEXT

etc...




That's the method I use to test new iso's....

User avatar
Ed_P
Contributor
Contributor
Posts: 8374
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

How to create a Multi-Porteus Boot USB flash drive?

Post#3 by Ed_P » 04 Oct 2023, 15:44

Rapha_ wrote:
04 Oct 2023, 00:58
That's the method I use to test new iso's....
:o A very interesting option Rapha.

So I better understand what you do; you extract from each ISO the whole /boot/syslinux/ folder or just the vmlinuz and initrd.xz files? And there are rarely modules in the ISOs /porteus/modules/ folder so is the extramod= cheat code necessary?

I multi-boot ISOs via grub2 menus.
Ed

User avatar
cad
Black ninja
Black ninja
Posts: 69
Joined: 06 Nov 2020, 22:40
Distribution: XFCE 5.01 x86_64 + 4.0 i586

How to create a Multi-Porteus Boot USB flash drive?

Post#4 by cad » 04 Oct 2023, 16:18

@Rapha

Thank you so very, very, very much Rapha! It worked perfectly and it was *exactly* what I was looking for! :thumbsup: :thumbsup:

@Ed_P

I have experimented a little bit with Rapha's suggestion. It is sufficient to put just the vmlinuz and initrd.xz files into the /boot/syslinux/boot_porteus-x.x/ directories.
Also, the extramod= cheat code is not necessary, even if there are modules in the /porteus/modules folder: I have several in it and it loads them quite fine without that cheat code. Also, I did not copy any .iso, I just copied all the files in the Porteus isos (after extracting them) in their respective directories in the so-called iso folder in the flash drive root - it makes it easier to later modify everything as needed...

There is so much value in this forum, it is so great! You guys are great!!! :Yahoo!: :Yahoo!: :Yahoo!:
Last edited by cad on 04 Oct 2023, 17:04, edited 2 times in total.

User avatar
cad
Black ninja
Black ninja
Posts: 69
Joined: 06 Nov 2020, 22:40
Distribution: XFCE 5.01 x86_64 + 4.0 i586

How to create a Multi-Porteus Boot USB flash drive?

Post#5 by cad » 04 Oct 2023, 16:30

Also, Ed_P, I know you have been experimenting a lot with grub2. Have you found a way to force a grub2 EFI build (and grub2 install to USB stick) when building and installing to flash drive purely from Linux? I have experimented a bit with grub2 (within Linux), and it seems to force an i386 (NON-EFI) build (and install) in the absence of an EFI partition. Do you think it possible to temporarily mount an EFI partition to fool grub2 into producing an x86_64-efi build? Not sure if it can be done... It would be very helpful when installing grub2 to removable devices...

Rapha_
Shogun
Shogun
Posts: 238
Joined: 12 Jun 2021, 21:59
Distribution: Xfce 4.12 - 5.rc3 - x86_64
Location: France

How to create a Multi-Porteus Boot USB flash drive?

Post#6 by Rapha_ » 04 Oct 2023, 17:23

Ed_P wrote:
04 Oct 2023, 15:44
So I better understand what you do; you extract from each ISO the whole /boot/syslinux/ folder or just the vmlinuz and initrd.xz files?
Yes , indeed the other files are probably not necessary ...
Ed_P wrote:
04 Oct 2023, 15:44
And there are rarely modules in the ISOs /porteus/modules/ folder so is the extramod= cheat code necessary?
"extramod= cheat code" is required with iso, since their module folders are empty and read-only

--> what's missing is an "extramod=" cheat code for optional modules



@cad
Please note that not all modules are compatible with differents Porteus versions.

Can you show an example of your Porteus.cfg ?

User avatar
Ed_P
Contributor
Contributor
Posts: 8374
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

How to create a Multi-Porteus Boot USB flash drive?

Post#7 by Ed_P » 04 Oct 2023, 21:13

Rapha_ wrote:
04 Oct 2023, 17:23
extramod= cheat code" is required with iso, since their module folders are empty and read-only

--> what's missing is an "extramod=" cheat code for optional modules
A extramod= cheatcode is required for modules in folders outside the ISOs I boot, and to ensure there is no confusion to the ISO's /porteus/modules/ folder I name my folder with a capital letter, Modules. I do the same for Optional.

Added in 8 minutes 29 seconds:
cad wrote:
04 Oct 2023, 16:30
Have you found a way to force a grub2 EFI build (and grub2 install to USB stick) when building and installing to flash drive purely from Linux?
No but i do have grub2 on one of my USB drives. I copied the Grub2Win folder on my hdd to the USB drive, which is formated FAT32, and it's EFI app to the EFI folder on the USB drive.

Added in 2 minutes 40 seconds:
Rapha_ wrote:
04 Oct 2023, 00:58
That's the method I use to test new iso's....
I never knew Porteus supported booting ISOs. Has it always done it or is it new with 5.0?
Ed

Rapha_
Shogun
Shogun
Posts: 238
Joined: 12 Jun 2021, 21:59
Distribution: Xfce 4.12 - 5.rc3 - x86_64
Location: France

How to create a Multi-Porteus Boot USB flash drive?

Post#8 by Rapha_ » 05 Oct 2023, 11:35

Ed_P wrote:
04 Oct 2023, 21:24
A extramod= cheatcode is required for modules in folders outside the ISOs I boot, and to ensure there is no confusion to the ISO's /porteus/modules/ folder I name my folder with a capital letter, Modules. I do the same for Optional.
@Ed_P

For me "extramod= " is for modules loaded automatically on startup. I know that you can use the + sign to add the optionals in the module window,
but I'd like to know a solution for automatically assigning this optional folder with a cheatcode, but which one ?



I never knew Porteus supported booting ISOs. Has it always done it or is it new with 5.0?
in the Porteus 4 cheatcode.txt, there is already "from=/path/porteus.iso" :
'from=/linux-ISO/porteus.iso' will attempt to load the Porteus
data from an ISO file placed inside the 'linux-ISO' folder.

Rapha_
Shogun
Shogun
Posts: 238
Joined: 12 Jun 2021, 21:59
Distribution: Xfce 4.12 - 5.rc3 - x86_64
Location: France

How to create a Multi-Porteus Boot USB flash drive?

Post#9 by Rapha_ » 05 Oct 2023, 12:27

@cad

You can also load all Porteus desktops in multiboot mode (for each version)

You must then move all the 003-[DESTOP].xzm modules from the "base" folder to "optional".

like this :

Code: Select all

-- Porteus-5
    |-- syslinux
    |   
    |-- base
    |   |-- 000-kernel.xzm
    |   |-- 001-core.xzm
    |   |-- 002-xorg.xzm
    |   `-- 002-xtra.xzm
    |-- modules
    |   
    |-- optional
    |   |-- 003-lxde.xzm
    |   |-- 003-lxqt.xzm
    |   |-- 003-openbox.xzm  
    |   |-- 003-xfce.xzm


Then , edit your porteus.cfg like this :

Code: Select all

LABEL USB_A
MENU LABEL USB (XFCE-v5)
KERNEL /syslinux/vmlinuz
INITRD  /syslinux/initrd.xz
APPEND from=UUID:STrING-0F-ChARACtERS/Porteus-5 load=xfce.xzm
TEXT HELP
from=UUID:STrING-0F-ChARACtERS/Porteus-5
load=xfce.xzm 
ENDTEXT


LABEL USB_B
MENU LABEL USB (LXDE-v5)
KERNEL /syslinux/vmlinuz
INITRD  /syslinux/initrd.xz
APPEND from=UUID:STrING-0F-ChARACtERS/Porteus-5 load=lxde 
TEXT HELP
from=UUID:STrING-0F-ChARACtERS/Porteus-5
load=lxde 
ENDTEXT


LABEL USB_C
MENU LABEL USB (OPENBOX-v5)
KERNEL  /syslinux/vmlinuz
INITRD  /syslinux/initrd.xz
APPEND from=UUID:STrING-0F-ChARACtERS/Porteus-5 load=openbox 
TEXT HELP
from=UUID:STrING-0F-ChARACtERS/Porteus-5
load=openbox 
ENDTEXT



LABEL USB_D
MENU LABEL USB (LXQT-v5)
KERNEL /syslinux/vmlinuz
INITRD  /syslinux/initrd.xz
APPEND from=UUID:STrING-0F-ChARACtERS/Porteus-5 load=lxqt
TEXT HELP
from=UUID:STrING-0F-ChARACtERS/Porteus-5
load=lxqt
ENDTEXT

User avatar
cad
Black ninja
Black ninja
Posts: 69
Joined: 06 Nov 2020, 22:40
Distribution: XFCE 5.01 x86_64 + 4.0 i586

How to create a Multi-Porteus Boot USB flash drive?

Post#10 by cad » 05 Oct 2023, 13:36

Rapha_ wrote:
04 Oct 2023, 17:23
@cad
Can you show an example of your Porteus.cfg ?
Rapha, these are the first two entries in my porteus.cfg, which show my own application of the method you described:

LABEL PorXFCE501-x86_64-ORIG
MENU LABEL PorXFCE501-x86_64-ORIG
KERNEL /boot/syslinux/vmlinuz
INITRD /boot/syslinux/initrd.xz
APPEND from=/mnt/sdb1 3 noauto nomagic norootcopy copy2ram fsck volume=25% timezone=US/Pacific vga=791
TEXT HELP
PorXFCE501-x86_64-ORIG
ENDTEXT

LABEL PorXFCE501-x86_64-b1-wrk
MENU LABEL PorXFCE501-x86_64-b1-wrk
KERNEL /boot/syslinux/boot_Por501-x86_64-b1-wrk/vmlinuz
INITRD /boot/syslinux/boot_Por501-x86_64-b1-wrk/initrd.xz
APPEND from=/mnt/sdb1/ISOS/Por501-x86_64-b1-wrk 3 noauto nomagic norootcopy copy2ram fsck volume=25% timezone=US/Pacific vga=791
TEXT HELP
PorXFCE501-x86_64-b1-wrk
ENDTEXT

The first entry refers to the original Porteus 5.01, with the files extracted (and unmodified) from the standard Porteus XFCE 5.01 x86_64 iso, which I left in the root directory of the USB stick - I saw no need to change that.
The second entry refers to one of my several custom Porteuses which reside in the "ISOS" folder (I do not use isos), which I placed in the root directory of the USB stick as per your instructions. Using your method, I can boot as many instances of Porteus as I like, and it works without a glitch.
Thanks once again for posting it. I had wasted a lot of time trying to figure it out and your response put a big smile on my face. :)
Last edited by cad on 05 Oct 2023, 14:06, edited 3 times in total.

User avatar
cad
Black ninja
Black ninja
Posts: 69
Joined: 06 Nov 2020, 22:40
Distribution: XFCE 5.01 x86_64 + 4.0 i586

How to create a Multi-Porteus Boot USB flash drive?

Post#11 by cad » 05 Oct 2023, 13:42

Ed_P wrote:
04 Oct 2023, 21:24
No but i do have grub2 on one of my USB drives. I copied the Grub2Win folder on my hdd to the USB drive, which is formated FAT32, and it's EFI app to the EFI folder on the USB drive.
Thanks, it looks like a simple and effective way to go about it. I have been trying to do everything from Linux...

User avatar
cad
Black ninja
Black ninja
Posts: 69
Joined: 06 Nov 2020, 22:40
Distribution: XFCE 5.01 x86_64 + 4.0 i586

How to create a Multi-Porteus Boot USB flash drive?

Post#12 by cad » 05 Oct 2023, 13:46

Rapha_ wrote:
05 Oct 2023, 12:27
@cad

You can also load all Porteus desktops in multiboot mode (for each version)

You must then move all the 003-[DESTOP].xzm modules from the "base" folder to "optional".

like this :

Code: Select all

-- Porteus-5
    |-- syslinux
    |   
    |-- base
    |   |-- 000-kernel.xzm
    |   |-- 001-core.xzm
    |   |-- 002-xorg.xzm
    |   `-- 002-xtra.xzm
    |-- modules
    |   
    |-- optional
    |   |-- 003-lxde.xzm
    |   |-- 003-lxqt.xzm
    |   |-- 003-openbox.xzm  
    |   |-- 003-xfce.xzm


Then , edit your porteus.cfg like this :

Code: Select all

LABEL USB_A
MENU LABEL USB (XFCE-v5)
KERNEL /syslinux/vmlinuz
INITRD  /syslinux/initrd.xz
APPEND from=UUID:STrING-0F-ChARACtERS/Porteus-5 load=xfce.xzm
TEXT HELP
from=UUID:STrING-0F-ChARACtERS/Porteus-5
load=xfce.xzm 
ENDTEXT


LABEL USB_B
MENU LABEL USB (LXDE-v5)
KERNEL /syslinux/vmlinuz
INITRD  /syslinux/initrd.xz
APPEND from=UUID:STrING-0F-ChARACtERS/Porteus-5 load=lxde 
TEXT HELP
from=UUID:STrING-0F-ChARACtERS/Porteus-5
load=lxde 
ENDTEXT


LABEL USB_C
MENU LABEL USB (OPENBOX-v5)
KERNEL  /syslinux/vmlinuz
INITRD  /syslinux/initrd.xz
APPEND from=UUID:STrING-0F-ChARACtERS/Porteus-5 load=openbox 
TEXT HELP
from=UUID:STrING-0F-ChARACtERS/Porteus-5
load=openbox 
ENDTEXT



LABEL USB_D
MENU LABEL USB (LXQT-v5)
KERNEL /syslinux/vmlinuz
INITRD  /syslinux/initrd.xz
APPEND from=UUID:STrING-0F-ChARACtERS/Porteus-5 load=lxqt
TEXT HELP
from=UUID:STrING-0F-ChARACtERS/Porteus-5
load=lxqt
ENDTEXT
Thanks so much, it's fascinating... I very much appreciate your sharing your knowledge here! :thumbsup: :thumbsup: :thumbsup:

User avatar
Ed_P
Contributor
Contributor
Posts: 8374
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

How to create a Multi-Porteus Boot USB flash drive?

Post#13 by Ed_P » 05 Oct 2023, 15:56

This thread might interest you cad. :happy62:
[Solved] Security Boot Fail (Post by Ed_P #66853)
Ed

User avatar
cad
Black ninja
Black ninja
Posts: 69
Joined: 06 Nov 2020, 22:40
Distribution: XFCE 5.01 x86_64 + 4.0 i586

How to create a Multi-Porteus Boot USB flash drive?

Post#14 by cad » 05 Oct 2023, 19:37

Ed_P wrote:
05 Oct 2023, 15:56
This thread might interest you cad. :happy62:
[Solved] Security Boot Fail (Post by Ed_P #66853)
Ha! Thank you so very, very, very much, Ed_P!, for suggesting that thread. I have learned something important from it about grub2 security mechanism, totally new to me. I'll definitely give that Ubuntu method a try very soon and think it is the solution I was looking for to do it purely from Linux. Your approach with Grub2Win is also a good one as it gets the job done pretty easily. THANKS!!! :Yahoo!: :Yahoo!: :Yahoo!:

Rapha_
Shogun
Shogun
Posts: 238
Joined: 12 Jun 2021, 21:59
Distribution: Xfce 4.12 - 5.rc3 - x86_64
Location: France

How to create a Multi-Porteus Boot USB flash drive?

Post#15 by Rapha_ » 17 Oct 2023, 01:02

^
"extramod= cheat code" is required with iso, since their module folders are empty and read-only

--> what's missing is an "extramod=" cheat code for optional modules
For me "extramod= " is for modules loaded automatically on startup. I know that you can use the + sign to add the optionals in the module window,
but I'd like to know a solution for automatically assigning this optional folder with a cheatcode, but which one ?

I've just discovered something important about using the Porteus modules activation panel and the link it has with the extramod cheat code setting (for ISOs).

If you make a path to the target folder of your modules and if it's terminated by a slash "/", the option + to browse your folders and select the optional modules folder will fail, as you'll only find the ISO folder, which is empty.

  • extramod=/path/folder_with_modules/ ---> does't work
  • extramod=/path/folder_with_modules ---> easy way * to find another optional modules dir

(* Information : on differents Desktop the option to select an extramod dir is not a +; but a black rectangle icon )

Post Reply