grub2 menu entry (bis)

Non release banter
User avatar
francois
Contributor
Contributor
Posts: 6435
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

grub2 menu entry (bis)

Post#1 by francois » 27 Jul 2018, 02:30

I am trying to get porteus 4.0 running on my dell optiplex 45 desktop hdd.

Here is my custom_40:

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 "porteus on sda6 64bit_v31  XFCE" {
set root=UUID=ba41ed7f-ed95-4555-bdbd-2ccd5a345cf8
linux /64bit_v31/boot/syslinux/vmlinuz from=/dev/sdb1/64bit_v31 extramod=/mnt/sdb1/64bit_v31/xfce changes=/64bit_v31   login=root
initrd /64bit_v31/boot/syslinux/initrd.xz
}
menuentry "porteus on sda6 64bit_v31  XFCE" {
set root=(hd1,1)
linux /boot/syslinux/vmlinuz from=/dev/sdb1/64bit_v31 extramod=/mnt/sdb1/64bit_v31/xfce changes=/64bit_v31   login=root
initrd /boot/syslinux/initrd.xz
}
lsblk:

Code: Select all

root@debian:/home/rimbaud# lsblk -f
NAME   FSTYPE LABEL   UUID                                 MOUNTPOINT
sda                                                        
├─sda1 ext4           e9b98257-3751-4458-86cb-e01af19572e0 /
├─sda2                                                     
└─sda5 swap           a013dd46-2cfa-4238-982d-efb1e6229799 [SWAP]
sdb                                                        
├─sdb1 ext4   porteus ba41ed7f-ed95-4555-bdbd-2ccd5a345cf8 
└─sdb2 ext4   manjaro dbece8af-bf80-4407-8098-e086177240e8 
sr0                                                        
root@debian:/home/rimbaud# 
fdisk -l:

Code: Select all

root@debian:/home/rimbaud# fdisk -l
Disk /dev/sda: 74.5 GiB, 80000000000 bytes, 156250000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x41827a0a

Device     Boot     Start       End   Sectors  Size Id Type
/dev/sda1  *         2048 149979135 149977088 71.5G 83 Linux
/dev/sda2       149981182 156248063   6266882    3G  5 Extended
/dev/sda5       149981184 156248063   6266880    3G 82 Linux swap / Solaris


Disk /dev/sdb: 149.1 GiB, 160041885696 bytes, 312581808 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x75bd44ed

Device     Boot     Start       End   Sectors  Size Id Type
/dev/sdb1            2048 149415935 149413888 71.3G 83 Linux
/dev/sdb2       149415936 312580095 163164160 77.8G 83 Linux


root@debian:/home/rimbaud#

blkid

Code: Select all

root@debian:/home/rimbaud# blkid
/dev/sda1: UUID="e9b98257-3751-4458-86cb-e01af19572e0" TYPE="ext4" PARTUUID="41827a0a-01"
/dev/sda5: UUID="a013dd46-2cfa-4238-982d-efb1e6229799" TYPE="swap" PARTUUID="41827a0a-05"
/dev/sdb1: LABEL="porteus" UUID="ba41ed7f-ed95-4555-bdbd-2ccd5a345cf8" TYPE="ext4" PARTUUID="75bd44ed-01"
/dev/sdb2: LABEL="manjaro" UUID="dbece8af-bf80-4407-8098-e086177240e8" TYPE="ext4" PARTUUID="75bd44ed-02"
root@debian:/home/rimbaud# 
fstab:

Code: Select all

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda1 during installation
UUID=e9b98257-3751-4458-86cb-e01af19572e0 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=a013dd46-2cfa-4238-982d-efb1e6229799 none            swap    sw              0       0
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0
Porteus is on /dev/sdb1//64bit_v31. For these two entries I get an error message:
You've got to load the kernel first.

What could be wrong?
Prendre son temps, profiter de celui qui passe.

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

grub2 menu entry (bis)

Post#2 by Ed_P » 27 Jul 2018, 03:10

Code: Select all

menuentry "porteus on sda6 64bit_v31  XFCE" {
set root=UUID=ba41ed7f-ed95-4555-bdbd-2ccd5a345cf8
linux /64bit_v31/boot/syslinux/vmlinuz from=/dev/sdb1/64bit_v31 extramod=/mnt/sdb1/64bit_v31/xfce changes=/64bit_v31   login=root
initrd /64bit_v31/boot/syslinux/initrd.xz
}
menuentry "porteus on sda6 64bit_v31  XFCE" {
set root=(hd1,1)
linux /boot/syslinux/vmlinuz from=/dev/sdb1/64bit_v31 extramod=/mnt/sdb1/64bit_v31/xfce changes=/64bit_v31   login=root
initrd /boot/syslinux/initrd.xz
}
:P

Both menu items are specifying the same device. from=/dev/sdb1/64bit_v31

If you are setting root to the device you want to boot I don't think you need to specify the device address in the boot parms. Try just from=/64bit_v31.

Try something like this.

Code: Select all

