Nemesis update- v24.01 (2024-01-18)

Arch based Porteus community project

Moderator: M. Eerie

User avatar
dreadbird
Samurai
Samurai
Posts: 182
Joined: 08 Dec 2024, 04:30
Distribution: porteus5

Nemesis update- v24.01 (2024-01-18)

Post#31 by dreadbird » 22 Feb 2025, 18:35

Ed_P wrote:
22 Feb 2025, 07:03
Two grub2 menus for my Porteus 5.01 FAT32 USB drive.

Code: Select all

menuentry " Porteus 5.0 USB - EFI" --class slackware   --class user-icon-porteus  {

     set bootmgr=/EFI/boot/bootx64.efi         

     set bootdrv=$root
     search -f $bootmgr --set=root
     echo USB: $root
     sleep -v -i 4
     if [ $root != $bootdrv ]; then
        chainloader $bootmgr
     else
        echo "----------------------------------------"
        echo USB drive NOT found.
        echo
        sleep -v -i 10
     fi
     set root=$bootdrv
     }

menuentry " Porteus 5.0 USB - AF'" --class slackware   --class user-icon-porteus  {

     set bootparms="volume=33 reboot=cold extramod=/Modules" 

     set bootdrv=$root
     search -f /boot/syslinux/vmlinuz --set=root
     if [ $root != $bootdrv ]; then
        linux  /boot/syslinux/vmlinuz $bootparms
        initrd /boot/syslinux/initrd.xz
     else
        echo "----------------------------------------"
        echo USB drive NOT found.
        echo
        sleep -v -i 10
     fi
     set root=$bootdrv
     }
Not that hard to set up. :) The top menu brings up the porteus.cfg menu, the bottom menu boots directly to the Porteus DE.

The hardest part can be determining the value for root. IMO It is better to search for the drive being booted than assign a suspected drive letter, which may be wrong. Another option is using the drive's UUID code. A grub2 menu with something like this can help:

Code: Select all

     set USB_drv=/boot/syslinux/vmlinuz     # Can be a unique user named file on the drve.  "My1stPorteusUSB.txt"

     echo "Boot drive: "$root
     echo " "
     search -f $USB_drv --set=root
     if [ $? = 0 ]; then
        echo "USB drive:  "$root
        probe -u $root --set=USBuuid
        echo "UUID: "$USBuuid
        echo " "
        echo " "
        sleep -i -v 30 ; echo
     else
        echo "----------------------------------------"
        echo " "
        echo "No USB drive found."
        echo " "
        ls ; echo
        sleep -i -v 10 ; echo
     fi
In that case it works fully with either mbr or a gpt drive. I just cant figure out how to manipulate grub2 from porteus complains about aufs. So my main grub2 on my system is installed from ubuntu and i manage it in ubuntu with grub-customizer. And for virtual box I used debian to install it to a .vdi then can use that .vdi (remove debian) to use grub

update I figured it out. With the grub2.06 module

edit custom 40 to what you want
sudo grub-install --boot-directory=/mnt/sda1/boot /dev/sda

will install grub to the drive

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

Nemesis update- v24.01 (2024-01-18)

Post#32 by Ed_P » 23 Feb 2025, 06:16

dreadbird wrote:
22 Feb 2025, 18:35
I just cant figure out how to manipulate grub2 from porteus complains about aufs.
I use Cinnamon's Text Editor xed and Windows' Notepad for editting my grub2 .cfg files. No problems with aufs on eithor system. But I don't reinstall grub2 every time I edit a boot menu, I edit grub2's grub.cfg file directly or the userfiles/usersection.cfg file.

What does your /dev/sda drive's grub2 folder look like? This is mine from my Grub2Win install:

Code: Select all

guest@porteus:/mnt/nvme0n1p3$ ls -Hon grub2 
total 1280
drwxrwxrwx 1 1000    4096 Dec  2 23:32 fonts/
drwxrwxrwx 1 1000    4096 Dec  2 23:32 g2bootmgr/
-rwxrwxrwx 1 1000    7613 Feb 23 01:09 grub.cfg*
-rwxrwxrwx 1 1000 1034832 Dec  2 13:33 grub2win.exe*
-rwxrwxrwx 1 1000    1024 Jul  2  2024 grubenv*
drwxrwxrwx 1 1000   65536 Dec  2 23:32 i386-efi/
drwxrwxrwx 1 1000   65536 Dec  2 23:32 i386-pc/
drwxrwxrwx 1 1000    4096 Dec  2 23:32 locale/
drwxrwxrwx 1 1000    4096 Feb 10 02:35 themes/
-rwxrwxrwx 1 1000   22407 Feb 10 02:35 update.log*
drwxrwxrwx 1 1000    8192 Feb 13 20:04 userfiles/
drwxrwxrwx 1 1000    4096 Feb 10 02:35 windata/
drwxrwxrwx 1 1000       0 Dec  2 23:32 winhelp/
drwxrwxrwx 1 1000   12288 Feb 13 11:15 winsource/
drwxrwxrwx 1 1000   65536 Dec  2 23:32 x86_64-efi/
guest@porteus:/mnt/nvme0n1p3$ 
Added in 53 minutes 11 seconds:
From what I've found your grub.cfg file is in a /boot/grub2/ folder. How that relates to Porteus's /boot folder I don't know.

Post Reply