Page 2 of 3

Re: Show or teach me about ISO booting

Posted: 12 Jan 2017, 23:13
by Ed_P
Jack wrote:UPDATE:
I rerun Grub2Win and edit Porueus 3.2.2 and redetect the ISO and now it boot but it said something about the Modules directory. Any idea
Make sure the bootparms values are all on one line.

Code: Select all

set bootparms='from='$isopath' volume=33 reboot=cold extramod=C:/porteus322/Modules'
The forum windows have a tendency of breaking code lines into two lines.
Jack wrote:UPDATE2:
How can I load the addon modules? I put them in the modules directory in C:/porteus322/modules.
And if you named your folder modules rather than Modules as you said before change the bootparms to match whatever name you actually named it.

Code: Select all

set bootparms='from='$isopath' volume=33 reboot=cold extramod=C:/porteus322/modules'
All on ONE line.

Remember while Windows treats C:\porteus322\Modules and c:\Porteus322\modules as the same name Linux does not.

Re: Show or teach me about ISO booting

Posted: 12 Jan 2017, 23:30
by Ed_P
A final tweak to the menu.

Download this icon and add it to the c:\grub2\themes\icons\ folder as icon_porteus.png.

Image

Then tweak the menu's title changing the menuentry --class icon_isoboot parameter to --class icon_porteus.

:)

Re: Show or teach me about ISO booting

Posted: 13 Jan 2017, 00:28
by Jack
Thanks for the icon a I just added it. I check modules and Modules was ok. Now I will test it.

UPDATE:
The problem is Porteus needs a cheatcode to make it work. I never use any cheatcode.

Re: Show or teach me about ISO booting

Posted: 13 Jan 2017, 03:12
by Ed_P
Jack wrote:UPDATE:
The problem is Porteus needs a cheatcode to make it work. I never use any cheatcode.
Really. And what cheatcode does it need? :)

Please post the grub.cfg code that you have for the Porteus menu, from menuentry thru savelast, together with a Windows Command Prompt output of these commands:

Code: Select all

dir c:\*.
dir c:\porteus322

Re: Show or teach me about ISO booting

Posted: 13 Jan 2017, 03:50
by Jack
Ed_P wrote:
Jack wrote:UPDATE:
The problem is Porteus needs a cheatcode to make it work. I never use any cheatcode.
Really. And what cheatcode does it need? :)
Porteus need to know where to find the addon modules are since they are C:/porteus322/Modules directory. I guest. It can't FireFox and all the other.
Please post the grub.cfg code that you have for the Porteus menu, from menuentry thru savelast, together with a Windows Command Prompt output of these commands:

Code: Select all

dir c:\*.
dir c:\porteus322
Here is the grub.cfg file. This is the whole thing.

Code: Select all

#
#       Created at 20:33:09  on  Thursday   January 12, 2017
#
# Generated by Grub2Win      Version 8.1.5 from directory C:\grub2
#              Stamp  2017 - 0109 - 095903
#
# The grub menu type is - Scroll bar and progress circle
#
#
#  Grub2Win generated 4 menu entries.
#
#  The Grub default boot OS is menu entry 0  -  Windows Boot Manager
#  The Grub default timeout is 10 seconds
#  The Grub locale language is English   The locale code is - en
#


set default=0
set grub2win_chosen="0  -  Windows Boot Manager"
set timeout=10
set lang=en
set grub2win_version=8.1.5
set pager=1
set icondir=$prefix/themes/icons
set locale_dir=$prefix/locale
set grub2win_procbits=32
if [ cpuid -l ] ; then set grub2win_procbits=64 ; fi
set grub2win_bootmode=BIOS
if [ $grub_platform = efi ] ; then set grub2win_bootmode=EFI ; fi 
set grub2win_custmode=BIOS
set grub2win_lastbooted=no
set gfxmode=1024x768,800x600,auto
set gfxpayload=text
set grub2win_parm=ascrollcir

set theme=$prefix/themes/grub2win/theme.ascrollcir

if [ $grub2win_bootmode = EFI ]; then
   set theme=$theme.efi.txt
else
   set theme=$theme.bios.txt
fi
insmod png
insmod all_video
loadfont $prefix/fonts/unicode.pf2
insmod gfxterm
terminal_output gfxterm
insmod gfxmenu


# start-grub2win-auto-menu-section  ***************************************************
#

#
#  Menu Entry 0       Windows Boot Manager
#
#  ** Grub will boot this OS by default **
#
menuentry   'Windows Boot Manager'       --class windows   --class icon-windows  {
set reviewpause=5
if [ $grub2win_bootmode = EFI ]; then
     set efibootmgr=/efi/Microsoft/Boot/bootmgfw.efi
     getbootpartition  file  $efibootmgr
     if [ $reviewpause -gt 0 ] ; then
	 echo Grub is now booting   Windows EFI Boot Manager
         echo Boot disk address is  $root
         echo The boot mode is      Windows EFI
         sleep -v -i $reviewpause
     fi
     chainloader $efibootmgr
else
     if [ -f (hd0,1)/ntldr ]; then
         set bootcontrol="XP boot.ini"
         set bootmodule=ntldr
	 set root=(hd0,1)	
     else
         set biosbootmgr=/bootmgr
         getbootpartition  file  $biosbootmgr
         set bootcontrol=BCD
         set bootmodule=bootmgr
     fi
     if [ $reviewpause -gt 0 ] ; then
          echo
          echo The Windows BIOS boot manager is at address ($root)
          echo
          echo The Windows boot control type is $bootcontrol
          echo
          sleep -v -i $reviewpause
     fi
     ntldr /$bootmodule
fi
savelast 0 'Windows Boot Manager'
}

#
#  Menu Entry 1       Display boot information
#
menuentry   'Display boot information'       --class bootinfo   --class icon-bootinfo  {
     export gfxmode
     export grub2part
     export grub2win_chosen 
     export grub2win_lastbooted
     export grub2win_version
     export grub2win_procbits
     export grub2win_bootmode
     export grub2win_efiboot
     export grub2win_efilevel
     configfile $prefix/winsource/bootinfo.cfg
}

#
#  Menu Entry 2       Porteus 3.2.2
#
menuentry   'Porteus 3.2.2'       --class isoboot   --class icon_porteus   --class custom_002  {
#
set reviewpause=20
# start-custom-code
#
#            This is sample code for booting from an iso file
#            via the Grub2Win g2wisoboot function
#
#            See the Grub2Win help file advanced topics section for more information
#
    clear
    set isopath=/porteus322/Porteus-MATE-v3.2.2-x86_64.iso
    set kernelpath='/boot/syslinux/vmlinuz'                 # Example '/vmlinuz'
    set initrdpath='/boot/syslinux/initrd.xz'                 # Example '/initrd.img'
    set bootparms='from='$isopath' volume=33 reboot=cold extramod=C:/porteus322/Modules'          # Example 'boot=/ iso-scan/filename='$isopath' noprompt noeject ---'
#
    g2wisoboot                                          # Run the g2wisoboot function
#
# end-custom-code
savelast 2 'Porteus 3.2.2'
}

#
#  Menu Entry 3       Porteus 32rc5
#
menuentry   'Porteus 32rc5'       --class isoboot   --class icon_porteus   --class custom_003  {
#
set reviewpause=20
# start-custom-code
#
#            This is sample code for booting from an iso file
#            via the Grub2Win g2wisoboot function
#
#            See the Grub2Win help file advanced topics section for more information
#
    clear
    set isopath='/** your iso file path **'             # Example '/my.linux.iso'
    set kernelpath='/boot/syslinux/vmlinuz'                 # Example '/vmlinuz'
    set initrdpath='/boot/syslinux/initrd.xz'                 # Example '/initrd.img'
    set bootparms='from='$isopath' volume=33 reboot=cold extramod=C:/porteus32rc5/Modules'          # Example 'boot=/ iso-scan/filename='$isopath' noprompt noeject ---'
#
    g2wisoboot                                          # Run the g2wisoboot function
#   
# end-custom-code
savelast 3 'Porteus 32rc5'
}

#
# end-grub2win-auto-menu-section     ***************************************************

# start-grub2win-savelast-section   ****************************************************
#
function savelast {
     set      default=$1
     save_env default
     if [ $grub2win_bootlast = yes ] ; then
          set grub2win_chosen="$default  -   $2"
     fi
     save_env grub2win_chosen
}
#
# end-grub2win-savelast-section     ****************************************************

# start-grub2win-getbootpartition-section  *********************************************
#
# The getbootpartition function searches for a partition
# If the first paramater is "label" it searches for a partition with the label name
# passed in the second parameter. Otherwise it searches for a file with the filename
# passed in the second parameter. 
# It then sets the root address to prepare for boot. 
# 
#
function getbootpartition {
     set pager=0
     set searchtype=$1
     set partsearch=$2
     if [ $searchtype = label ] ; then
          search.fs_label $partsearch rootaddress
     else 
          search.file     $partsearch rootaddress
     fi
     if [ $? = 0 ] ; then
          set root=($rootaddress)
          echo
          echo -n Grub is setting root to $root
          echo "  The boot partion $searchtype is $partsearch"
          echo
     else 
          echo
          echo
          echo *** Grub did not find a boot partition with $searchtype $partsearch
          echo *** Press the ESC key to continue
          echo
          sleep -v -i 120
          configfile $prefix/grub.cfg
     fi
}
#
# end-grub2win-getbootpartition-section     ********************************************

# start-grub2win-isoboot-section   ****************************************************
#
function g2wisoboot {
    echo
    echo "Starting g2wisoboot"
    echo
    set  varcheck=ok
    if [ -z $isopath ];    then echo "** Variable isopath    is not set **"; set varcheck=failed; else echo "Variable isopath    is set to '$isopath'";    fi
    echo
    if [ -z $kernelpath ]; then echo "** Variable kernelpath is not set **"; set varcheck=failed; else echo "Variable kernelpath is set to '$kernelpath'"; fi
    echo
    if [ -z $initrdpath ]; then echo "** Variable initrdpath is not set **"; set varcheck=failed; else echo "Variable initrdpath is set to '$initrdpath'"; fi
    echo
    if [ -z $bootparms ];  then echo "** Variable bootparms  is not set **"; set varcheck=failed; else echo "Variable bootparms  is set to '$bootparms'";  fi
    echo
    echo
    if [ $varcheck = failed ] ; then
          echo
          echo "*** The diagnostic checks failed. Aborting the g2wisoboot function"
          echo "*** Press the ESC key to continue"
          echo
          sleep -v -i 120
          configfile $prefix/grub.cfg
    fi
    getbootpartition file $isopath
    echo
    echo "Linux will boot from " ($root)$isopath
    echo
    loopback loop ($root)$isopath
    linux  (loop)$kernelpath $bootparms
    initrd (loop)$initrdpath
    if [ ! -z $reviewpause ] ; then sleep -i -v $reviewpause; fi
    echo
    echo "Now booting Linux"
}
#
# end-grub2win-isoboot-section     ****************************************************

# start-grub2win-user-section   ********************************************************
#
#
# end-grub2win-user-section     ********************************************************
I also added v32rc5 and look at it to too. Look at it all to fine anything wrong.

I try to do this but MS-Dos would not let me copy and paste it.

Code: Select all

dir c:\*.
dir c:\porteus322
Sorry if I a pain.

Re: Show or teach me about ISO booting

Posted: 13 Jan 2017, 05:20
by Ed_P
Jack wrote:The problem is Porteus needs a cheatcode to make it work. I never use any cheatcode.
Check this link: http://www.porteus.org/component/conten ... -them.html and scroll down it a page or two. Do you see anything that looks familiar? 8)
Porteus need to know where to find the addon modules are since they are C:/porteus322/Modules directory. I guest. It can't FireFox and all the other.
There are only two possibilities: 1. The name of the location for the modules is spelled wrong or 2. the modules are not in the folder.
Here is the grub.cfg file. This is the whole thing.
The Porteus 3.2.2 menu looks fine.
I also added v32rc5 and look at it to too. Look at it all to fine anything wrong.
The Porteus 32rc5 menu looks like you didn't follow the steps you used to create the Porteus 3.2.2 menu.
I try to do this but MS-Dos would not let me copy and paste it.

Code: Select all

dir c:\*.
dir c:\porteus322
Oh it will let you but in a somewhat less than obvious way.

Once you have executed the dir commands RIGHT click on the Command Prompt's color bar at the top of the window. It will display a menu. In the menu click on Edit then click on Select All. Move your pointer to the highlighted text and press Enter. Come to your posting here, click on Code and then place your pointer between the code tags, RIGHT click and click on Paste.

See how straight forward that was? :%)

BTW To the two dir commands add a third.

dir c:\porteus322\Modules

