Navigating Multiboot GRUB2 menu entries successfully.

Non release banter
Post Reply
User avatar
surio
Black ninja
Black ninja
Posts: 49
Joined: 17 Mar 2013, 08:14
Distribution: 2.1 RC2 64/32 KDE/Razor-Qt
Location: Jambudvipa
Contact:

Navigating Multiboot GRUB2 menu entries successfully.

Post#1 by surio » 20 May 2013, 22:56

I am creating a multiboot external HDD out of an old IDE->USB disk. Made separate ext4 partitions on this and "installed porteus to HDD" by running my USB porteus 2.0 32 and 64 bit sessions. I am assuming that by doing this, I will have an exact replica of my customised USB porteus into the partitions specified. Indeed, all my modules have been copied over, as well as the container dat files that were used in the USB for saving and restoring previous sessions in the USB.

So, for example, porteus 32 is located in /dev/sdX8 as follows: /boot and /porteus directly in the / on /dev/sdX8. The dat file is located in /porteus/optional for the 32-bit version. For the 64 bit, I had created the dat file in a separate dir called /savefile in / of the USB drive. The same setup is replicated for the 64 bit partition also:


My custom grub entries are like this:

Code: Select all

menuentry "Porteus 2.0 -- 64 bit"   {
set root='hd0,msdos7' ### (hd1,7)
linux /boot/syslinux/vmlinuz rw  from=/ ##changes=/porteus/optional/port32sav.dat
initrd /boot/syslinux/initrd.xz
}

menuentry "Porteus 2.0 -- 32 bit"   {
set root='hd0,msdos8' ### (hd1,8)
linux /boot/syslinux/vmlinuz rw from=/ ##changes=/porteus/optional/port32sav.dat
initrd /boot/syslinux/initrd.xz
}
With this entry, I have successfully booted into the 32 bit porteus so far. But, it appears that I am in the always Fresh mode, every time. During the boot itself I get a message saying my from was not understood, and that all devices will be scanned. Every time I reboot into porteus, the wifi password is not remembered. That (sort of) confirms my suspicions that my settings are not being looked up. Also, my GUI customisation is also not being reflected.

Ideally, I would like the Porteus menu to pop up after I select the Porteus 32 in the menu entry. I suspect that would allow me to choose the correct menu options, thereby passing the right cheatcodes and get back my custom setup.

So,
  1. Is there a way for me to invoke the Porteus menu when I choose the above menu entry? If so, what is the command? (This is the best option for me, I would like to use one of the 4 options at any given time)
  2. Assuming the above scenario is impossible (I doubt it), what is the correct invocation for the "from" cheatcode, in order for it to correctly pull up the other params?
  3. Given that only 2) is feasible, how do I explicitly specify it to pull up the info from the .dat file.
  4. Also given that the partitions containing 32 and 64 bit are actually ext4 now, how do I instruct Porteus to roll over from the .dat file to directly storing data in the filesystem itself.

Many thanks in advance.
Surio. :)
http://porteus.org/forum/images/ranks/user.png
Do, or do not. There is no try.

neko
DEV Team
DEV Team
Posts: 993
Joined: 09 Feb 2013, 09:55
Distribution: APorteus-FVWM-ja-x86_64.iso
Location: japan

Re: Navigating Multiboot GRUB2 menu entries successfully.

Post#2 by neko » 21 May 2013, 01:26

I think that Porteus is booted with .dat by the menu

menuentry "Porteus 2.0 -- 64 bit" {
set root='hd0,msdos7' ### (hd1,7)
linux /boot/syslinux/vmlinuz rw from=/dev/sdX7 changes=/dev/sdX7/porteus/optional/port64sav.dat
initrd /boot/syslinux/initrd.xz
}

menuentry "Porteus 2.0 -- 32 bit" {
set root='hd0,msdos8' ### (hd1,8)
linux /boot/syslinux/vmlinuz rw from=/dev/sdX8 changes=/dev/sdX8/porteus/optional/port32sav.dat
initrd /boot/syslinux/initrd.xz
}

User avatar
surio
Black ninja
Black ninja
Posts: 49
Joined: 17 Mar 2013, 08:14
Distribution: 2.1 RC2 64/32 KDE/Razor-Qt
Location: Jambudvipa
Contact:

Re: Navigating Multiboot GRUB2 menu entries successfully.

Post#3 by surio » 21 May 2013, 05:23

@neko,
Thanks for the reply.
Regarding your suggestion on the menu entries, I am making those changes to my menu (will reboot later and test), but I made a small change. This is how I wrote it:

Code: Select all

menuentry "Porteus 2.0 -- 64 bit"   {
set root='hd0,msdos7' ### (hd1,7)
linux /boot/syslinux/vmlinuz rw  from=/dev/disk/by-label/port64 ##changes=/savefile/port2-64b.dat
initrd /boot/syslinux/initrd.xz	
}

menuentry "Porteus 2.0 -- 32 bit"   {
set root='hd0,msdos8' ### (hd1,8)
linux /boot/syslinux/vmlinuz rw from=/dev/disk/by-label/port32 ##changes=/porteus/optional/port32sav.dat
initrd /boot/syslinux/initrd.xz
}
EDIT:
No, that did not work. Unfortunately I got this error:

Code: Select all

rmdir /mnt//dev/sdb2 could not mount 
incorrect from= code. Press RETURN to try all possible devices
Output of my /proc/cmdline

Code: Select all

quiet BOOT_IMAGE=/boot/syslinux/vmlinuz rw from=/dev/disk/by-label/port32
END of EDIT


So, @all,

Since it is accessing the same partition, but with something more permanent than disk letters that might change, it should be okay? Secondly, I also realise that my porteus.cfg file needs some changing. This is my menu entry from porteus.cfg:

Code: Select all

APPEND initrd=initrd.xz changes=/mnt/sdb/porteus/optional/port32sav.dat 
TEXT HELP
    Run Porteus the best way we can.
    Try to autoconfigure graphics
    card and use the maximum
    allowed resolution
ENDTEXT
Note the "changes=" parameter. The device name is hard-coded, and shouldn't be that way! Just realised that in the case of porteus.cfg above, disk/dat file recognition has been successful because I have not introduced too many edge cases by plugging yet another USB/disk at boot time :oops: .

What is a good way to rewrite that param, given that I have moved the configuration into a separate ex4 partition. Or going one step further, how to do away with the dat file and make it persistent on the filesystem?
http://porteus.org/forum/images/ranks/user.png
Do, or do not. There is no try.

User avatar
surio
Black ninja
Black ninja
Posts: 49
Joined: 17 Mar 2013, 08:14
Distribution: 2.1 RC2 64/32 KDE/Razor-Qt
Location: Jambudvipa
Contact:

Re: Navigating Multiboot GRUB2 menu entries successfully.

Post#4 by surio » 21 May 2013, 05:41

No, the above change did not work. I am posting this from a "Fresh" porteus session :(
EDIT:
No, that did not work. Unfortunately I got this error:

Code: Select all

rmdir /mnt//dev/sdb2 could not mount 
incorrect from= code. Press RETURN to try all possible devices
Output of my /proc/cmdline

Code: Select all

quiet BOOT_IMAGE=/boot/syslinux/vmlinuz rw from=/dev/disk/by-label/port32
END of EDIT
http://porteus.org/forum/images/ranks/user.png
Do, or do not. There is no try.

neko
DEV Team
DEV Team
Posts: 993
Joined: 09 Feb 2013, 09:55
Distribution: APorteus-FVWM-ja-x86_64.iso
Location: japan

Re: Navigating Multiboot GRUB2 menu entries successfully.

Post#5 by neko » 21 May 2013, 07:44

You wrote that
> Since it is accessing the same partition,
> but with something more permanent than disk letters that might change,

So, you specified the partition by "/dev/disk/by-label/port64" instead of "/dev/sdX7".

I think that Porteus has 4 notations for specifing a partition.
ex.
1)"/dev/sda1"
2)"/mnt/sda1"
3)"LABEL:LabelName"
4)"UUID:1234567890abcdef"


The menu for notation 3) is

=====================================
menuentry "Porteus 2.0 -- 64 bit" {
set root='hd0,msdos7' ### (hd1,7)
linux /boot/syslinux/vmlinuz rw from=LABEL:port64 changes=LABEL:port64/porteus/optional/port64sav.dat
initrd /boot/syslinux/initrd.xz
}

menuentry "Porteus 2.0 -- 32 bit" {
set root='hd0,msdos8' ### (hd1,8)
linux /boot/syslinux/vmlinuz rw from=LABEL:port32 changes=LABEL:port32/porteus/optional/port32sav.dat
initrd /boot/syslinux/initrd.xz
}
=====================================

User avatar
surio
Black ninja
Black ninja
Posts: 49
Joined: 17 Mar 2013, 08:14
Distribution: 2.1 RC2 64/32 KDE/Razor-Qt
Location: Jambudvipa
Contact:

Re: Navigating Multiboot GRUB2 menu entries successfully.

Post#6 by surio » 21 May 2013, 11:07

@neko,
That command variant worked. It pulled all my customisations from the dat file, and connected to the Net on logging in :) ! So, my earlier attempt was basically "foiled by bad syntax" :(

Thanks.

Now, there are some broader questions from me regarding multi-boot:
  1. What abour porteus.cfg ? How do I include the dat file in the changes= param (Snippet included above).
  2. As a next step, if I want the Porteus boot menu to come up when I select the "Porteus" option from the main boot menu, what is the command to invoke? Any ideas?
  3. Since I have moved to an ext4 partition now from the FAT32 USB, I want to eliminate the .dat and start storing changes locally. How does one do that?



On a semi-serious note: Coming next to the forums after this show,
multibooting porteus along with other distros using syslinux !
:D

@Ahau,
Want me to collate all of these and contribute to your tutorial on multiboot, after I complete them ? ;) :)
http://porteus.org/forum/images/ranks/user.png
Do, or do not. There is no try.

hypomania
Samurai
Samurai
Posts: 118
Joined: 10 Mar 2011, 10:50
Distribution: Windows phone
Location: Saudi Arabia

Re: Navigating Multiboot GRUB2 menu entries successfully.

Post#7 by hypomania » 21 May 2013, 18:13

I do not use Grub , but try to use Lilo ,
put 32bit in folder 32bit, and 64bit in folder 64bit, then type these option in 'porteus.cfg'

Code: Select all

LABEL 32bit
MENU LABEL Graphics mode (32bit)
KERNEL vmlinuz
APPEND initrd=initrd.xz from=/32bit changes=/dev/sdX7/porteus/optional/port32sav.dat
TEXT HELP
    Run Porteus in 32bit.
    Try to autoconfigure graphics
    card and use the maximum
    allowed resolution
ENDTEXT
 =======================
LABEL 64bit
MENU LABEL Graphics mode (64bit)
KERNEL vmlinuz
APPEND initrd=initrd.xz from=/64bit changes=/dev/sdX8/porteus/optional/port64sav.dat
TEXT HELP
    Run Porteus in 64bit.
    Try to autoconfigure graphics
    card and use the maximum
    allowed resolution
ENDTEXT




User avatar
surio
Black ninja
Black ninja
Posts: 49
Joined: 17 Mar 2013, 08:14
Distribution: 2.1 RC2 64/32 KDE/Razor-Qt
Location: Jambudvipa
Contact:

Re: Navigating Multiboot GRUB2 menu entries successfully.

Post#8 by surio » 21 May 2013, 18:50

@arabic_world,

Thanks for adding your thoughts. But,
  1. I already have hardcoded device letters in my original cfg (you can see the snippet above), and I want to move away from them. Your solution also uses hard coded letters like mine.
  2. I want grub to take me to the menu (independently).
  3. Also, I do not want a combined 32 + 64 bit menu, although it can be a different fun :)
  4. Lastly I want to get rid of the container file (if possible), now that I have moved from a FAT32 to a ext34 partition.
I hope some others also have some ideas around these points :)

But, thank you for adding your thoughts.
http://porteus.org/forum/images/ranks/user.png
Do, or do not. There is no try.

User avatar
fanthom
Site Admin
Site Admin
Posts: 4625
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

