Jump to content











Photo
- - - - -

SharpBoot

xboot sharpboot zdimension iso usb multiboot syslinux grub4dos

  • Please log in to reply
83 replies to this topic

#76 Monsieur Z

Monsieur Z

    Member

  • Developer
  • 51 posts
  • Location:France
  • Interests:Computers, C# and spaghetti
  •  
    France

Posted 21 February 2017 - 03:03 PM

Yup, it's quite useful for starting Linux ISOs because you just have to make a loopback and load the kernel, and voilà it boots. The only problem is that to boot other ISOs, you still need to use Grub4DOS because Grub2 doesn't have a "map" command anymore (and drivemap doesn't do anything useful). By "other ISOs", I mean "any kind of ISO". For Linux ISOs, loopback and it boots. For Windows, loopback and ntldr /bootmgr. But then you need to know precisely what the ISO is.

Also, the current way of installing Grub2 is by directly writing to the disk MBR, using Winapi CreateFile, thus breaking the already nonexistent Linux support. I'm gonna try to fix that.



#77 Blackcrack

Blackcrack

    Frequent Member

  • Advanced user
  • 458 posts
  •  
    Germany

Posted 21 February 2017 - 03:31 PM

so maybe i have to fast vote.. so it is maybe grub4dos also well by side ..

 

example for grub2

---------------------------------

menuentry "Ubuntu Live 9.10 32bit" {
 loopback loop /boot/iso/ubuntu-9.10-desktop-i386.iso
 linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/boot/iso/ubuntu-9.10-desktop-i386.iso noeject noprompt --
 initrd (loop)/casper/initrd.lz
}
 
menuentry "Ubuntu Live 9.10 64bit" {
 loopback loop /boot/iso/ubuntu-9.10-desktop-amd64.iso
 linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/boot/iso/ubuntu-9.10-desktop-amd64.iso noeject noprompt --
 initrd (loop)/casper/initrd.lz

 

menuentry "tinycore" {
 loopback loop /boot/iso/tinycore_2.3.1.iso
 linux (loop)/boot/bzImage --
 initrd (loop)/boot/tinycore.gz
}

---------------------------------

 

and don't forget openmandriva, it's become every better :)

 

best regards

Blacky



#78 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 21 February 2017 - 04:41 PM

To boot directly from linux ISO files with grub2, you need to know the iso 'cheat code' - e.g. iso-scan/filename=xxxx

 

Also you need to specify the full linux line with all parameters.

 

This means that for each and every different ISO, you need to know what the iso cheat code is (which varies from distro to distro and some distros don't even support an iso cheat code!) and also you need to know what all the kernel parameters need to be (which varies from version to version and distro to distro).

 

Also, if you boot from an ISO, you usually get a full menu (e.g. live boot, install boot, memtest, boot with integrity check, safe boot, etc.) - if you use grub2, you either don't provide these or you have to 'know' what each menu requires.

 

How does sharpboot get around this issue (or do you intend to maintain sharpboot and keep updating it every time a new distro/version breaks it)?

 

Now for grub4dos, there is a generic way to boot from almost any linux iso on a USB drive by using the partnew command (as used by Easy2Boot)...



#79 Monsieur Z

Monsieur Z

    Member

  • Developer
  • 51 posts
  • Location:France
  • Interests:Computers, C# and spaghetti
  •  
    France

Posted 21 February 2017 - 05:34 PM

What I'm currently planning to do is to directly put that "cheat code" lines in the AppDB, so for most Linux distros SB will detect that and use it. Same for Windows ISOs, as it's either "ntldr /bootmgr" or "ntldr /xp/thing/i/dont/remember". For unknown distros, I plan to write some kind of script that will look what bootloader is used (Grub, Syslinux, etc) and automatically search for the grub.cfg file and then allow the user to choose what entry of the original LiveCD he wants to put in the menu. If nothing works, then it calls grub.exe and uses Grub4DOS CD-ROM emulation.



#80 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 21 February 2017 - 05:42 PM

Why not just use YUMI or Sardu or XBoot or Easy2Boot? Why re-invent the wheel?

 

The cfg files inside the ISOs are written to boot from a CD. They often have parameters for cd booting (not USB booting), they may specify the ISO volume label or the UUID of the ISO. All these things (and others) need changing too. You can't just use the existing kernel parameters.

 

If you only plan to support USB booting, just use grub4dos and the partnew method, that way you can boot virtually any linux ISO easily!

You can call grub4dos from grub2, so you can still use grub2 for other payloads if you wish.



#81 Monsieur Z

Monsieur Z

    Member

  • Developer
  • 51 posts
  • Location:France
  • Interests:Computers, C# and spaghetti
  •  
    France

Posted 21 February 2017 - 07:22 PM

First, a little reminder: SharpBoot was designed to replace XBoot, because it is buggy as hell, the UI quite sucks (I don't say SharpBoot's doesn't, but it's a bit more beautiful), sometimes it crashes while writing USB or ISO, etc. Next, it's designed to be more extensible and modular than YUMI (which almost only works well for booting Linux distros) and Sardu.

Next, I don't think we are talking about the same thing. Let's say I have an Ubuntu 16.04 ISO (/images/ubuntu.iso) and I want to boot it.

If I look into the ISO, I have the /boot/grub.cfg file which contains:

menuentry "Install Ubuntu" {
	set gfxpayload=keep
	linux	/casper/vmlinuz.efi  file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity quiet splash ---
	initrd	/casper/initrd.lz
}

Well I just have to take create a loopback, add (loop) in those two lines and add the iso-scan command and I have this:

menuentry "Ubuntu 16.04" {
	set isofile="/images/ubuntu.iso"
	loopback loop $isofile
	linux (loop)/casper/vmlinuz.efi iso-scan/filename=$isofile boot=casper file=/cdrom/preseed/ubuntu.seed only-ubiquity quiet splash --
	initrd (loop)/casper/initrd.lz
}

And it works.

The easiest way is just to write those two lines for each version directly in the AppDB so that when it detects version X of distro Y, it knows what to write. But here I didn't even need to know it was Ubuntu 16.04, I only took the line from the grub.cfg file, added iso-scan and (loop) and it works.

For Windows, you remove the linux and initrd lines and add "ntldr /bootmgr" and it works too.

Then, if nothing worked (if the ISO is neither Windows or Linux, or Linux with some weird bootloader) I simply have to do

menuentry "Nope" {
    set opt='find --set-root /images/thing.iso;map /images/thing.iso (0xff);map --hook;root (0xff);chainloader (0xff);boot'
    linux /boot/grub/grub.exe --config-file=$opt
}

And G4D CD-ROM emulation does the rest for me.

That way, I can boot absolutely any ISO file in the world, no matter if Grub is installed on an USB key or in an ISO file.



#82 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 21 February 2017 - 07:38 PM

but many ISOs do not use iso-scan/filename as the cheat code.

They are all different!

 

some linux isoboot cheat codes
Here is a list of the many different cheat codes used by different versions of linux (where %ISOSCAN% is the path of the ISO file and %UUID% is the UUID of the partition):

iso-scan/filename=%ISOSCAN%
iso_filename=%ISOSCAN%
isofrom_system=%ISOSCAN%
isoboot=%ISOSCAN%
iso-scan/filename=%ISOSCAN%
isofrom_device=/dev/disk/by-uuid/%UUID%
isofrom=%UUID%:%ISOSCAN%
bootfromiso=%ISOSCAN%
findiso=%ISOSCAN%   (may also need bootid=<volname>  boot=live and live-media-path=/xxx/yyy)
fromiso=%ISOSCAN%
from=%ISOSCAN%
isoloop=%ISOSCAN%
img_loop=%ISOSCAN%

 

See http://rmprepusb.blo...o-boot-iso.html

 

Some distros simply do not support an iso cheat code, so you have to extract the files from the ISO and place them in non-standard folders - then you need to specify which folder they are in with more distro-specific cheat codes. That is why XBOOT and YUMI etc need to know what type of distro you are giving it.

 

As for your 'Nope' entry - for most linux ISOs that just won't work if they need to load a squashfs file (which most do). That is why you need to specify an iso file cheat code - so linux can mount the ISO as loop and then get the squashfs file.

 

Before you do any more coding, I suggest you try a wide variety of linux distros (not Ubuntu based).

 

P.S.

Actually, Ubuntu-based ISOs can be generically booted by using the loopback.cfg file, see http://rmprepusb.blo...menu-using.html

 



#83 Blackcrack

Blackcrack

    Frequent Member

  • Advanced user
  • 458 posts
  •  
    Germany

Posted 21 February 2017 - 07:46 PM

xboot replace :thumbup:
and boot any iso like xboot :good:
Mauridia_19.gif
 
Vala_28.gif by the way, so, let test the iso and let find the right one,
where it's the problem, nope, it's a task ;) Mauridia_41.gif



#84 Monsieur Z

Monsieur Z

    Member

  • Developer
  • 51 posts
  • Location:France
  • Interests:Computers, C# and spaghetti
  •  
    France

Posted 21 February 2017 - 07:58 PM

@steve6375: That's why I said

 

 

The easiest way is just to write those two lines for each version directly in the AppDB so that when it detects version X of distro Y, it knows what to write.






Also tagged with one or more of these keywords: xboot, sharpboot, zdimension, iso, usb, multiboot, syslinux, grub4dos

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users