Re: Show or teach me about ISO booting

Posted: 13 Jan 2017, 14:43
by Jack
I just learn something today. Here is that and I check the rest to day.

Code: Select all

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\Jack>dir c:\
 Volume in drive C has no label.
 Volume Serial Number is D649-9FA7

 Directory of c:\

12/30/2016  07:49 PM    <DIR>          .Trash-0
01/12/2017  08:33 PM    <DIR>          grub2
07/13/2009  10:20 PM    <DIR>          PerfLogs
01/12/2017  07:06 PM    <DIR>          porteus322
01/12/2017  08:05 PM    <DIR>          porteus32rc5
11/20/2016  09:50 PM    <DIR>          Program Files
11/20/2016  07:53 PM    <DIR>          Program Files (x86)
06/09/2016  04:35 AM               893 Project.log
11/18/2016  01:27 PM    <DIR>          Users
10/24/2016  07:19 PM    <DIR>          Windows
               1 File(s)            893 bytes
               9 Dir(s)  150,153,601,024 bytes free

C:\Users\Jack>dir c:\porteus322
 Volume in drive C has no label.
 Volume Serial Number is D649-9FA7

 Directory of c:\porteus322

01/12/2017  07:06 PM    <DIR>          .
01/12/2017  07:06 PM    <DIR>          ..
01/05/2017  02:09 PM             8,601 bookmarks-2017-01-05.json
01/12/2017  12:51 PM    <DIR>          Changes
01/12/2017  12:36 PM    <DIR>          Modules
01/12/2017  12:51 PM    <DIR>          Optional
12/23/2016  05:47 PM       255,627,264 Porteus-MATE-v3.2.2-x86_64.iso
01/12/2017  12:37 PM    <DIR>          Rootcopy
               2 File(s)    255,635,865 bytes
               6 Dir(s)  150,158,893,056 bytes free

C:\Users\Jack>

Re: Show or teach me about ISO booting

Posted: 13 Jan 2017, 15:21
by Ed_P
Jack wrote:I just learn something today.
And you learned it on Friday the 13th!! :Yahoo!:

:D

And these

Code: Select all

 Directory of c:\

01/12/2017  07:06 PM    <DIR>          porteus322
01/12/2017  08:05 PM    <DIR>          porteus32rc5

 Directory of c:\porteus322

01/12/2017  12:36 PM    <DIR>          Modules

12/23/2016  05:47 PM       255,627,264 Porteus-MATE-v3.2.2-x86_64.iso
confirm the names and locations of the 2 folders used in your Porteus cheatcode in the menu

Code: Select all

extramod=C:/porteus322/Modules

so we need to see the results of the 3rd dir

Code: Select all

dir c:\porteus322\Modules

at this point.

Re: Show or teach me about ISO booting

Posted: 13 Jan 2017, 18:03
by Blaze

Re: Show or teach me about ISO booting

Posted: 13 Jan 2017, 18:46
by Jack
If I need to do any changes in the grub.cfg can I just use a text editor from now on?

So this needs to be in Porteus cheatcode, so can you post your so I can see?
confirm the names and locations of the 2 folders used in your Porteus cheatcode in the menu

Code: Select all

extramod=C:/porteus322/Modules
I fixed this to with notepad.

Code: Select all

# start-custom-code
#
#            This is sample code for booting from an iso file
#            via the Grub2Win g2wisoboot function
#
#            See the Grub2Win help file advanced topics section for more information
#
    clear
    set isopath=/porteus322/Porteus-MATE-v3.2.2-x86_64.iso
    set kernelpath='/boot/syslinux/vmlinuz'                 # Example '/vmlinuz'
    set initrdpath='/boot/syslinux/initrd.xz'                 # Example '/initrd.img'
    set bootparms='from='$isopath' volume=33 reboot=cold extramod=C:/porteus322/Modules'          # Example 'boot=/ iso-scan/filename='$isopath' noprompt noeject ---'
#
    g2wisoboot                                          # Run the g2wisoboot function
#
# end-custom-code
savelast 2 'Porteus 3.2.2'
}

