The OnePlus 6 is officially on sale! Buy now →
FORUMS
Remove All Ads from XDA
OnePlus 6 On Sale

writing update-script file

72 posts
Thanks Meter: 0
 
By diordnahero, Member on 8th May 2010, 04:35 PM
Post Reply Email Thread
I would like to copy additional files into the /data/app/ folder with an update.zip file. My script will successfully add to /system/app/ folder but not /data/app/. I've seen code to delete and then add a whole new /data/app/ folder but I would like to keep whatever is in there already, just add and remove specific files in it. This is what I've been using but it fails. Can this be done?
Code:
show_progress 0.200000 0

delete DATA:app/com.facebook.katana.apk
copy_dir PACKAGE:data DATA:
set_perm 1000 1000 0771 DATA:app
 
 
8th May 2010, 05:17 PM |#2  
JsChiSurf's Avatar
Inactive Recognized Developer
Hacksville
Thanks Meter: 1,405
 
Donate to Me
More
Quote:
Originally Posted by diordnahero

I would like to copy additional files into the /data/app/ folder with an update.zip file. My script will successfully add to /system/app/ folder but not /data/app/. I've seen code to delete and then add a whole new /data/app/ folder but I would like to keep whatever is in there already, just add and remove specific files in it. This is what I've been using but it fails. Can this be done?

Code:
show_progress 0.200000 0

delete DATA:app/com.facebook.katana.apk
copy_dir PACKAGE:data DATA:
set_perm 1000 1000 0771 DATA:app

While not necessarily my forte, do you happen to be running apps2sd? My guess is that the partition on the SD card hasn't mounted yet, and thus, the file(s) can't be accessed to delete.
9th May 2010, 01:55 AM |#3  
OP Member
Thanks Meter: 0
 
More
yes I am.

Though my update script works to write and delete to /system/.. folders just fine. The update-script files I have looked at delete the whole folder first and then create/copy the new one, then correct permissions. I can't find anything specific to delete/adding individual files though.
9th May 2010, 02:29 AM |#4  
JsChiSurf's Avatar
Inactive Recognized Developer
Hacksville
Thanks Meter: 1,405
 
Donate to Me
More
Quote:
Originally Posted by diordnahero

yes I am.

Though my update script works to write and delete to /system/.. folders just fine. The update-script files I have looked at delete the whole folder first and then create/copy the new one, then correct permissions. I can't find anything specific to delete/adding individual files though.

The system folder is not part of apps2sd, so that would make sense.

I'm still thinking this is your issue. I'm wondering if there is a way to mount via an update script?
9th May 2010, 02:42 AM |#5  
zippy-man's Avatar
Senior Member
Thanks Meter: 4
 
More
Quote:
Originally Posted by JsChiSurf

The system folder is not part of apps2sd, so that would make sense.

I'm still thinking this is your issue. I'm wondering if there is a way to mount via an update script?

I dont think mounting via an update script is possible but you could write a script to do it kinda like Cyanogen's backup script that mounts the sdcard when in recovery to do a backup of google shits.
10th May 2010, 07:18 PM |#6  
JsChiSurf's Avatar
Inactive Recognized Developer
Hacksville
Thanks Meter: 1,405
 
Donate to Me
More
Quote:
Originally Posted by zippy-man

I dont think mounting via an update script is possible but you could write a script to do it kinda like Cyanogen's backup script that mounts the sdcard when in recovery to do a backup of google shits.

I saw this syntax referenced in another thread, that you can use in an update script:

run_program PACKAGE:script.sh

I'm assuming this is what Cyanogen is doing?

That's pretty cool. So, moral of the story, you can create a little shell script that runs during the update process that will mount the necessary partition, and move / add / delete files as necessary.

Actually makes it nicer, as you can write your entire update as a shell script rather than using the standard update script lingo, which may be less familiar...
10th May 2010, 07:29 PM |#7  
regaw_leinad's Avatar
Inactive Recognized Developer
Flag Seattle, WA
Thanks Meter: 3,796
 
More
Quote:
Originally Posted by JsChiSurf

I saw this syntax referenced in another thread, that you can use in an update script:

run_program PACKAGE:script.sh

I'm assuming this is what Cyanogen is doing?

That's pretty cool. So, moral of the story, you can create a little shell script that runs during the update process that will mount the necessary partition, and move / add / delete files as necessary.

Actually makes it nicer, as you can write your entire update as a shell script rather than using the standard update script lingo, which may be less familiar...

yup, I've done that before. Very handy. that'll get the job done
10th May 2010, 08:59 PM |#8  
zippy-man's Avatar
Senior Member
Thanks Meter: 4
 
More
Re: writing update-script file
Quote:

Quote:

I dont think mounting via an update script is possible but you could write a script to do it kinda like Cyanogen's backup script that mounts the sdcar

I saw this syntax referenced in another thread, that you can use in an update script:

run_program PACKAGE:script.sh

I'm assuming this is what Cyanogen is doing?

That's pretty cool. So, moral of the story, you can create a little shell script that runs during the update process that will mount the necessary partition, and move / add / delete files as necessary.

Actually makes it nicer, as you can write your entire update as a shell script rather than using the standard update script lingo, which may be less familiar...

Yep. You just create whatever script you want and add that to the update script and it will run it. I have used it for many things but have not used a script to mount the sd card.

If you get a hold of the script that cm wrote you could pull out the party that mounts the sd card and use that to write to data if it its located on the sd card.




-------------------------------------
Sent from my HTC Hero
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes