yashsingh1/xdaforums huggingface dataset:
[Sprint HTC EVO 4G LTE] closeone:
Thanks! I'm not sure about the ability to boot. I did try a bootable ISO, which unfortunately was unable to boot. I may have to look closer into this. Also, the size restriction might hold you back. I wouldn't load a huge ISO into the /system partition, but there is one of two different things might be able to be done. One would be to possibly symlink the ISO and have it load from another place, the second would be to modify where the software would load the ISO from. Humm...

Thanks, drewski83!

The only way, I believe, that the system will mount the phone as MTP (or is it PTP in this implementation?) is by selecting the Media sync option when connecting. The two advantages I see to mounting it this way are that the SD Card doesn't have to be dismounted while connected, and the device shows both the "Internal SD" and the actual SD Card as separate drives that you can copy files to and from.

I haven't installed HTC Sync either. I'm referring to most any Sense-based ROMs for this device. If the phone doesn't give you a choice, it's possible that it's still hidden in the notification menu. If not, you can change that by going into Settings > Connect to PC, and tap Ask me, or you can change the default connection type from within that menu as well.

~co~
[Sprint HTC EVO 4G LTE] Cuppeerr:
Closeone, you are awesome.
[Sprint HTC EVO 4G LTE] closeone:
Thank you -Cupper-. :) You are awesome, good sir!

~co~
[Sprint HTC EVO 4G LTE] regaw_leinad:
bump for awesomeness
[Sprint HTC EVO 4G LTE] bard77:
Quick question...if you flash this mod, do you have to reflash it every time a new ROM is flashed? Thanks in advance
[Sprint HTC EVO 4G LTE] closeone:
Hi bard77. Yes. When you flash a new ROM, system data will (should) typically be wiped. This is written there. It's simple to flash however. ;)

Thanks,

~co~
[Sprint HTC EVO 4G LTE] P.Mobile:
good stuff!! thanks :)
[Sprint HTC EVO 4G LTE] Androidious:
Just freakin' sweetness man. Pure epic find!
[Sprint HTC EVO 4G LTE] regaw_leinad:
Agreed, nice work closeone. This is amazing.
[Sprint HTC EVO 4G LTE] closeone:
Thanks guys. ;)

~co~
[Sprint HTC EVO 4G LTE] jamiphar:
Closeone, good job on finding this!

I do computer repair, and I currently have an external 2.5" drive set up to be bootable to a Grub bootloader. From Grub, I can boot any ISO or boot partition on the drive. With the Sync Manager emulating a CD-ROM drive instead of showing up as a disk drive, it would be a huge advantage for booting, letting any computer (especially older ones) recognize it.

If you could find a way to keep the phone in Sync Manager even when it's not connected, the computer's BIOS should be able to see it as a CD-ROM and boot from it. As it is now, my BIOS won't see it because it's not treating the phone like a USB device. It would be excellent if you could map to an ISO on a different partition. Another option is to have the loaded ISO simply bring up a bootloader to boot from any ISO/partition you want, though this takes away the advantage of the selected ISOs being recognized as a CD-ROM drive. Grub can have problems when you boot from an ISO of a live CD and the booted OS needs to access the disc. The OS can't find a CD-ROM, so it doesn't work.

If you could successfully map this to an ISO on the SD card, you could even build a little app to let you choose which ISO you want to be selected. You could simply have it remap to the different folders with the respective PCTOOL.ISO files. For example, if you select "Acronis" from the app menu, it would direct it to sdcard/acronis/PCTOOL.ISO, and if you select "Ubuntu," it would map to /sdcard/Ubuntu/PCTOOL.ISO.

I hope this is all clear enough. Once I read this, I got pretty excited about all the possibilities! ;)
[Sprint HTC EVO 4G LTE] webdude12:
This is going to be awesome if things can be modified to make this a bootloader. I would even donate for this functionality if someone wanted to tackle it.

Having the ability to have things like UBCD, Win XP PE (With Antivirus / MalwareBytes), etc as options running straight from my phone would be a computer guy's dream.
[Sprint HTC EVO 4G LTE] closeone:
Apologies for my late response. I've been... tied up for the last couple weeks.

Thanks. ;) Precisely. I thought that it would be a nice tool for technicians. I work in that field myself. There are a few problems that I noticed with how the PCTOOL.ISO is accessed. From my understanding, I believe that the problem with reading it from the SD Card (Internal Memory or External) is that it doesn't expect that it's going to be reading from a FAT32 formatted partition. It gets a bit more difficult with the fact that a huge ISO really probably shouldn't be placed in your system partition. Making it bootable is messy (I mean, it was intended for a completely different use in the first place though :)). At the very least, an ISO with your favorite portable applications can be put in there and loaded up when needed. That alone is very valuable because it acts as read-only media, the phone can't be infected with anything nasty from the computer you plug it into.

