vetruvet / ota-update-centre

ota-update-centre
http://otaupdatecenter.pro
40 stars 80 forks source link

Failed to find update package on Rezound Internal SD Card #2

Closed NilsP closed 11 years ago

NilsP commented 11 years ago

This is the results in CWM Recovery

ClockworkMod Recovery v5.8.1.4 Finding update package Opening update package Verifying update package E: Failed to open /sdcard/OTA-Updater/download/Business_ICS4.0.3_Sense4.0_1.7.zip (No such file or directory) E: Signature verification failed Installation aborted

The results in AmonRa is similar

RA Revamped Build : RA-Vigor-v3.15-getitnowmarketing Finding update package Can't mount /sdcard/OTA-Updater/download/Business_ICS4.0.3_Sense4.0_1.7.zip Installation aborted.

I believe this is a known issue on the Rezound/Vigor being unable to mount internal SDCARD in recovery.

NOTE: SDCARD is the internal and SDCARD2 is external. There is also a symlink on SDCARD for ext_sd to SDCARD2

M3NTI0N commented 11 years ago

Most likely fixable by using this method: http://developer.android.com/reference/android/content/Context.html#getExternalFilesDir(java.lang.String)

NilsP commented 11 years ago

Just food for thought on a way to fix this for the rezound/vigor and possibly other similar devices.

The big issue is that the internal sdcard is not accessible in recovery.

I see the issue and the result in logcat but not sure how to fix it myself.

It is already using Environment.getExternalStorageDirectory() to get the device link which returns /mnt/sdcard/. However, on the vigor the external is /mnt/sdcard2/.

It is line 36 in Config.java.

I was thinking it could possibly be hard coded to the external if the device type is equal to vigor.

I love the app so I hope this is doable.

Ithamar commented 11 years ago

The only path I know off that can be accessed easily from recovery in virtually every build I've seen is the userdata (/data) partition. One way to use that would be to use the Context.getFilesDir(), just be aware that many older (2.x) builds have a fairly limited sized userdata partition.

NilsP commented 11 years ago

On the Rezound the only place you can flash from is the external sdcard.

NilsP commented 11 years ago

Another possible hint:

When writing to the external sdcard when phone is active (during download) the external sdcard is sdcard2

I made a copy of the OTA-Updater folder on the external card (sdcard2) manually and when the app tried to install the download it found the copy I created on the external card.

In other words for the Rezound/vigor the download needs to go to sdcard2 but sdcard (without the 2) can be passed to recovery and it will work since all recoveries know the external as sdcard.

Hope this sheds some light.

M3NTI0N commented 11 years ago

Possible fix2 quoting lov on #CyanogenMod-dev:

public static final File DOWNLOAD_FILE = new File(Environment.getExternalStorage(), "OTA-Updater" + File.separator + "download");

Consider also using http://developer.android.com/reference/android/content/Context.html#getExternalFilesDir(java.lang.String) for your external file storage paths, instead of random directories on the SD card

I'd recommend also checking http://developer.android.com/reference/android/os/Environment.html#getExternalStorageState() if you're going to be using external storage; it's possible/probable that the external storage either isn't mounted yet or isn't physically present.

NilsP commented 11 years ago

I don't think either of those will address the actual problem since the file is getting written to internal when the recoveries can only see external. When HTC introduced the Rezound (vigor) they reversed the traditional names for internal and external sdcard's. So, when you are doing the download it writes to sdcard which is the internal card. However, all the recoveries use sdcard which points to the actual external card. I proved this buy copying the internal folder and file to the external card before letting OTA boot to recovery to install and it found it on the external card only because I manually put it there.

So the actual answer for the vigor it to save the download to sdcard2 and pass sdcard to recovery. In other words only change the save point during download to sdcard2 and pass the flash point to recovery as sdcard.

I know this is Rezound/vigor specific but it could work similarly for other devices that don't set the correct download point for flashing. It could be just a matter of setting a switch that says if device is vigor then download is sdcard2. If Samsung the download is sdcar0, etc. leaving the default to sdcard

M3NTI0N commented 11 years ago

