Booting porteus-5.0rc3 with Grub boot loader

Technical issues/questions of an intermediate or advanced nature.
Post Reply
raja
Shogun
Shogun
Posts: 317
Joined: 02 May 2017, 09:51
Distribution: v3.2.2-32 and Porteus-Artix-64
Location: Chennai,India

Booting porteus-5.0rc3 with Grub boot loader

Post#1 by raja » 12 Jul 2021, 10:58

This script was auto generated by grub to use porteus.cfg. Enjoy both grub and syslinux boot loaders.Place grub and syslinux folders in /boot.

grub.cfg

Code: Select all

if loadfont $prefix/unicode.pf2 ; then
  set gfxmode=800x600
  insmod efi_gop
  insmod efi_uga
  insmod video_bochs
  insmod video_cirrus
  insmod gfxterm
  insmod jpeg
  insmod png
  terminal_output gfxterm
fi
background_image '.'/'porteus.png'
set timeout=9
 default='GRAPHICAL'
menuentry 'Graphics mode' --id 'PORTEUS' {
#APPEND changes=/porteus 

 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/boot/vmlinuz-5.12.14' 
  initrd$linux_suffix '/'/'/boot/initrd-5.0rc3.xz' 
}
menuentry 'Always Fresh' --id 'fresh' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/boot/vmlinuz-5.12.14' nomagic base_only norootcopy 
  initrd$linux_suffix '/'/boot/initrd-5.0rc3' 
}
menuentry 'Copy To RAM' --id 'copy2ram' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/boot/syslinux/vmlinuz-5.12.14' copy2ram 
  initrd$linux_suffix '/'/'/boot/syslinux/initrd-5.0rc3.xz' 
}
menuentry 'Text mode' --id 'text' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/boot/syslinux/vmlinuz-5.12.14' 3
  initrd$linux_suffix '/'/'/boot/syslinux/initrd-5.0rc3.xz' 
}
menuentry 'Porteus as PXE server' --id 'pxe-boot' {
  # UNSUPPORTED command 'MENU SEPARATOR'

 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/boot/syslinux/vmlinuz-5.12.14' pxe
  initrd$linux_suffix '/'/'/boot/syslinux/initrd-5.0rc3.xz' 
}
menuentry 'PLoP BootManager' --id 'plop' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/boot/syslinux/plpbt' 
}
menuentry 'Boot from the first hd' --id 'hd' {
 root=h0,2;
 chainloader +1;
}
grub folder shall have x86_64-efi folder .efiboot.img and unicode.pf2 (all installed by grub or manually copied.

I have renamed vmlinuz and initrd.xz
Linux Kernel-4.4.272 -32 bit; Linux Kernel-5.4.126 - 64 bit

User avatar
Ed_P
Contributor
Contributor
Posts: 6236
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 4.0 & 5.0rc3 ISOs
Location: Western NY, USA

Booting porteus-5.0rc3 with Grub boot loader

Post#2 by Ed_P » 13 Jul 2021, 05:41

raja wrote:
12 Jul 2021, 10:58
This script was auto generated by grub to use porteus.cfg.
Could you explain this in a little more detail? What was inputted to grub to generate this cfg and how?
Ed

raja
Shogun
Shogun
Posts: 317
Joined: 02 May 2017, 09:51
Distribution: v3.2.2-32 and Porteus-Artix-64
Location: Chennai,India

Booting porteus-5.0rc3 with Grub boot loader

Post#3 by raja » 13 Jul 2021, 10:16

Ed_P,

A few days ago, I put up grub-2.06 module for download. Move and Activate.

open terminal,

Code: Select all

grub-syslinux2cfg /mnt[/sdxn/boot/syslinux/porteus.cfg
Your main boot code is ready. i.e grub.cfg

I would have added few other lines at the top in the grub cfg., manually, to represent grub style.
grub folder needs to have those three files/folders, given in the last line. (look for those in /usr/lib/grub folder or in /usr/share)

It copies few modules from the xxx.efi folder during boot.

That is it...Cheers.
Linux Kernel-4.4.272 -32 bit; Linux Kernel-5.4.126 - 64 bit

User avatar
Ed_P
Contributor
Contributor
Posts: 6236
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 4.0 & 5.0rc3 ISOs
Location: Western NY, USA

Booting porteus-5.0rc3 with Grub boot loader

Post#4 by Ed_P » 13 Jul 2021, 16:14

raja wrote:
13 Jul 2021, 10:16
A few days ago, I put up grub-2.06 module for download.
:%) Can you post link to where? I can't find it? :(
Ed

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3051
Joined: 20 Mar 2012, 03:42
Distribution: 5.0-current-64bit
Location: australia
Contact:

Booting porteus-5.0rc3 with Grub boot loader

Post#5 by ncmprhnsbl » 13 Jul 2021, 23:39

Ed_P wrote:
13 Jul 2021, 16:14
Can you post link to where? I can't find it?
this one: grub-2.06 - Latest
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Ed_P
Contributor
Contributor
Posts: 6236
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 4.0 & 5.0rc3 ISOs
Location: Western NY, USA

Booting porteus-5.0rc3 with Grub boot loader

Post#6 by Ed_P » 14 Jul 2021, 01:02

Thank you. :) :beer:
Ed

