[Samsung Galaxy Nexus] Phuturist:
I'm trying to use this removal script in CM12. It's called 91-cm.sh and has been added to /system/addon.d/ with correct permissions but doesnt do anything when updating the ROM. Does this approach not work anymore in CM12? Running the script in Terminal FC's the terminal app, my guess is there is something wrong but I'm not seeying it.

#!/sbin/sh
#
# /system/addon.d/91-cm.sh
#

. /tmp/backuptool.functions

list_files() {
cat <<EOF
media/audio/ringtones/Ring_Synth_04.ogg
EOF
}

case "$1" in
backup)
list_files | while read FILE DUMMY; do
backup_file $S/"$FILE"
done
;;
restore)
list_files | while read FILE REPLACEMENT; do
R=""
[ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT"
[ -f "$C/$S/$FILE" ] && restore_file $S/"$FILE" "$R"
done
;;
pre-backup)
# Stub
;;
post-backup)
# Stub
;;
pre-restore)
# Stub
;;
post-restore)
# Stub

# remove stuff
rm /system/app/BasicDreams/BasicDreams.apk
rm /system/app/Camera2/Camera2.apk
rm /system/app/CMWallpapers/CMWallpapers.apk
rm /system/app/Galaxy4/Galaxy4.apk
rm /system/app/Hangouts/Hangouts.apk
rm /system/app/HoloSpiralWallpaper/HoloSpiralWallpaper.apk
rm /system/app/LiveWallpapers/LiveWallpapers.apk
rm /system/app/Music2/Music2.apk
rm /system/app/NoiseField/NoiseField.apk
rm /system/app/PhaseBeam/PhaseBeam.apk
rm /system/app/PlayGames/PlayGames.apk
rm /system/app/PlusOne/PlusOne.apk
rm /system/app/Videos/Videos.apk
rm /system/app/VisualizationWallpapers/VisualizationWallpapers.apk
rm /system/app/WisperPush/WisperPush.apk

rm /system/priv-app/Trebuchet/Trebuchet.apk

rm -rf /system/app/BasicDreams/
rm -rf /system/app/Camera2/
rm -rf /system/app/CMWallpapers/
rm -rf /system/app/Galaxy4/
rm -rf /system/app/Hangouts/
rm -rf /system/app/HoloSpiralWallpaper/
rm -rf /system/app/LiveWallpapers/
rm -rf /system/app/Music2/
rm -rf /system/app/NoiseField/
rm -rf /system/app/PhaseBeam/
rm -rf /system/app/PlayGames/
rm -rf /system/app/PlusOne/
rm -rf /system/app/Videos/
rm -rf /system/app/VisualizationWallpapers/
rm -rf /system/app/WisperPush/

rm -rf /system/priv-app/Trebuchet/

