Booting a PC off of an ISO stored on my Pandoras SD card?


Nardella

Member
Joined
Mar 4, 2011
Messages
352
The Pandora is already something great to use as a tool for tech support. I was wondering, if it would be possible do this instead of carrying around several boot disks.


I see nothing that should stop this from being possible. We would need software to mount an ISO file and we would need an altered SD-Mass Storage app.


Another possibility might be to partition the SD card with (PC) bootable partitions and a altered SD mass storage app.


Could someone please look into getting this working?
 
Last edited by a moderator:
I once gave a usb stick multiple partitions with one being a linux boot and the other usable to Windows. Search for terms like "USB multiboot" or "liveusb" etc. Arch linux had some nice instructions for installing arch on a usb stick which may be good to look into.


Multiple partitions each with a different OS would probably be a challenge - each one would have to be informed of how it was set up.


Having one OS boot and then somehow boot into an ISO is not possible. Having an OS boot up and then boot into an ISO through a virtual machine might be.


There are some tools out there which can automate some of this sort of thing:


http://unetbootin.sourceforge.net/


But no, there's nothing that I know of that's quite like what you want.
 
What you're imagining is possible, mounting disc-images as virtual disc drives over USB. It might be possible to modify the USB-Storage script to do something like that, if that route isn't possible, you'd have to convince a developer to create something like this for you.


I can definitely see the merit of this, USB CD-Roms are quite compatible, and having individual images makes it very easy to boot several things from one source.
 
The Pandora OS is already capable to mount ISO, maybe an "<YOUR DIRECTORY HERE>-Mass Storage App" can be useful.


Anyway I used LinuxLive USB Creator many times, it take an ISO Linux distribution and make with it an USB distribution, maybe it can be installed in a SD card while the Pandora is in MassStorage mode... never tried it
 
Having one OS boot and then somehow boot into an ISO is not possible. Having an OS boot up and then boot into an ISO through a virtual machine might be.
You know that GRUB2 can directly boot from an ISO on an HDD? (even though it doesn't support ARM...)
 
Having one OS boot and then somehow boot into an ISO is not possible. Having an OS boot up and then boot into an ISO through a virtual machine might be.
You know that GRUB2 can directly boot from an ISO on an HDD? (even though it doesn't support ARM...)

No I didn't know that.


Last time I looked into it, it still wasn't ready for human use. =/


--


So the solution seems to be...


- Setting up the Pandora to be seen as a USB device.


- Booting another computer using the Pandora as a boot device.


- Having GRUB2 set up to boot from multiple ISOs


- Keep multiple ISOs on the Pandora.


Does this sound about right?
 
Last edited by a moderator:
Just 'thinking out loud' on this. Brain storming rules apply.


What if we were to...


Idea 1: Change the Mass Storage mode so that it can be applied to a declarable folder/file on the SD card instead of just to the SD card object. If the ISO file were mounted as a file/folder object - it could/should be able to point to that just as easily.


Idea 2: Put in a ghost SD card object mmcblk3? that points to a folder instead of a hardware SD slot. Put the contents that you want to be available to mass storage mode in there.


Idea 3: Create a bootable live OS USB stick device using the target OS's instructions/image. Copy the partition from the USB stick to partition 1 on an SD card. Put the card in mass storage mode and see if it works.


Just ideas - no time to test/research right now.
 
The Mass Storage mode makes use of the File Storage Gadget module. (g_file storage)


The script basically does the following:

  • Offers the mounted SD media as options.
  • unmounts the selected card
  • loads the gadget module with parameters that point it to the block device associated with that card


It then basically does the reverse when you click ok to end Mass Storage mode.


The module itself seems quite flexible:



Code:
op-inigo:~$ modinfo g_file_storage

filename:	   /lib/modules/3.2.17/kernel/drivers/usb/gadget/g_file_storage.ko

license:		Dual BSD/GPL

author:		 Alan Stern

description:	File-backed Storage Gadget

srcversion:	 CD93718C590E7B777F95E45

depends:		

intree:		 Y

vermagic:	   3.2.17 mod_unload modversions ARMv7 p2v8

parm:		   file:names of backing files or devices (array of charp)

parm:		   serial:USB serial number (charp)

parm:		   ro:true to force read-only (array of bool)

parm:		   nofua:true to ignore SCSI WRITE(10,12) FUA bit (array of bool)

parm:		   luns:number of LUNs (uint)

parm:		   removable:true to simulate removable media (bool)

parm:		   stall:false to prevent bulk stalls (bool)

parm:		   cdrom:true to emulate cdrom instead of disk (bool)



To test out Idea 1, I'd suggest try loading the driver with the following command:





Code:
sudo modprobe g_file_storage file=/path/to/filename.iso stall=0 cdrom=1



I don't know if this will actually work with iso files, I don't really know enough about them or how the gadget driver works. I'd test it myself but I don't have any iso files handy.



[edit] If this doesn't work or you get the parameters wrong the pandora is likely to lock up at some point in which case you would then need to force a reboot. [/edit]



Assuming your pandora hasn't locked up, you could then type this to unload the driver once you are done:



Code:
sudo modprobe -r g_file_storage



- Neelix
 
Last edited by a moderator:
Omfsm, I have just tried it and it works! I booted the arch linux install iso on my laptop :D



Code:
sudo modprobe g_file_storage file=/path/to/filename.iso stall=0 cdrom=1


This has incredible potential, I'll never ever need to create a boot thumbdrive again :eek: Isn't this pretty much what the isostick does?


The SD mass storage script gives some good hints about how to make it work, like unloading every g_* module beforehand.


Also I want to use the Pandora as a USB HID device but the g_hid module seems to be way more complicated. (Edit: As in: I want it to work but am not able to make it work ;D )
 
Last edited by a moderator:
Also I want to use the Pandora as a USB HID device but the g_hid module seems to be way more complicated. (Edit: As in: I want it to work but am not able to make it work ;D )
I'm sure you already know this, but just to be certain
 
Awesome, from now I'll always carry around an iso of System Rescue CD on the Pandora, this makes fixing PCs so much easier than lugging a CD drive around or preparing a dedicated thumbdrive everytime there is a new version out (which is often):


http://www.sysresccd.org
 
Last edited by a moderator:
I'm just posting here so I can use the search function of the forum to easily find this when I get my Pandora...


This feature would be very useful for me if I could get it working. Which I'll most likely need to come back and get some help with.


If I could get Pandora to boot up Hiren Boot CD and copies of Windows XP and 7... It would save me having to run back to mine to get the discs, as I do currently.
 
It's good news that someone finally tried this out and got it working! I'll have to start making little multi-launchers for this. I imagine if I squashFS a bunch of ISOs together they'll compress quite well (same OS, different versions).
 
Back
Top