Thanks again!

~co~
[Sprint HTC EVO 4G LTE] webdude12:
Why could we not partition a section of the SD card as EXT3 or whatever PCTOOL.ISO wants to see, then create a symalink as mentioned? Nothing says the entire SD card has to be partitioned FAT32. I actually had part of mine partitioned as EXT2 for the longest time, because the card wasnt always in my phone. :)
[Sprint HTC EVO 4G LTE] closeone:
True. True. I didn't think about that. The first thing that's got to be done though is making the phone mount the ISO, or at least not wait for a request from the computer to go ahead and make the phone pop up with the menu of actions, and in turn say to the computer "Hi there, I see that you're booting. I'm a USB CD-ROM drive. Oh yeah, and you can boot from me now." Easier said than done, at least for myself.

~co~
[Sprint HTC EVO 4G LTE] webdude12:
So basically we need to find the code that is calling PCTOOL.iso and see what and how its doing... Makes me wonder if this is in the ROM, or in the firmware of the phone.

Wonder if people running Roms like CM, are seeing this same result, or is it restricted to Sense based roms only. That should tell us maybe what direction to start looking in.
[Sprint HTC EVO 4G LTE] kevinrocksman:
Ive been digging through my phone trying to find this with no avail... but i wont give up
[Sprint HTC EVO 4G LTE] closeone:
Sorry for the late response. Thanks Kevin. The best I was able to find was a reference to PCTOOL.ISO in /system/bin/vold. I remember trying to execute it, and that caused a "Preparing SD Card" Toast to popup on the screen. I'm assuming it's a custom version of the vold binary.

I found that the when the ISO was mounted, it appeared here:

/sys/devices/platform/msm_hsusb/gadget/lun1/file

By doing a:

echo "/system/etc/PCTOOL.ISO" > /sys/devices/platform/msm_hsusb/gadget/lun1/file

the drive would mount on my computer. Of course, that is never reflected in the USB connection type settings on the device, and the file resets when the cable is pulled, but that's something.

I can't claim that as original research. I found this thread while surfing around.

~co~
[Sprint HTC EVO 4G LTE] kevinrocksman:
what did u use to find the "reference"?
[Sprint HTC EVO 4G LTE] regaw_leinad:
My best guess is http://www.google.com, but that's just a guess ;)
[Sprint HTC EVO 4G LTE] kevinrocksman:
ok I no NOTHING about linux but by reading online apparently that IS the file that tells the phone what file to mount. I don't know if you have to decompile that file and change the code and recompile or just change it and save it. It gives me a lot of nul's lol.

make sure to do a nandroid though...this file deals with your phone knowing where its "memory" is (storage)
[Sprint HTC EVO 4G LTE] closeone:
Long story about the search tools I use,

but they aren't always Google. ;) Using a piece of software called Swiss File Knife (or sfk), I can manipulate, search through, grab strings from files (much like the grep command), and a lot more from a large number of files very, very quickly. That includes letting me search and pull strings out of binary files. :) Ah, how much I love command line tools...

~co~
[Sprint HTC EVO 4G LTE] il Duce:
I just finally realized what this does (after having tested it) and all I can say >>

THIS IS AMAZING!

I added it to superLTE and will credit you, man

FANTASTIC WORK!
[Sprint HTC EVO 4G LTE] closeone:
That's awesome! I'm always happy to hear things like that. Thank you! :)

~co~
[Sprint HTC EVO 4G LTE] il Duce:
****ing brillaint!
[Sprint HTC EVO 4G LTE] Gumby63:
Lookie here..:good: http://www.xda-developers.com/android/replace-virtual-cd-on-the-htc-evo-4g-lte/
[Sprint HTC EVO 4G LTE] camezaga:
Wow, I have an HTC Rezound and had noticed similar behavior. Never gave it much thought though. After reading the news thread, I search through my phone and found a file called CDROM.ISO in /system/etc. I am guessing the same rules apply with this file. Many thanks for the tip. :) Gives me something else to tinker with.
[Sprint HTC EVO 4G LTE] il Duce:
Much deserved, also, moved this to the ORIGINAL dev section.
[Sprint HTC EVO 4G LTE] closeone:
Woah. Wow. Thanks for pointing me to the news article Gumby63!

Feel free to dump the one from here onto your phone! It's not phone specific, so you can always try this one out to start with. ;)