Re: Navigating Multiboot GRUB2 menu entries successfully.

Post#9 by fanthom » 22 May 2013, 19:26

will reply to the questions which i know the answer:
1. I already have hardcoded device letters in my original cfg (you can see the snippet above), and I want to move away from them.
use LABEL or UUID as described by neko, check /boot/docs/cheatcodes.txt if need more info.

sample before conversion:
from=/mnt/sda4/port32

after conversion:
from=UUID:ac8d44b2-3518-4bab-b56c-d98d98816f1d/port32
(/mnt/sda4 gets replaced by unique partition UUID)
4. Lastly I want to get rid of the container file (if possible), now that I have moved from a FAT32 to a ext34 partition.
create a directory named 'changes' under /porteus, then run:

Code: Select all

mloop /path_to/save.dat && cp -af /mnt/loop/. /mnt/sda3/porteus/changes/.
now you can boot with standard 'changes=/porteus' cheatcode.
Please add [Solved] to your thread title if the solution was found.

User avatar
surio
Black ninja
Black ninja
Posts: 49
Joined: 17 Mar 2013, 08:14
Distribution: 2.1 RC2 64/32 KDE/Razor-Qt
Location: Jambudvipa
Contact:

Re: Navigating Multiboot GRUB2 menu entries successfully.

Post#10 by surio » 23 May 2013, 06:28

Hi fanthom,
Thanks for taking some time and replying.

I have this other question, for which I am sure you will have some insight.

Code: Select all

menuentry "Porteus 2.0 -- 64 bit"   {
set root='hd0,msdos7' ### (hd1,7)
linux /boot/syslinux/vmlinuz rw  from=/dev/disk/by-label/port64 ##changes=/savefile/port2-64b.dat
initrd /boot/syslinux/initrd.xz   
}
linux and initrd takes me directly to porteus session. Instead, if all I wanted was to access the Porteus/syslinux menu, and choose what to do from there..... In other words, from the GRUB2 bootloader menu, I want to load the syslinux/porteus.cfg menu items, and chose my next course of action.

.............. how to go about it ?


Thanks.
http://porteus.org/forum/images/ranks/user.png
Do, or do not. There is no try.

User avatar
fanthom
Site Admin
Site Admin
Posts: 4625
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

Re: Navigating Multiboot GRUB2 menu entries successfully.

Post#11 by fanthom » 23 May 2013, 07:35

i'm sorry but i have no experience with creating multiboot entries.

i'm sure ther are some tutorials on the net, maybe try here:
http://www.dedoimedo.com/computers/linu ... -boot.html
Please add [Solved] to your thread title if the solution was found.

neko
DEV Team
DEV Team
Posts: 993
Joined: 09 Feb 2013, 09:55
Distribution: APorteus-FVWM-ja-x86_64.iso
Location: japan

Re: Navigating Multiboot GRUB2 menu entries successfully.

Post#12 by neko » 24 May 2013, 01:40

An example of multi boot/ISOs for ext2/3/4 FS & GRUB2

1. USB is formated.
# blkid

Code: Select all

/dev/sdc1: LABEL="U32" UUID="dc948f7b-77a6-44cd-b270-8c851c0488e9" TYPE="ext4" 
/dev/sdc2: LABEL="U64" UUID="04296081-cac2-4326-be5c-efca24f088e8" TYPE="ext4" 

2. MBM is set on the MBR of the USB /dev/sdc.
3. GRUB2s are set on the PBRs of /dev/sdc1 & /dev/sdc2.
4. Porteus ISOs are set on /dev/sdc1 & /dev/sdc2.

# ls -R /mnt/sdc1

Code: Select all

/mnt/sdc1:
boot/  live/  lost+found/  porteus/

/mnt/sdc1/boot/grub:
Backgrounds/  grub.cfg  i386-pc/
fonts/        grubenv   locale/   porteus.cfg

/mnt/sdc1/live/porteus:
Porteus-v2.0-i486.iso  porteus.cfg
# ls -R /mnt/sdc2

Code: Select all

/mnt/sdc2:
boot/  live/  lost+found/  porteus/

/mnt/sdc2/boot:
grub/  grub2.txt

