[MOD] Flashable Sync Manager ISO Replacement (Mount Virtual CD from Phone)

Search This thread

closeone

Senior Member
Jan 11, 2012
1,098
1,463
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.

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~
 
Last edited:

Spyderekz

Senior Member
Mar 22, 2008
575
102
Wichita
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~

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!!
 

Captain_Throwback

Recognized Developer
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~

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!!
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 :).
 

Spyderekz

Senior Member
Mar 22, 2008
575
102
Wichita
Could be possible to port this feature in to other devices?

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
 

Spyderekz

Senior Member
Mar 22, 2008
575
102
Wichita
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
 

Captain_Throwback

Recognized Developer
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
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:
Code:
# 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
 
Last edited:

Spyderekz

Senior Member
Mar 22, 2008
575
102
Wichita
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
 

Captain_Throwback

Recognized Developer
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
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.
 
Last edited:
  • Like
Reactions: closeone

closeone

Senior Member
Jan 11, 2012
1,098
1,463
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.

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~
 

Captain_Throwback

Recognized Developer
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~
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:
 

closeone

Senior Member
Jan 11, 2012
1,098
1,463
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:

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.
 
Last edited:

Spyderekz

Senior Member
Mar 22, 2008
575
102
Wichita
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
 

Captain_Throwback

Recognized Developer
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).

458b19f6-216a-1b2b.jpg
 
Last edited:
  • Like
Reactions: closeone

closeone

Senior Member
Jan 11, 2012
1,098
1,463
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).

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~
 

Spyderekz

Senior Member
Mar 22, 2008
575
102
Wichita
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~

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/
 

Captain_Throwback

Recognized Developer
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
 

Spyderekz

Senior Member
Mar 22, 2008
575
102
Wichita
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

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
 

kingakuma

Senior Member
Nov 10, 2009
512
109
California
www.facebook.com
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


Sent from my EVO using xda premium
 
Last edited:

closeone

Senior Member
Jan 11, 2012
1,098
1,463
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

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~
 
  • Like
Reactions: a senile fungus

Top Liked Posts

  • There are no posts matching your filters.
  • 21
    Just a quick note for anyone strolling in. I am still supporting this modification. If you have any questions or comments, please feel free to post.

    Hello everyone. Hopefully this hasn't been done before. This mod is a bit more of a fun one (In my humble opinion :)).

    You may have noticed that when you connect your phone up to a computer, while booted into a Sense-based ROM, the phone will mount two drives -- one being a mass storage device, and the other being a CD-ROM drive. Interestingly enough, when you select HTC Sync Manager from the USB connection type list, it makes the computer think that you inserted a CD-ROM.

    That's interesting because that means that you could essentially hook the phone up to just about any computer, and it would recognize that "CD-ROM drive."

    Background
    I found that you can actually change that CD-ROM to just about anything you could possibly want (having some trouble with bootable ISOs though).

    There is a file named PCTOOL.ISO inside the /system/etc directory that normally contains the HTC Sync Manager Software. By replacing that ISO with another, it'll mount that one instead. Because there isn't too much room to spare in the /system partition, the file should probably be kept relatively small.

    Okay. Why does this matter? I can think of two reasons:

    1. ROM Developers can include a package that contains a copy of the ADB and Fastboot executables within their ROM. ADB would be useful while the device is on; Fastboot would probably have to be copied to the computer.
    2. Because the ISO is mounted as Read-Only media, it could be incredibly useful for field technicians who need to run portable software, without the risk of being infected with a virus on the host machine.

    Info/Download
    It's not hard to create these ISOs, and flash them to the phone. I can put up a how-to in the second post if anybody would like me to.

    For now, here's a flashable zip containing ADB and Fastboot executables for Windows, Linux, and Mac OS X.

    Just flash the file like you would flash any other.

    There is an old version of the PCSC.apk in this file. A newer version is here for the time being.
    Download

    How to use
    To use it, while booted, change the device-connection type to HTC Sync Manager. Tap 'Done'. You'll likely see a message on the phone that says "Connecting to HTC Sync Manager ..." Just tap the back button on your phone to clear that message.

    On your computer:
    If you're running Windows, you may get an AutoPlay window that gives you the option to launch the "ADB and Fastboot Command Prompt." If you click that, you'll get a Command Prompt Window that's pointed at the drive already. To use any of the commands, just type adb [COMMAND], or fastboot [COMMAND] (again, fastboot may be useless unless copied to the computer).
    If you don't get an AutoPlay window, open up the CD-ROM drive, and double-click on the 'ADB_FASTBOOT_SHELL.BAT' icon to bring up the window. That batch file contains only one command (just to launch the Command Prompt to the CD location).
    If you're running Linux, you may have to copy the binaries over to your computer to use them (they may not have correct permissions).
    On Mac OS X, you'll likely have to open a terminal window and navigate to the CD-ROM drive to use them.

    I know that this isn't anything huge, but I'll put this down here anyways. Developers, if you are interested in the ADB/Fastboot ISO or flashable ZIP, and would like to include it in your ROM, please feel free to do so. Modify it however you like. Only thing that I would ask of you is that you post here (or even PM me) saying that you used it. I'd just love to see if/where it's being used. This isn't a strict requirement though. :) Thanks!

    Disclaimer: I am not responsible for anything that happens (including, but not limited) to your phone, computer, Sprint contract, etc. This is provided free of charge without any warranty.
    4
    @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.

    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~
    3
    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.

    XTIEam.jpg


    Remember, sharing means caring. ;)

    ~co~
    2

    Woah. Wow. Thanks for pointing me to the news article Gumby63!

    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.

    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. ;)

    Much deserved, also, moved this to the ORIGINAL dev section.

    Thank you!

    ~co~

    Edit: If PoorCollegeGuy happens to stop upon this thread, I just want to say thank you for the write-up!