Thank you!

~co~

Edit: If PoorCollegeGuy happens to stop upon this thread, I just want to say thank you for the write-up!
[Sprint HTC EVO 4G LTE] domenukk:
Cool feature. Btw by symlinking you could possibly even put a whole game on your sd card and mount it from phone using this behaviour. :D
[Sprint HTC EVO 4G LTE] closeone:
I forgot to post this earlier, or rather, I should have posted it sooner.

Here's my modified PCSC.apk with changed icon and text for the Sync Manager choice. Anyone may freely use it.

Link

This is what it looks like.

Remember, sharing means caring. ;)

~co~
[Sprint HTC EVO 4G LTE] il Duce:
Fyi the sync message that pops up, you can get rid of it by deleting htcsync apk and htcsync manager apk
[Sprint HTC EVO 4G LTE] closeone:
Whoops. Forgot to mention that as well. :silly: This has been a feature in my ROM since I started creating it. I completely forgot to mention that deleting those would suppress that message. Thanks for the reminder Duce. ;)

~co~
[Sprint HTC EVO 4G LTE] aidanski:
Is it not possible to create a symbolic link to an ISO on the SD card? That would allow larger images to be mounted. I don't own this device, but it's interesting anyway.
[Sprint HTC EVO 4G LTE] regaw_leinad:
That should work fine, yes. Not tested, but it's basically the same thing as having the file physically there.
[Sprint HTC EVO 4G LTE] closeone:
I know that it didn't work as is on an SD Card formatted FAT (Edit: I should say that it didn't work the way I had done it). Somebody had suggested formatting one SD Card partition EXT2/4. That may actually work, however I haven't had a chance to try it personally yet.

Thanks,

~co~
[Sprint HTC EVO 4G LTE] Spyderekz:
I would personaly love to mount a Ubuntu or Kubuntu ISO so i can have my own portable OS that i can boot it from USB with my phone plugged in.. like a SPY!!
[Sprint HTC EVO 4G LTE] Captain_Throwback:
So if I'd like to try this, how would I go about doing it?

I obviously need to create an EXT4 partition on my SD card (which is no problem). As far as the symlink goes, though - how do I do that? I've seen them in update scripts, but for an already existing system, would it have to be added to one of the init files? And I'd have to determine the mount point of the EXT partition so it could be mounted and then symlinked to, right?

I honestly have no idea what I'm doing, but I'm hoping with some guidance, I can optimize the usefulness of this great idea for a mod :).
[Sprint HTC EVO 4G LTE] pioterek2666:
Could be possible to port this feature in to other devices?
[Sprint HTC EVO 4G LTE] Spyderekz:
Probably only sense based, Maybe even 4.0

Swyped on my EVO LTE

---------- Post added at 12:25 PM ---------- Previous post was at 12:20 PM ----------

Symbolic links.. so easy in ubuntu but not sure how it works on android

, but I don't think we need ext4 to make it work?

Swyped on my EVO LTE
[Sprint HTC EVO 4G LTE] Spyderekz:
ln -s [target directory or file] [symlink shortcut]

For example, to link the /usr/local/lib/example directory to /example, use the following command:

ln -s /usr/local/lib/example /example
[Sprint HTC EVO 4G LTE] Captain_Throwback:
After doing some searching and experimenting, I was able to get the PCTOOL.ISO symlinked to the EXT partition, but I don't know how to keep the "sd-ext" folder I created persistent after a reboot, and keep the partition mounted so the symlink stays active. I can manually do the steps, which are:

# Create sd-ext folder for symlink
mkdir /sd-ext

# Mount ext4 partition to /sd-ext
mount -t ext4 -o rw /dev/block/mmcblk1p2 /sd-ext

# Symlink ISO file from system to ext
ln -sf /sd-ext/PCTOOL.ISO /system/etc/PCTOOL.ISO

and I even tried putting that into a script in /system/etc/init.d, but I'm not sure how to actually make it run on boot. I think the issue might be that where I need to create that "sd-ext" folder, it's not mounted RW, but read-only.

I'm in the process of downloading the Ubuntu 12.04 ISO and I'm going to try putting that on the sd-ext and see if it mounts. If it does, that would be awesome. Then I'd just have to change the icon in PCSC.apk to the Ubuntu logo.

But I still need help getting it to stick.