menuentry "porteus on usb 64bit_v31  XFCE" {
set root=UUID=ba41ed7f-ed95-4555-bdbd-2ccd5a345cf8
linux  /64bit_v31/boot/syslinux/vmlinuz from=/64bit_v31 extramod=/64bit_v31/xfce changes=/64bit_v31   login=root
initrd /64bit_v31/boot/syslinux/initrd.xz
}
menuentry "porteus on hard drive 64bit_v31  XFCE" {
set root=(hd1,1)
linux  /boot/syslinux/vmlinuz from=/64bit_v31 extramod=/64bit_v31/xfce changes=/64bit_v31   login=root
initrd /boot/syslinux/initrd.xz
}
Ed

User avatar
francois
Contributor
Contributor
Posts: 6435
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

grub2 menu entry (bis)

Post#3 by francois » 01 Aug 2018, 01:32

And finally, the solution.

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 "porteus on sdb1 frugal  XFCE" {
set root=UUID=ba41ed7f-ed95-4555-bdbd-2ccd5a345cf8
linux /64bit_v31/boot/syslinux/vmlinuz from=/64bit_v31 extramod=/64bit_v31/xfce changes=/64bit_v31 login=root 
initrd /64bit_v31/boot/syslinux/initrd.xz
}
menuentry "porteus on sdb1 64bit_v31 frugal XFCE" {
set root=(hd1,1)
linux /64bit_v31/boot/syslinux/vmlinuz from=/64bit_v31 extramod=/64bit_v31/xfce changes=/64bit_v31 login=root 
initrd /64bit_v31/boot/syslinux/initrd.xz
}
menuentry "Porteus NEMESIS ISO" {
insmod part_msdos
insmod ext2
set root=(hd1,1)
set isofile="/isos/nemesis-xfce-18.07.07-x86_64.iso"
search --no-floppy --file --set=root $isofile
loopback loop $isofile
linux (loop)/boot/syslinux/vmlinuz from=$isofile extramod=/isos/modules login=root changes=/1_nemesis
initrd (loop)/boot/syslinux/initrd.xz
}
porteus 4.0 on sdb1 frugal XFCE works
- both for set root=UUID and set root=(hd1,1)
nemesis iso works.

But set root=UUID does not work.

Thanks for the clue Ed. :happy62:
Prendre son temps, profiter de celui qui passe.

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

grub2 menu entry (bis)

Post#4 by Ed_P » 01 Aug 2018, 04:09

You're welcome. :beer:
Ed

User avatar
francois
Contributor
Contributor
Posts: 6435
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

grub2 menu entry (bis)

Post#5 by francois » 01 Aug 2018, 21:26

:( updated precedent post.
Prendre son temps, profiter de celui qui passe.

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

grub2 menu entry (bis)

Post#6 by Ed_P » 01 Aug 2018, 22:01

:o

Try replacing the

Code: Select all

set root=UUID=ba41ed7f-ed95-4555-bdbd-2ccd5a345cf8

-with-

search --no-floppy --fs-uuid --set=root ba41ed7f-ed95-4555-bdbd-2ccd5a345cf8

-or-

search --no-floppy --fs-uuid ba41ed7f-ed95-4555-bdbd-2ccd5a345cf8 --set=root
I think the format changed with grub2 2.02.


Usually for things that can change I set the changing item as a variable then use the variable's name in following commands. Works great for ISOs. :) So maybe a better approach would be:

Code: Select all

set usbdrv=ba41ed7f-ed95-4555-bdbd-2ccd5a345cf8
search --no-floppy --fs-uuid --set=root $usbdrv
Ed

User avatar
francois
Contributor
Contributor
Posts: 6435
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

grub2 menu entry (bis)

Post#7 by francois » 03 Aug 2018, 02:38

From:
https://ubuntuforums.org/showthread.php?t=1373394

Code: Select all

search --no-floppy --fs-uuid --set ba41ed7f-ed95-4555-bdbd-2ccd5a345cf8
Did the job.

Thanks.
Prendre son temps, profiter de celui qui passe.

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

grub2 menu entry (bis)

Post#8 by Ed_P » 03 Aug 2018, 03:42

Interesting. That thread is 8+ yrs old.

Happy you got a working menu. :good: Did you try the search command I suggested?

search --no-floppy --fs-uuid --set=root ba41ed7f-ed95-4555-bdbd-2ccd5a345cf8
Ed

User avatar
francois
Contributor
Contributor
Posts: 6435
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

grub2 menu entry (bis)

Post#9 by francois » 03 Aug 2018, 19:32

I fell on that thread before finding your suggestion

Actually,
=root
in
--set=root ba41ed7f-ed95-4555-bdbd-2ccd5a345cf8
seems not necessary.
Prendre son temps, profiter de celui qui passe.

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

grub2 menu entry (bis)

Post#10 by Ed_P » 03 Aug 2018, 19:59

It is true =root is still the default if another variable is not named. Just not sure how much longer that will be true. :happy62:
Ed

Post Reply