[GUIDE] Update CM without losing custom /system changes (ex Swype, keymap)

Search This thread

skyjumper

Member
Jan 2, 2009
37
4
There's a really simple way to prevent CyanogenMod from overwriting your custom /system changes during an update. Create the file '/system/etc/custom_backup_list.txt' with a list of files within /system that you don't want to be overwritten.

For example, to prevent CM from wiping out Swype, open adb shell and type this:
Code:
mount -o remount,rw /system
cd /system/etc
echo lib/libSwypeCore.so >custom_backup_list.txt
echo app/Swype.apk >>custom_backup_list.txt
cd /
mount -o remount,ro /system

If you use teferi's custom keymap, do this:
Code:
mount -o remount,rw /system
cd /system/etc
echo lib/libSwypeCore.so >custom_backup_list.txt
echo app/Swype.apk >>custom_backup_list.txt
echo usr/keylayout/vision-keypad.kl >>custom_backup_list.txt
echo usr/keychars/vision-keypad.kcm.bin >>custom_backup_list.txt
cd /
mount -o remount,ro /system

Then the next time you flash CM, your changes to /system will still be there. If you want to see why this works, take a look at /system/bin/backuptool.sh

Hope this helps
 
Last edited:
  • Like
Reactions: hoey23 and reukiodo

cparekh

Senior Member
Oct 15, 2009
255
10
Thanks! This is great; now I can easily keep my Email.apk that doesn't require me to enter a alphanumeric password every time I want to use the phone.
 

sundar2012

Senior Member
Oct 8, 2009
555
21
Manhattan
CM probably needs to overwrite build.prop but I've been changing the LCD density in this file. Is there a way to use a seperate file to override the lcd density so that i can let CM overwrite build.prop but still maintain lcd density after a flash?
 

skyjumper

Member
Jan 2, 2009
37
4
Whatever commands you put in /data/local/userinit.sh will run at boot. So in adb shell, type this for a density of 215:
Code:
cd /data/local
echo setprop qemu.sf.lcd_density 215 >userinit.sh
 

sundar2012

Senior Member
Oct 8, 2009
555
21
Manhattan
awesome! thank you!

Don't suppose you would know how to get the CM update to not install/auto delete after installation apks like ADWLauncher and wifi calling?
 

Kalandros

Member
Jun 13, 2009
41
2
Thank you!

This may be the long lost solution to my Swype and Cyan Problems. The new Release Candidates are destroying my swype and not liking it's return after installing the new Cyan. So, if this can basically help me update without losing much, it's a god send. Especially the LCD density.

You're a genius.

Thank you.


Hmm, seems the issue is still persistent. Thanks though.
 
Last edited:

apzalo

Senior Member
Nov 2, 2010
94
17
Jacksonville, FL
Should userinit.sh and custom_backup_list.txt survive the upgrade or should they both be included in the backup list file?

Sent from my HTC Vision using XDA App
 

igashu

Member
Mar 21, 2009
40
3
If you look at the actual script, it seems that it ignores the backuptool if .installscript exists, and in practice, I've noticed that nothing gets saved when flashing via ROM Manager. Is this, in fact, what's happening, and is there a way around it?
 

muness

Senior Member
Jul 18, 2008
289
101
awesome! thank you!

Don't suppose you would know how to get the CM update to not install/auto delete after installation apks like ADWLauncher and wifi calling?

You can put the following in /data/local/userinit.sh:

mount -o rw,remount /system

for apk in ADWLauncher.apk MS-HTCVISION-KNT20-02.apk
do
rm -f /system/app/$apk
done

for package in com.android.launcher
do
pm uninstall $package
done

mount -o ro,remount /system
exit 0

I haven't tried this for removing the Wifi Calling app, so ymmv. I remove a much larger set of apps myself (facebook, email, live wallpapers, amazon mp3 store, DSPManager, FileManager, Browser). http://wiki.cyanogenmod.com/index.php?title=Barebones has a list of apps that can be removed safely.
 

pbedard

Senior Member
Jul 30, 2010
4,386
1,122
boston
Rc4 has the trackpad wake fm radio and speaker led fixed its workng very smooth better than rc3

Sent from my HTC Vision using XDA App
 

fastludeh22

Senior Member
Mar 22, 2009
369
29
awesome! thank you!

Don't suppose you would know how to get the CM update to not install/auto delete after installation apks like ADWLauncher and wifi calling?

Just delete them from the cmupdate.zip before flashing. Cwm recovery doesn't require sig so u don't have to worry about resigning it.

OP: nice find, I'm sure ill use it at some point.
 

rraxda

Senior Member
Nov 4, 2010
158
2
This is driving me crazy because I know I have used this command before but i cannot get it to work now... What is the deal?

Code:
$ mount -o remount,rw /system
Usage: mount [-r] [-w] [-o options] [-t type] device directory

Rooted using gfree on this phone. On my previous phone I used wpthis and did not have a problem. Anyone know what I need to do to mount rw?
 

rraxda

Senior Member
Nov 4, 2010
158
2
Used this method to when going from stock to CM 6.1.1 and could not get it to work. I had to push/install manually from ADB.

Anyone had any luck? I did what the OP said then flashed. Was I supposed to do anything after flashing wiping and then flashing (CM & gapps)?
 

Hot_Hands

Senior Member
Jul 12, 2010
175
29
This is driving me crazy because I know I have used this command before but i cannot get it to work now... What is the deal?

Code:
$ mount -o remount,rw /system
Usage: mount [-r] [-w] [-o options] [-t type] device directory

Rooted using gfree on this phone. On my previous phone I used wpthis and did not have a problem. Anyone know what I need to do to mount rw?

Make sure you have root in the shell by typing su.
 

BobNobbins

Member
Jan 28, 2009
13
0
Columbus, OH

rraxda

Senior Member
Nov 4, 2010
158
2
Titanium backup. You can use it to restore the app and the data. Usually i just restore the data to a fresh install.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    There's a really simple way to prevent CyanogenMod from overwriting your custom /system changes during an update. Create the file '/system/etc/custom_backup_list.txt' with a list of files within /system that you don't want to be overwritten.

    For example, to prevent CM from wiping out Swype, open adb shell and type this:
    Code:
    mount -o remount,rw /system
    cd /system/etc
    echo lib/libSwypeCore.so >custom_backup_list.txt
    echo app/Swype.apk >>custom_backup_list.txt
    cd /
    mount -o remount,ro /system

    If you use teferi's custom keymap, do this:
    Code:
    mount -o remount,rw /system
    cd /system/etc
    echo lib/libSwypeCore.so >custom_backup_list.txt
    echo app/Swype.apk >>custom_backup_list.txt
    echo usr/keylayout/vision-keypad.kl >>custom_backup_list.txt
    echo usr/keychars/vision-keypad.kcm.bin >>custom_backup_list.txt
    cd /
    mount -o remount,ro /system

    Then the next time you flash CM, your changes to /system will still be there. If you want to see why this works, take a look at /system/bin/backuptool.sh

    Hope this helps