EDIT: I got the Ubuntu ISO to mount. Sweet. I even changed the png in the PCSC.apk to an Ubuntu logo (didn't decompile the APK and change the XML strings yet, though). I can't boot up my laptop from it, though. I'm not sure if it's bootable, unfortunately. I may have to try something else to get that to work.

And I still need help getting all this to stick after a reboot. But at least I was able to prove it can be done. Thanks for this mod, closeone! :D
[Sprint HTC EVO 4G LTE] Spyderekz:
I remember a thread about swapping mount points, made edits in fstab or something like that. Could you run the mount and syslink in there to make it stick?

Swyped on my EVO LTE

---------- Post added at 03:26 PM ---------- Previous post was at 03:22 PM ----------

Vold.fslab

Swyped on my EVO LTE
[Sprint HTC EVO 4G LTE] Captain_Throwback:
So I just confirmed that the script by itself works. What I need to do is mount the root "/" as RW before running it. That's why it's not working. When I mount it RW manually in Root Explorer and then run it, it works perfectly. Not exactly sure how to set that.

EDIT: Thank you to the power of search, I was able to find the busybox commands to mount / as rw. Rebooting and trying it now :).

EDIT 2: Nope, that didn't work :(. Maybe I'll try adding it to the vold.fstab, but messing around in there scares me :eek:. I don't know if I have all the parameters I need for that file.
[Sprint HTC EVO 4G LTE] closeone:
Sorry for not checking in sooner. Thanks Captain_Throwback.

Give this a try:

1. Let the ISO mount

2. Do a chmod 444 /sys/devices/platform/msm_hsusb/gadget/lun1/file

3. Whatever is set in that file, is the current mounted CD-ROM. This will give the system the ability to only read the file now. The system can't write anything to it. That, I believe is the cause for the drive unmounting at bad times. The second the phone detects that it's been disconnected, it goes ahead and resets that file back to nothing. This should keep it from changing it back.

Problem that I've noticed so far is that it will stay mounted even if the connection type is set to charge only. However, it unmounts the drive when you choose to browse the SD Card, which is good.

To revert this back to its normal behavior simply:

chmod 644 /sys/devices/platform/msm_hsusb/gadget/lun1/file

~co~
[Sprint HTC EVO 4G LTE] Captain_Throwback:
Which part exactly is this supposed to help with? The only issue I'm having right now is getting the ext partition to mount automatically on reboot. I have a script to mount it manually once I get booted up, and then the ISO mounts fine. Does this command make the ext mount persist through a reboot somehow (it doesn't seem related)? Maybe I'm just confused? :confused:
[Sprint HTC EVO 4G LTE] closeone:
Well. This will make the normal process the phone takes to mount the ISO persist. I'm trying my own tests with it like this, and can't tell if this secondary computer just doesn't like USB CD-ROM drives, or if there's more.

By doing this, when unplugging the USB cable and plugging it back in, the system will automatically mount the ISO. So, when rebooting, it should automatically mount the drive again.

I'm just starting with booting a tiny operating system from the phone without symlinking things. Once we know that works, then we can have some fun with a little more complicated mounting process (Symlink to ISO on an EXT partition on the SDCard).

Check this post out for a little more background behind the file.

Or, were you able to get it your computer to boot already directly from the /system/etc directory? In that case, you can probably safely ignore everything I just said. ;)

Hopefully, I wasn't completely nonsensical here. Sorry if I was.

~co~

EDIT: If your ROM has init.d support, you should be able to take that script, and copy it into /etc/init.d and name it something like "80mountext" so that it executes later in the Android boot process than other scripts.
[Sprint HTC EVO 4G LTE] Spyderekz:
You can get it to boot, we should figure out how to keep a persistive file, I think its usually called casper-RW so that settings and such are kept. USB installer can create it

Swyped on my EVO LTE
[Sprint HTC EVO 4G LTE] Captain_Throwback:
Got it!

I checked proc/mounts, and apparently the ext partition was already getting mounted at /data/sdext2. Just linked the PCTOOL.ISO from there back to /system/etc, and it's working great! When in Windows, the Ubuntu install menu pops up when I mount in the old "HTC Sync" mode.

I don't think I can boot up with it, though. I definitely can't on my laptop, but I'll have to see if it works on my Desktop next :).

EDIT: Just finished modifying the PCSC.apk for it too. Still haven't tried to boot my Desktop from it, though (I already have Ubuntu installed on it).
[Sprint HTC EVO 4G LTE] closeone:
Awesome! :laugh:

Yeah. I still haven't had any luck booting either. I just gave it a try on my desktop. The phone shows up in my boot menu twice as "HTC Android Phone," but neither boot the OS on there. I don't know if it's a timing thing, or what. It boots if I use it as a CDROM drive in VirtualBox.