@NilsP, you may fork it, and add the 'if device' do 'hardcoded path' and then do a pull request. Vetruvet is quiet busy today, so i think he wont be able to work on it.

NilsP commented 11 years ago

I forked it, made a hard codded change but don't have a local compile environment setup. I am just gonna put the project on hold until this is sorted out

NOTE: DO NOT PUT MY CHANGE IN THE MAIN PRODUCT SINCE IT WILL BREAK IT FOR EVERYONE>

Mushishi commented 11 years ago

NilsP Give this one a test. It should include a dirty hack to solve it for you... But i give no promises.

--Link-Removed-By-Mushishi--

Ok i did some mistakes here. The apk there would not work and i am to tired now to do something (6am here now)

Will work on it tomorrow.

NilsP commented 11 years ago

Much closer. This time when it started to download it said there was an error with the download but it created the folder on the external card obviously with no file in the folder.

But now I see you expected it to fail

Thanks

Mushishi commented 11 years ago

NilsP yep but i did learn something from your logcat.. :)

If you take a look in /sdcard when in android do you have a folder there called ext_sd and do that hold the stuff you have in the external sd card... Because i think it is more easy for me to make it dl and save in that folder and still just hardcode the script part so as soon it is your model then it will do the rom install in recovery from your /sdcard

But i am at work at the moment and i did leave all the code at home... So i dont think i might be able to work on it the next 4 hours atleast... :)

NilsP commented 11 years ago

ext_sd is a symlink from sdcard (internal) to sdcard2 (external) so that would do the same think. Good find. I forgot about that.

Thanks

Nils

----- Reply message ----- From: "Mushishi" notifications@github.com To: "Vetruvet/ota-update-centre" ota-update-centre@noreply.github.com Cc: "NilsP" nekberg@nycap.rr.com Subject: [ota-update-centre] Failed to find update package on Rezound Internal SD Card (#2) Date: Wed, Aug 15, 2012 6:50 AM NilsP yep but i did learn something from your logcat.. :)

If you take a look in /sdcard when in android do you have a folder there called ext_sd and do that hold the stuff you have in the external sd card... Because i think it is more easy for me to make it dl and save in that folder and still just hardcode the script part so as soon it is your model then it will do the rom install in recovery from your /sdcard

But i am at work at the moment and i did leave all the code at home... So i dont think i might be able to work on it the next 4 hours atleast.... :)

Reply to this email directly or view it on GitHub.

Mushishi commented 11 years ago

Well i can see it if will be more easy to use that folder insted of using a hardlink to SdCard2 when i think about it then it might be the same.. :P

NilsP commented 11 years ago

Mushishi

Download works great now with test version

I think we missed another part. If the file is already downloaded it still downloads it again.

Thanks

Mushishi commented 11 years ago

NilsP i will look into that to see why that is... :)

NilsP commented 11 years ago

Mushishi

Don't bother with it. Seems it was a one time thing

Mushishi commented 11 years ago

NilsP good... Well now i just have to find a better way to do it insted of this hax.. :) Good thing my vacation starts soon... :P

NilsP commented 11 years ago

Well, now that everything is working on CWM I have a similar but different problem with AmonRa. It seems that AR tries to mount the Internal as /sdcard so passing /sdcard to AR fails to mount the external like CWM does. Not sure if /sdcard2 or /sd-ext or whatever will open the external so I have asked the dev.

I have no idea how we can solve this one in OTA without having a Rezound version specific for AmonRA or like you suggested make the target for flash an option.

Love this app but these Rezound issues are gonna drive me crazy

The real answer is to get the recovery devs to standardize but I don't suspect that will happen in my lifetime.

Ithamar commented 11 years ago

actually, I've considered contributing some recovery test cases to the Android CTS project ;) If those get accepted it will automatically force most vendors to follow some kind of standard....

Ofcourse, if anyone else feels like doing that be my guest, I do not know when I'll get around to actually doing that...

M3NTI0N commented 11 years ago

new version that fixes this, will be released this evening.

NilsP commented 11 years ago

Beat me to it M3TI0N