rm /system/media/audio/ringtones/Andromeda.ogg
rm /system/media/audio/ringtones/Aquila.ogg
rm /system/media/audio/ringtones/ArgoNavis.ogg
rm /system/media/audio/ringtones/Atria.ogg
rm /system/media/audio/ringtones/Backroad.ogg
rm /system/media/audio/ringtones/BeatPlucker.ogg
rm /system/media/audio/ringtones/BentleyDubs.ogg
rm /system/media/audio/ringtones/Big_Easy.ogg
rm /system/media/audio/ringtones/BirdLoop.ogg
rm /system/media/audio/ringtones/Bollywood.ogg
rm /system/media/audio/ringtones/BOOTES.ogg
rm /system/media/audio/ringtones/Boxbeat.ogg
rm /system/media/audio/ringtones/BussaMove.ogg
rm /system/media/audio/ringtones/Cairo.ogg
rm /system/media/audio/ringtones/Callisto.ogg
rm /system/media/audio/ringtones/Calypso_Steel.ogg
rm /system/media/audio/ringtones/CanisMajor.ogg
rm /system/media/audio/ringtones/CaribbeanIce.ogg
rm /system/media/audio/ringtones/Carina.ogg
rm /system/media/audio/ringtones/CASSIOPEIA.ogg
rm /system/media/audio/ringtones/Centaurus.ogg
rm /system/media/audio/ringtones/Champagne_Edition.ogg
rm /system/media/audio/ringtones/Club_Cubano.ogg
rm /system/media/audio/ringtones/CrayonRock.ogg
rm /system/media/audio/ringtones/CrazyDream.ogg
rm /system/media/audio/ringtones/CurveBall.ogg
rm /system/media/audio/ringtones/CyanTone.ogg
rm /system/media/audio/ringtones/Cygnus.ogg
rm /system/media/audio/ringtones/DancinFool.ogg
rm /system/media/audio/ringtones/Ding.ogg
rm /system/media/audio/ringtones/Dione.ogg
rm /system/media/audio/ringtones/DonMessWivIt.ogg
rm /system/media/audio/ringtones/Draco.ogg
rm /system/media/audio/ringtones/DreamTheme.ogg
rm /system/media/audio/ringtones/Eastern_Sky.ogg
rm /system/media/audio/ringtones/Enter_the_Nexus.ogg
rm /system/media/audio/ringtones/Eridani.ogg
rm /system/media/audio/ringtones/EtherShake.ogg
rm /system/media/audio/ringtones/FreeFlight.ogg
rm /system/media/audio/ringtones/FriendlyGhost.ogg
rm /system/media/audio/ringtones/Funk_Yall.ogg
rm /system/media/audio/ringtones/GameOverGuitar.ogg
rm /system/media/audio/ringtones/Ganymede.ogg
rm /system/media/audio/ringtones/Gimme_Mo_Town.ogg
rm /system/media/audio/ringtones/Girtab.ogg
rm /system/media/audio/ringtones/Glacial_Groove.ogg
rm /system/media/audio/ringtones/Growl.ogg
rm /system/media/audio/ringtones/HalfwayHome.ogg
rm /system/media/audio/ringtones/Highscore.ogg
rm /system/media/audio/ringtones/Hydra.ogg
rm /system/media/audio/ringtones/InsertCoin.ogg
rm /system/media/audio/ringtones/Kuma.ogg
rm /system/media/audio/ringtones/LoopyLounge.ogg
rm /system/media/audio/ringtones/Luna.ogg
rm /system/media/audio/ringtones/Lyra.ogg
rm /system/media/audio/ringtones/Machina.ogg
rm /system/media/audio/ringtones/MidEvilJaunt.ogg
rm /system/media/audio/ringtones/MildlyAlarming.ogg
rm /system/media/audio/ringtones/Nairobi.ogg
rm /system/media/audio/ringtones/Nassau.ogg
rm /system/media/audio/ringtones/NewPlayer.ogg
rm /system/media/audio/ringtones/Noises1.ogg
rm /system/media/audio/ringtones/Noises2.ogg
rm /system/media/audio/ringtones/Noises3.ogg
rm /system/media/audio/ringtones/Oberon.ogg
rm /system/media/audio/ringtones/OrganDub.ogg
rm /system/media/audio/ringtones/Orion.ogg
rm /system/media/audio/ringtones/Paradise_Island.ogg
rm /system/media/audio/ringtones/Pegasus.ogg
rm /system/media/audio/ringtones/Perseus.ogg
rm /system/media/audio/ringtones/Phobos.ogg
rm /system/media/audio/ringtones/Playa.ogg
rm /system/media/audio/ringtones/Pyxis.ogg
rm /system/media/audio/ringtones/Rasalas.ogg
rm /system/media/audio/ringtones/Revelation.ogg
rm /system/media/audio/ringtones/Rigel.ogg
rm /system/media/audio/ringtones/Ring_Classic_02.ogg
rm /system/media/audio/ringtones/Ring_Digital_02.ogg
rm /system/media/audio/ringtones/Ring_Synth_02.ogg
rm /system/media/audio/ringtones/Road_Trip.ogg
rm /system/media/audio/ringtones/Rockin.ogg
rm /system/media/audio/ringtones/RomancingTheTone.ogg
rm /system/media/audio/ringtones/Safari.ogg
rm /system/media/audio/ringtones/Savannah.ogg
rm /system/media/audio/ringtones/Scarabaeus.ogg
rm /system/media/audio/ringtones/Sceptrum.ogg
rm /system/media/audio/ringtones/Sedna.ogg
rm /system/media/audio/ringtones/Seville.ogg
rm /system/media/audio/ringtones/Sheep.ogg
rm /system/media/audio/ringtones/Shes_All_That.ogg
rm /system/media/audio/ringtones/SilkyWay.ogg
rm /system/media/audio/ringtones/SitarVsSitar.ogg
rm /system/media/audio/ringtones/Solarium.ogg
rm /system/media/audio/ringtones/SpringyJalopy.ogg
rm /system/media/audio/ringtones/Steppin_Out.ogg
rm /system/media/audio/ringtones/Terminated.ogg
rm /system/media/audio/ringtones/Testudo.ogg
rm /system/media/audio/ringtones/Themos.ogg
rm /system/media/audio/ringtones/Third_Eye.ogg
rm /system/media/audio/ringtones/Thunderfoot.ogg
rm /system/media/audio/ringtones/Titania.ogg
rm /system/media/audio/ringtones/Triton.ogg
rm /system/media/audio/ringtones/TwirlAway.ogg
rm /system/media/audio/ringtones/Umbriel.ogg
rm /system/media/audio/ringtones/UrsaMinor.ogg
rm /system/media/audio/ringtones/VeryAlarmed.ogg
rm /system/media/audio/ringtones/Vespa.ogg
rm /system/media/audio/ringtones/World.ogg
rm /system/media/audio/ringtones/Zeta.ogg