User avatar
Ed_P
Contributor
Contributor
Posts: 6236
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 4.0 & 5.0rc3 ISOs
Location: Western NY, USA

Booting porteus-5.0rc3 with Grub boot loader

Post#7 by Ed_P » 22 Jul 2021, 22:49

:%)

Code: Select all

guest@porteus:~$ grub-mkconfig
bash: grub-mkconfig: command not found
guest@porteus:~$ grub-mkconfig
grub-mkconfig: You must run this as root
guest@porteus:~$ su
Password: 
root@porteus:/home/guest# grub-mkconfig
/usr/bin/grub-probe: error: failed to get canonical path of `aufs'.
root@porteus:/home/guest# grub-mkconfig --help
Usage: grub-mkconfig [OPTION]
Generate a grub config file

  -o, --output=FILE       output generated config to FILE [default=stdout]
  -h, --help              print this message and exit
  -V, --version           print the version information and exit

Report bugs to <bug-grub@gnu.org>.
root@porteus:/home/guest# grub-mkconfig -o /tmp/grub.cfg
/usr/bin/grub-probe: error: failed to get canonical path of `aufs'.
root@porteus:/home/guest# 
Added in 12 minutes 33 seconds:
:%)

Code: Select all

root@porteus:/home/guest# grub-syslinux2cfg /mnt/isoloop/boot/syslinux/porteus.cfg
  background_image '/mnt/isoloop/boot/syslinux'/'porteus.png'
  # UNSUPPORTED command 'UI vesamenu.c32'
  # UNSUPPORTED command 'MENU TITLE Porteus-5.0 64bit'

  # UNSUPPORTED command 'MENU WIDTH 30'
  # UNSUPPORTED command 'MENU MARGIN 2'
  # UNSUPPORTED command 'MENU ROWS 10'
  # UNSUPPORTED command 'MENU HELPMSGROW 17'
  # UNSUPPORTED command 'MENU TIMEOUTROW 28'
  # UNSUPPORTED command 'MENU TABMSGROW 15'
  # UNSUPPORTED command 'MENU CMDLINEROW 22'
  # UNSUPPORTED command 'MENU HSHIFT 4'
  # UNSUPPORTED command 'MENU VSHIFT 5'

  # UNSUPPORTED command 'menu color screen	37;40      #00000000 #00000000 none'
  # UNSUPPORTED command 'menu color border	30;44      #00000000 #00000000 none'
  # UNSUPPORTED command 'menu color title	1;36;44    #ffF6FF00 #30003f07 none'
  # UNSUPPORTED command 'menu color unsel	37;44      #ffffffff #00000000 none'
  # UNSUPPORTED command 'menu color hotkey	1;37;44    #ff8037b7 #00000000 none'
  # UNSUPPORTED command 'menu color sel		7;37;40    #ff111B78 #003f7fbf none'
  # UNSUPPORTED command 'menu color hotsel	1;7;37;40  #ffaf67f7 #003f7fbf none'
  # UNSUPPORTED command 'menu color scrollbar	30;44      #00000000 #00000000 none'

  # UNSUPPORTED command 'menu color tabmsg	31;40      #ffB6F538 #00000000 none'
  # UNSUPPORTED command 'menu color cmdmark	1;36;40    #ffff0000 #00000000 none'
  # UNSUPPORTED command 'menu color cmdline	37;40      #ffffffff #ff000000 none'
  # UNSUPPORTED command 'menu color pwdborder	30;47      #ffff0000 #00000000 std'
  # UNSUPPORTED command 'menu color pwdheader	31;47      #ffff0000 #00000000 std'
  # UNSUPPORTED command 'menu color pwdentry	30;47      #ffff0000 #00000000 std'
  # UNSUPPORTED command 'menu color timeout_msg	37;40      #ff809aef #00000000 none'
  # UNSUPPORTED command 'menu color timeout	1;37;40    #ffb72f9f #00000000 none'
  # UNSUPPORTED command 'menu color help		37;40      #ffD5F538 #00000000 none'
  # UNSUPPORTED command 'menu color msg07	37;40      #90ffffff #00000000 std'


