grub 2.02 multiboot for porteus and archlinux

Porteus based on Arch with pacman package manager.
Post Reply
User avatar
francois
Contributor
Contributor
Posts: 4937
Joined: 28 Dec 2010, 14:25
Distribution: kde xfce porteus manjaro kubun
Location: Enfin l'été, le changement climatique attendu: le soleil.

grub 2.02 multiboot for porteus and archlinux

Post#1 by francois » 01 Oct 2015, 01:37

Unable to use my favorite and old fashioned bootloader (Ed :roll:), I am stuck now with grub 2.02 beta that comes stock with archlinux. As I am experimenting with a porteus-archlnux hybrid to get a better understanding of both systems, I will propose my solution to boot both archlinux and porteus under the multiboot method archlinux wiki cited in the following links, which covers the set isoname command and syntax. Thus, which permits booting from iso under grub 2.

Don't fool around for info on set isoname on archlinux, go to:
https://bbs.archlinux.org/edit.php?id=1565724
https://wiki.archlinux.org/index.php/Mu ... lling_GRUB

The following syntax will permit to run from porteus.iso or archlinux.iso. The only modification needed is in 40_custom folder:

/etc/grub.d/40_custom:

Code: Select all

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

# path to the partition holding ISO images (using UUID)
probe -u $root --set=rootuuid
set imgdevpath="/dev/disk/by-uuid/$rootuuid"

menuentry '[loopback]archlinux-2015.09.01-dual.iso' {
	set isofile='/ISO/archlinux-2015.09.01-dual.iso'
	loopback loop $isofile
	linux (loop)/arch/boot/x86_64/vmlinuz archisodevice=/dev/loop0 img_dev=$imgdevpath img_loop=$isofile
	initrd (loop)/arch/boot/x86_64/archiso.img
}
menuentry "Arch Linux Install  ISO" {
  set isoname='archlinux-2015.09.01-dual.iso'
  set isofile=/ISO/$isoname
  echo "Using ${isoname}...'
  loopback loop $isofile
  linux (loop)/arch/boot/x86_64/vmlinuz img_dev=$imgdevpath img_loop=$isofile archisobasedir=arch archisolabel=ARCH_201509
  initrd (loop)/arch/boot/x86_64/archiso.img
}
menuentry "porteus on sda5 64bit_v31  XFCE" {
set root=(hd0,6)
linux /64bit_v31/boot/syslinux/vmlinuz from=/dev/sda6/64bit_v31 extramod=/mnt/sda6/64bit_v31/xfce changes=EXIT:/64bit_v31/xfce   login=root
initrd /64bit_v31/boot/syslinux/initrd.xz
}
menuentry "Porteus XFCE x86-64 ISO" {
insmod part_msdos
insmod ext2
set root=(hd0,1)
set isofile="/ISO/Porteus-XFCE-v3.1-x86_64.iso"
search --no-floppy --file --set=root $isofile
loopback loop $isofile
linux (loop)/boot/syslinux/vmlinuz from=$isofile changes=1_porteus login=root
initrd (loop)/boot/syslinux/initrd.xz
}
menuentry "Porteus XFCE x86-64 ISO" {
insmod part_msdos
insmod ext2
set root=(hd0,1)
set isofile="/ISO/Porteus-XFCE-v3.1-x86_64.iso"
search --no-floppy --file --set=root $isofile
loopback loop $isofile
linux (loop)/boot/syslinux/vmlinuz from=$isofile changes=1_porteus login=root copy2ram
initrd (loop)/boot/syslinux/initrd.xz
}
1.0 imgdevpath configuration instructions at the beginning of the file are essential or nothing will work.
2.0 update-grub will not reset grub.cfg under archlinux, you need to use:

Code: Select all

# grub-mkconfig -o /boot/grub/grub.cfg
I hate grub 2.02. =@
How to make things complex when they could be so simple. This is not KISS technology, and personally syslinux is not that much better. :evil:
And the pretext to such sophistication is a more secure system. :roll:
Voltaire: Le mieux est l'ennemi du bien.

User avatar
Ed_P
Contributor
Contributor
Posts: 3144
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit ISO
Location: Western NY, USA

Re: grub 2.02 multiboot for porteus and archlinux

Post#2 by Ed_P » 01 Oct 2015, 04:24

francois wrote: /etc/grub.d/40_custom:

Code: Select all

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

# path to the partition holding ISO images (using UUID)
probe -u $root --set=rootuuid
set imgdevpath="/dev/disk/by-uuid/$rootuuid"

menuentry '[loopback]archlinux-2015.09.01-dual.iso' {
	set isofile='/ISO/archlinux-2015.09.01-dual.iso'
	loopback loop $isofile
	linux (loop)/arch/boot/x86_64/vmlinuz archisodevice=/dev/loop0 img_dev=$imgdevpath img_loop=$isofile
	initrd (loop)/arch/boot/x86_64/archiso.img
}
menuentry "Arch Linux Install  ISO" {
  set isoname='archlinux-2015.09.01-dual.iso'
  set isofile=/ISO/$isoname
  echo "Using ${isoname}...'
  loopback loop $isofile
  linux (loop)/arch/boot/x86_64/vmlinuz img_dev=$imgdevpath img_loop=$isofile archisobasedir=arch archisolabel=ARCH_201509
  initrd (loop)/arch/boot/x86_64/archiso.img
}
menuentry "porteus on sda5 64bit_v31  XFCE" {
set root=(hd0,6)
linux /64bit_v31/boot/syslinux/vmlinuz from=/dev/sda6/64bit_v31 extramod=/mnt/sda6/64bit_v31/xfce changes=EXIT:/64bit_v31/xfce   login=root
initrd /64bit_v31/boot/syslinux/initrd.xz
}
menuentry "Porteus XFCE x86-64 ISO" {
insmod part_msdos
insmod ext2
set root=(hd0,1)
set isofile="/ISO/Porteus-XFCE-v3.1-x86_64.iso"
search --no-floppy --file --set=root $isofile
loopback loop $isofile
linux (loop)/boot/syslinux/vmlinuz from=$isofile changes=1_porteus login=root
initrd (loop)/boot/syslinux/initrd.xz
}
menuentry "Porteus XFCE x86-64 ISO" {
insmod part_msdos
insmod ext2
set root=(hd0,1)
set isofile="/ISO/Porteus-XFCE-v3.1-x86_64.iso"
search --no-floppy --file --set=root $isofile
loopback loop $isofile
linux (loop)/boot/syslinux/vmlinuz from=$isofile changes=1_porteus login=root copy2ram
initrd (loop)/boot/syslinux/initrd.xz
}
Does this actually work? Based on my grub4dos experience set commands need to be done prior to the menu commands to be consistent when executing the menu items. And I'm not sure the /dev and /mnt paths are available in the bootloaders.




:%) Just read your links. Forget what I said.
Ed

User avatar
normalGuy
Black ninja
Black ninja
Posts: 48
Joined: 06 Nov 2015, 23:36
Distribution: porteus 3.2 xfce archBang
Location: uk & portugal

Re: grub 2.02 multiboot for porteus and archlinux

Post#3 by normalGuy » 10 Feb 2017, 12:33

Hi,
Ok, I'm using a usb multiboot that is becoming too "fat" so I'ḿ going ext4 with an external disk.

Porteus is the sdb1 and the others sdb2 ... How to grub the thing 40.custom in Porteus-XFCE-v3.2.1-x86_64? :wall:

In sda I'm using archLinux.

Thanks.

Post Reply