rm /system/media/audio/notifications/Adara.ogg
rm /system/media/audio/notifications/Aldebaran.ogg
rm /system/media/audio/notifications/Altair.ogg
rm /system/media/audio/notifications/Alya.ogg
rm /system/media/audio/notifications/Antares.ogg
rm /system/media/audio/notifications/Antimony.ogg
rm /system/media/audio/notifications/Arcturus.ogg
rm /system/media/audio/notifications/Argon.ogg
rm /system/media/audio/notifications/Ariel.ogg
rm /system/media/audio/notifications/Beat_Box_Android.ogg
rm /system/media/audio/notifications/Bellatrix.ogg
rm /system/media/audio/notifications/Beryllium.ogg
rm /system/media/audio/notifications/Betelgeuse.ogg
rm /system/media/audio/notifications/CaffeinneSnake.ogg
rm /system/media/audio/notifications/Canopus.ogg
rm /system/media/audio/notifications/Capella.ogg
rm /system/media/audio/notifications/Carme.ogg
rm /system/media/audio/notifications/Castor.ogg
rm /system/media/audio/notifications/Ceres.ogg
rm /system/media/audio/notifications/CetiAlpha.ogg
rm /system/media/audio/notifications/Cobalt.ogg
rm /system/media/audio/notifications/Cricket.ogg
rm /system/media/audio/notifications/CyanMail.ogg
rm /system/media/audio/notifications/DearDeer.ogg
rm /system/media/audio/notifications/Deneb.ogg
rm /system/media/audio/notifications/Doink.ogg
rm /system/media/audio/notifications/DontPanic.ogg
rm /system/media/audio/notifications/Drip.ogg
rm /system/media/audio/notifications/Electra.ogg
rm /system/media/audio/notifications/Europa.ogg
rm /system/media/audio/notifications/Flourine.ogg
rm /system/media/audio/notifications/Fomalhaut.ogg
rm /system/media/audio/notifications/Gallium.ogg
rm /system/media/audio/notifications/Heaven.ogg
rm /system/media/audio/notifications/Helium.ogg
rm /system/media/audio/notifications/Highwire.ogg
rm /system/media/audio/notifications/Hojus.ogg
rm /system/media/audio/notifications/Iapetus.ogg
rm /system/media/audio/notifications/Io.ogg
rm /system/media/audio/notifications/Iridium.ogg
rm /system/media/audio/notifications/Krypton.ogg
rm /system/media/audio/notifications/KzurbSonar.ogg
rm /system/media/audio/notifications/Lalande.ogg
rm /system/media/audio/notifications/Laser.ogg
rm /system/media/audio/notifications/Merope.ogg
rm /system/media/audio/notifications/Mira.ogg
rm /system/media/audio/notifications/moonbeam.ogg
rm /system/media/audio/notifications/Naughty.ogg
rm /system/media/audio/notifications/OnTheHunt.ogg
rm /system/media/audio/notifications/Palladium.ogg
rm /system/media/audio/notifications/pixiedust.ogg
rm /system/media/audio/notifications/pizzicato.ogg
rm /system/media/audio/notifications/Plastic_Pipe.ogg
rm /system/media/audio/notifications/Polaris.ogg
rm /system/media/audio/notifications/Pollux.ogg
rm /system/media/audio/notifications/Pong.ogg
rm /system/media/audio/notifications/Procyon.ogg
rm /system/media/audio/notifications/Proxima.ogg
rm /system/media/audio/notifications/Radon.ogg
rm /system/media/audio/notifications/Rang.ogg
rm /system/media/audio/notifications/regulus.ogg
rm /system/media/audio/notifications/Rhea.ogg
rm /system/media/audio/notifications/Rubidium.ogg
rm /system/media/audio/notifications/Salacia.ogg
rm /system/media/audio/notifications/Selenium.ogg
rm /system/media/audio/notifications/Shaula.ogg
rm /system/media/audio/notifications/sirius.ogg
rm /system/media/audio/notifications/Sirrah.ogg
rm /system/media/audio/notifications/SpaceSeed.ogg
rm /system/media/audio/notifications/Spica.ogg
rm /system/media/audio/notifications/Stone.ogg
rm /system/media/audio/notifications/Strontium.ogg
rm /system/media/audio/notifications/Syrma.ogg
rm /system/media/audio/notifications/Tada.ogg
rm /system/media/audio/notifications/Talitha.ogg
rm /system/media/audio/notifications/Tejat.ogg
rm /system/media/audio/notifications/Tethys.ogg
rm /system/media/audio/notifications/Thallium.ogg
rm /system/media/audio/notifications/Tinkerbell.ogg
rm /system/media/audio/notifications/Titan.ogg
rm /system/media/audio/notifications/tweeters.ogg
rm /system/media/audio/notifications/Upsilon.ogg
rm /system/media/audio/notifications/Vega.ogg
rm /system/media/audio/notifications/Voila.ogg
rm /system/media/audio/notifications/Xenon.ogg
rm /system/media/audio/notifications/Zirconium.ogg
;;
esac