/mnt/sdc2/boot/grub:
Backgrounds/  grub.cfg  i386-pc/
fonts/        grubenv   locale/   porteus.cfg

/mnt/sdc2/live/porteus:
Porteus-v2.0-x86_64.iso  porteus.cfg
# cat /mnt/sdc1/boot/grub/porteus.cfg

Code: Select all

submenu "#==============< PORTEUS >===============#" {
menuentry "Graphics mode (Razor)" {
search --no-floppy --fs-uuid --set=root dc948f7b-77a6-44cd-b270-8c851c0488e9
set iso="/live/porteus/Porteus-v2.0-i486.iso"
loopback loop $iso
linux (loop)/boot/syslinux/vmlinuz  "changes=UUID:dc948f7b-77a6-44cd-b270-8c851c0488e9/porteus" \
 from=UUID:dc948f7b-77a6-44cd-b270-8c851c0488e9/live/porteus/Porteus-v2.0-i486.iso
initrd (loop)/boot/syslinux/initrd.xz
}
......
}
# cat /mnt/sdc2/boot/grub/porteus.cfg

Code: Select all

submenu "#==============< PORTEUS >===============#" {
menuentry "Graphics mode (KDE)" {
search --no-floppy --fs-uuid --set=root 04296081-cac2-4326-be5c-efca24f088e8
set iso="/live/porteus/Porteus-v2.0-x86_64.iso"
loopback loop $iso
linux (loop)/boot/syslinux/vmlinuz  "changes=UUID:04296081-cac2-4326-be5c-efca24f088e8/porteus" \
 from=UUID:04296081-cac2-4326-be5c-efca24f088e8/live/porteus/Porteus-v2.0-x86_64.iso
initrd (loop)/boot/syslinux/initrd.xz
}
......
}
# diff /mnt/sdc1/live/porteus/porteus.cfg /mnt/sdc1/boot/grub/porteus.cfg

Code: Select all

6c6
< linux (loop)/boot/syslinux/vmlinuz  "changes=/porteus" \
---
> linux (loop)/boot/syslinux/vmlinuz  "changes=UUID:dc948f7b-77a6-44cd-b270-8c851c0488e9/porteus" \
5. Tools/Commands are used.
(1) 'gparted' --> [1. USB is formated.]
(2) 'setlive' --> [2. MBM is set on the MBR of the USB.]
(3) 'setlive' --> [3. GRUB2s are set on the PBRs of /dev/sdc1 & /dev/sdc2.]
(4) 'setlive' --> [4. Porteus ISOs are set on /dev/sdc1 & /dev/sdc2.]
(5) 'mkdir' --> [4. Porteus ISOs are set on /dev/sdc1 & /dev/sdc2.]
(6) 'leafpad' --> [4. Porteus ISOs are set on /dev/sdc1 & /dev/sdc2.]

6. Tool 'setlive'
is included in en4.iso* (http://www.mediafire.com/?e60ddi77psfsn1o)
-> [application menu] -> [System Tools] -> [setlive]

Tool 'setlive' componentes are
@/porteus/modules/BASE-boot.xzm,
@/porteus/modules/BASE-boot_en.xzm, and
@/porteus/modules/BASE-inst.xzm
extracted from en4.iso

*refer
"32bit Porteus v2.0 + FVWM(Austrumi like) and minimized"
viewtopic.php?f=75&t=2000
Last edited by Hamza on 24 May 2013, 11:15, edited 1 time in total.
Reason: Added CODE Tags

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: Navigating Multiboot GRUB2 menu entries successfully.

Post#13 by Hamza » 24 May 2013, 11:13

Please use CODE Tag.
NjVFQzY2Rg==

neko
DEV Team
DEV Team
Posts: 993
Joined: 09 Feb 2013, 09:55
Distribution: APorteus-FVWM-ja-x86_64.iso
Location: japan

Re: Navigating Multiboot GRUB2 menu entries successfully.

Post#14 by neko » 25 May 2013, 03:16

Hamza, thank you for your kindness!!

I never used HTML expressions on this site.
Next time, I will try to use the HTML expression.

Post Reply