#
#  Menu Entry 3       Porteus 32rc5
#
menuentry   'Porteus 32rc5'       --class isoboot   --class icon_porteus   --class custom_003  {
#
set reviewpause=20
# start-custom-code
#
#            This is sample code for booting from an iso file
#            via the Grub2Win g2wisoboot function
#
#            See the Grub2Win help file advanced topics section for more information
#
    clear
    set isopath=/porteus32rc5/Porteus-MATE-v3.2rc5-x86_64.iso             # Example '/my.linux.iso'
    set kernelpath='/boot/syslinux/vmlinuz'                 # Example '/vmlinuz'
    set initrdpath='/boot/syslinux/initrd.xz'                 # Example '/initrd.img'
    set bootparms='from='$isopath' volume=33 reboot=cold extramod=C:/porteus32rc5/Modules'          # Example 'boot=/ iso-scan/filename='$isopath' noprompt noeject ---'
#
    g2wisoboot                                          # Run the g2wisoboot function
#   
# end-custom-code
savelast 3 'Porteus 32rc5'
Here is the info in Modules directory. That won't load at boot up.

Code: Select all

C:\Users\Jack>dir c:\porteus322\Modules
 Volume in drive C has no label.
 Volume Serial Number is D649-9FA7

 Directory of c:\porteus322\Modules

01/12/2017  12:36 PM    <DIR>          .
01/12/2017  12:36 PM    <DIR>          ..
12/22/2016  09:00 PM        51,396,608 firefox-50.1.0-x86_64-1.xzm
01/02/2017  02:39 PM         8,036,352 flashplayer-plugin-24.0.0.186-x86_64-2alien.xzm
07/27/2016  08:12 PM         9,789,440 guvcview-2.0.4-x86_64-1_bundle.xzm
12/22/2016  09:05 PM       180,498,432 libreoffice-5.2.3.3-x86_64.xzm
12/22/2016  09:05 PM        12,890,112 man-files-3.2.2-noarch-1.xzm
               5 File(s)    262,610,944 bytes
               2 Dir(s)  149,237,407,744 bytes free

C:\Users\Jack>

Re: Show or teach me about ISO booting

Posted: 13 Jan 2017, 21:55
by Ed_P
Change your bootparms cheatcodes from

Code: Select all

set bootparms='from='$isopath' volume=33 reboot=cold extramod=C:/porteus322/Modules'
to

Code: Select all

set bootparms='from='$isopath' volume=33 reboot=cold extramod=/porteus322/Modules'
Sorry. :oops:

Re: Show or teach me about ISO booting

Posted: 13 Jan 2017, 22:36
by Jack
Thank you Ed_P and Blaze for all your help.

@Ed_P

That did the trick and up and running Porteus right now from a ISO file. Now I need to set it up the way I want it then use Porteus Save Session and put it in C:/porteus322/Modules directory.

I'm going to do the same for v32rc5 because I like youtube downloader and I can't use it in v3.2.2 it freeze up.

I been wanting to do this for a long time and now I did it on Friday the 13th.

Re: Show or teach me about ISO booting

Posted: 13 Jan 2017, 23:18
by Ed_P
Jack wrote:That did the trick
Pheww... :)
up and running Porteus right now from a ISO file. Now I need to set it up the way I want it then use Porteus Save Session and put it in C:/porteus322/Modules directory.
Actually I think you want to put it in the

Code: Select all

 Directory of c:\porteus322

01/12/2017  12:51 PM    <DIR>          Changes
directory. And your bootparms cheatcodes will change to

Code: Select all

set bootparms='from='$isopath' volume=33 reboot=cold extramod=/porteus322/Modules  changes=/porteus322/Changes'
this is all on ONE line

or

Code: Select all

set bootparms='from='$isopath' volume=33 reboot=cold extramod=/porteus322/Modules  changes=EXIT:/porteus322/Changes'
This what I use and this is also all on ONE line.
I been wanting to do this for a long time and now I did it on Friday the 13th.
:good:

Re: Show or teach me about ISO booting

Posted: 13 Jan 2017, 23:21
by Bogomips
So now Ed_P the time has come the walrus said ... to make a nice tutorial out of all this! :good:

Re: Show or teach me about ISO booting

Posted: 14 Jan 2017, 00:17
by Jack
@ Ed_P

I will do this that will help a lot.

Code: Select all

    set bootparms='from='$isopath' volume=33 reboot=cold extramod=/porteus322/Modules  changes=EXIT:/porteus322/Changes'
@Bogomips

That a good idea but can it be made a tutorial?
to make a nice tutorial out of all this!