set timeout=9
 default='GRAPHICAL'
menuentry 'Graphics mode' --id 'GRAPHICAL' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/boot/syslinux/vmlinuz' changes=/porteus
  initrd$linux_suffix '/'/'/boot/syslinux/initrd.xz' 
}
menuentry 'Always Fresh' --id 'fresh' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/boot/syslinux/vmlinuz' nomagic base_only norootcopy
  initrd$linux_suffix '/'/'/boot/syslinux/initrd.xz' 
}
menuentry 'Copy To RAM' --id 'copy2ram' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/boot/syslinux/vmlinuz' copy2ram
  initrd$linux_suffix '/'/'/boot/syslinux/initrd.xz' 
}
menuentry 'Text mode' --id 'text' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/boot/syslinux/vmlinuz' 3
  initrd$linux_suffix '/'/'/boot/syslinux/initrd.xz' 
}
menuentry 'Porteus as PXE server' --id 'pxe-boot' {
  # UNSUPPORTED command 'MENU SEPARATOR'

 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/boot/syslinux/vmlinuz' pxe
  initrd$linux_suffix '/'/'/boot/syslinux/initrd.xz' 
}
menuentry 'PLoP BootManager' --id 'plop' {
 if test x$grub_platform = xpc; then linux_suffix=16; else linux_suffix= ; fi
  linux$linux_suffix '/'/'/boot/syslinux/plpbt' 
}
menuentry 'Boot from the first hd' --id 'hd' {
 root=h0,2;
 chainloader +1;
}
menuentry 'Reboot the system' --id 'reboot' {
  reboot
}

root@porteus:/home/guest# ls *.cfg
/bin/ls: cannot access '*.cfg': No such file or directory
root@porteus:/home/guest# 
Where is the grub.cfg file? :unknown:

And why the UNSUPPORTED commands?
Ed

raja
Shogun
Shogun
Posts: 317
Joined: 02 May 2017, 09:51
Distribution: v3.2.2-32 and Porteus-Artix-64
Location: Chennai,India

Booting porteus-5.0rc3 with Grub boot loader

Post#8 by raja » 24 Jul 2021, 11:13

Unpack archive, and put grub folder inside boot folder, in your USB disk with grub boot loader.

Since we have used /boot/syslinux for vmlinuz and initrd.xz, location, keep them there.

When grub shows your porteus menu, smile and bite into a chocolate bar.

https://www.mediafire.com/file/lwmh5f17 ... ar.gz/file

If you want porteus.png, please change resolution to 640x480 in the menu or resize picture to 800x600
Linux Kernel-4.4.272 -32 bit; Linux Kernel-5.4.126 - 64 bit

User avatar
Ed_P
Contributor
Contributor
Posts: 6236
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 4.0 & 5.0rc3 ISOs
Location: Western NY, USA

Booting porteus-5.0rc3 with Grub boot loader

Post#9 by Ed_P » 24 Jul 2021, 19:05

Thank you raja. I think I'm beginning to understand. Your grub-2.06.xzm is designed to add grub2 support to a bootable Porteus USB drive that is booted. I have a grub2 bootable USB drive and I'm running from a booted Porteus ISO file.

It's too bad the grub-syslinux2cfg command doesn't accept a -o command.
Ed

Post Reply