~co~
[Sprint HTC EVO 4G LTE] Spyderekz:
how does it show the drive as? can you read the contents and attempt to install with wubi? at that poing we might just need to check if the iso is still bootable somehow. Thi is beyond my expertise but im just offering suggestions at this point :p

at the risk of loosing data, we could plug our phone in and run usb installer to format our SD card and make it bootable, but that might not work or render this ISO idea useless. If you guys figure this out it would rock so hard.

http://www.pendrivelinux.com/universal-usb-installer-easy-as-1-2-3/
[Sprint HTC EVO 4G LTE] Captain_Throwback:
If I can't boot directly from the ISO, my next thought was to try and create a bootable install on my ext partition using unetbootin in Ubuntu, and then pack up the entire contents of the partition into an ISO and rename it to PCTOOL.ISO so that it should mount when selected in the Connection Manager on the device and connected to the computer. I probably won't have time to mess with it again until Friday, though.

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

Current Device: HTC EVO 4G LTE | ROM: Viper4G 1.0.0 | Kernel: 3.0.8-AwesomeSauce1.2
[Sprint HTC EVO 4G LTE] Spyderekz:
doesnt the master boot record have to be on the main drive if the SD is considered a partitioned drive? might have to run a utility to make the SD card bootable
[Sprint HTC EVO 4G LTE] kingakuma:
Wouldnt you just need to set a auto.exe or boot.ini within the pctools.iso or CD-ROM.iso to link to the install location on the sdcard.

Just a thought partition the Sd card with ext, use the universal USB installer to install to the newely partitioned ext partition, when the ISO is installed to that partition you usually have an auto.exe file take that file modify the script to direct it to the partition on the Sd card where the install file is and modify the pctools.iso or cdrom.iso to incorperate that auto.exe script

Or autorun.inf

Example:

[Autorun]

open=.\folder\program.exe
[Sprint HTC EVO 4G LTE] closeone:
kingakuma, unfortunately it doesn't work quite like that. Well, let me catch myself there. autorun.inf is a small text file designed to give Windows few instructions for how to handle the launching of the CD/Flash Drive/External Hard Drive/etc that the file resides on. It doesn't contain any directions for booting an OS.

I'm not exactly following you on the auto.exe stuff. A file with the file extension .exe typically represents an executable Windows application. An OS or ISO does not boot from an executable file.

We're talking about something completely separate from anything within the scope of an already booted OS.

Also, while applications that create a filesystem for allowing an OS to be booted from a flash drive or other media, would work, this would completely sidestep the original issue about booting using an already created ISO. This is something that could technically be done on many phones already.

Hopefully my response made some sense. Please know that I'm just giving you a look at your statement, and that I'm not in any way trying to belittle you.

Thank you,

~co~
[Sprint HTC EVO 4G LTE] kingakuma:
What I was attempting to get at was I saw people trying to run kubuntu and such, if that was the case, a file like autorun.inf could point to the file that runs the virtual installer and would hopefully show the device within USB drive/cdrom from within system bios.

Typical Auto Run for Ubuntu

[autorun]

open=wubi.exe --cdmenu

icon=wubi.exe,0

label=Install Ubuntu

[Content]

MusicFiles=false

PictureFiles=false

VideoFiles=false

But if I remember right for a bios boot it has to be formated to fat32
[Sprint HTC EVO 4G LTE] Spyderekz:
I'm glad you guys are working on this. I being able to run ubuntu from our phones would be awesome!

Swyped on my EVO LTE
[Sprint HTC EVO 4G LTE] Captain_Throwback:
@closeone

Any chance you can update the modified PCSC.apk to the one from the 2.13 update?

I still haven't figured out how to get my mount script to work on boot-up, but I still like to manually mount my ext partition and use the adb commands when I need them through the sync manager option.

The new version is slightly different, and I've been having issues trying to decompile it.
[Sprint HTC EVO 4G LTE] closeone:
I have been able to update it. I'll throw it up here for anybody to use as they wish (no credit needed). HTC, for whatever silly reason, decided to have the Sync image point to one of the framework files. That's fine... but they left the old images in the APK... Just replace my image with whatever you want, like before, and you're set. This one is patched so that the correct image is used (thanks to a commit made by steal25 for the SuperLTE ROM, I was able to figure out how he had done it (and yes, he knows that I used that to figure out how to patch it).

Yeah.. I still have no idea what's happening, only guess being a previous one--that the phone unmounts for a second as the computer is booting, and doesn't remount fast enough for the it to pick it up as a bootable drive.

Would you mind sending me a copy of your script? I'm assuming that you're talking about it mounting when the phone boots? I might be able to get it working for you.

~co~