1. You want that $100.00 in your pocket or an Amazon Fire TV don't you? Well here's the deal. With our new updated look we are in desperate need of an updated logo. The 'old' one has certainly served us well, but it's time. Find all the details here: bit.ly/1q0k6Wa
  2. DroidForums.net is currently undergoing a major software upgrade. If you are experiencing any problems logging in please: Contact Us

Scripts for nightly builds

Discussion in 'Cyanogenmod' started by jeffv2, Feb 20, 2011.

  1. jeffv2
    Offline

    jeffv2 Developer Developer

    Joined:
    Dec 23, 2010
    Messages:
    1,240
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    south jersey
    here's my script for nightly builds.
    i can add anything you want. just ask

    FEATURES:

    - checks if script has been run before. ( on current build )
    - removes unneeded apps
    - changes wifi scantime
    - remaps keys ( only if you have a file on sdcard called jeffv2 "/sdcard/jeffv2" )
    - has option to change lcd density ( you must manually change the value in the script for now )
    - reboots the phone if you have /sdcard/reboot file


    put on the root of sdcard & run

    HTML:
    su
    
    . /sdcard/setup.txt
    
    HTML:
    #!/bin/bash
    #
    
    #######edit these values
    lcd=240
    wifi=90
    heap=24m
    #######
    
    file=/system/.setup
    remap=/sdcard/jeffv2
    reboot=/sdcard/reboot
    
    
    if [ -f "$file" ]; then 
    echo "no need to run twice !!!" 
    else
    sed -i 's/ro.sf.lcd_density=240/ro.sf.lcd_density=240/g' /system/build.prop
    sed -i 's/wifi.supplicant_scan_interval = 15/wifi.supplicant_scan_interval = $wifi/g' /system/build.prop
    sed -i 's/ro.telephony.call_ring.delay=3000/ro.telephony.call_ring.delay=1000/g' /system/build.prop
    sed -i 's/ro.media.dec.jpeg.memcap=20000000/ro.media.dec.jpeg.memcap=24000000/g' /system/build.prop
    sed -i 's/dalvik.vm.heapsize=24m/dalvik.vm.heapsize=$heap/g' /system/build.prop
    
    rm /system/app/Calendar.apk
    rm /system/app/CalendarProvider.apk
    rm /system/app/CarHomeLauncher.apk
    rm /system/app/GoogleCalendarSyncAdapter.apk
    rm /system/app/GoogleQuickSearchBox.apk
    rm /system/app/LatinImeTutorial.apk
    rm /system/app/LiveWallpapers.apk
    rm /system/app/LiveWallpapersPicker.apk
    rm /system/app/MagicSmokeWallpapers.apk
    rm /system/app/PicoTts.apk
    rm /system/app/Protips.apk
    rm /system/app/SetupWizard.apk
    rm /system/app/SoundRecorder.apk
    rm /system/app/TtsService.apk
    rm /system/app/VisualizationWallpapers.apk
    rm /system/app/VoiceDialer.apk
    rm /system/app/VpnServices.apk
    rm /system/app/FileManager.apk
    rm /system/app/ADWLauncher.apk
    echo  > $file
    
    if [ -f "$remap" ]; then
    sed -i 's/key 114   VOLUME_DOWN       WAKE/key 114   VOLUME_UP         WAKE/g' /system/usr/keylayout/qwerty.kl
    sed -i 's/key 114   VOLUME_DOWN       WAKE/key 114   VOLUME_UP         WAKE/g' /system/usr/keylayout/sholes-keypad.kl 
    sed -i 's/key 212   CAMERA/key 212   VOLUME_DOWN       WAKE/g' /system/usr/keylayout/qwerty.kl
    sed -i 's/key 212   CAMERA/key 212   VOLUME_DOWN       WAKE/g' /system/usr/keylayout/sholes-keypad.kl
    else 
    
    echo  > $file
    
    if [ -f "$reboot" ]
    then
    reboot
    else
    echo "thanks for using my script"
    fi
    fi
    fi
    
    Last edited: Mar 8, 2011
  2. Bear in NM
    Offline

    Bear in NM Active Member

    Joined:
    Nov 12, 2009
    Messages:
    1,389
    Likes Received:
    1
    Trophy Points:
    38
    You Linux guys, no fair:) Fox and I were discussing this earlier in the main nightly thread. He/she prefers the longer scripting like yours. I tend to break mine up, using Gscript. The definate advantage to your method is being able to use the native terminal program if you choose. Me, I gotta hit the market to get Gscript. Does help showcase why a basic terminal and file manager is stock. Options, options. And thankfully our ADB days are mostly behind us, unless you are really hard core.

    Thanks for posting your script. It actually give me a point of reference to research. WAG, sed, search and edit?????? For us windows types, the webpages with linux 101 commands and codes tend to be sorely lacking.

    Craig
  3. gambit07
    Offline

    gambit07 New Member

    Joined:
    Oct 22, 2010
    Messages:
    384
    Likes Received:
    0
    Trophy Points:
    0
    Looks good! I'm guessing I can just save this in a text file but what does the extension have to be?
    Edit: Also just curious, why do you remap your volume keys?
    Last edited: Feb 20, 2011
  4. CJM
    Online

    CJM Developer Relations Staff Member Premium Member

    Joined:
    Sep 12, 2010
    Messages:
    9,224
    Likes Received:
    498
    Trophy Points:
    83
    Location:
    Mississippi Gulf Coast
    Thanks for posting this, Jeff.

    Swyped from a Droid
  5. winner00
    Offline

    winner00 Premium Member Premium Member Developer

    Joined:
    Nov 15, 2009
    Messages:
    1,112
    Likes Received:
    10
    Trophy Points:
    0
    Location:
    Utah
    I think his up or down volume key is broken.
  6. gambit07
    Offline

    gambit07 New Member

    Joined:
    Oct 22, 2010
    Messages:
    384
    Likes Received:
    0
    Trophy Points:
    0
    Alright, I figure it's just .sh, my other question is where is data/local/bin? I opened up root explorer to try and find it but the only folders in data/local are download and tmp.
  7. gambit07
    Offline

    gambit07 New Member

    Joined:
    Oct 22, 2010
    Messages:
    384
    Likes Received:
    0
    Trophy Points:
    0
    I've also tried putting setup.sh in the local folder and CD'ing up to it to run from there but I just get setup.sh not found. Any ideas?
  8. 666ogre666
    Offline

    666ogre666 Member

    Joined:
    Feb 25, 2010
    Messages:
    583
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    New Jersey
    This script looks cool, im assuming I could remove sections and have it still run? Some of the features your remove I use and I have no need to remap and buttons.
  9. jeffv2
    Offline

    jeffv2 Developer Developer

    Joined:
    Dec 23, 2010
    Messages:
    1,240
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    south jersey
    /data/local/bin is a path that terminal emulator already has as a path, so you can drop any scripts or anything like that there.. but you have to make the folder. & I remap my keys because my volume up button is broken. So I make my camera button the volume down :)

    Sent from my Droid using Tapatalk
  10. jeffv2
    Offline

    jeffv2 Developer Developer

    Joined:
    Dec 23, 2010
    Messages:
    1,240
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    south jersey
    And yes, edit and use this to your likeing. When you run iit just type ". Setup.sh" with that extra period.

    I also added a

    If [ -f "/sdcard/reboot" ]
    Then
    Reboot
    Fi

    To the script, this. Way if the user has a blank file on the sdcard that's named reboot then the phone will reboot after running the command

    Sent from my Droid using Tapatalk
  11. iamasongnow
    Offline

    iamasongnow New Member

    Joined:
    Sep 13, 2010
    Messages:
    190
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Albany, NY
    hmm... i put the file right in /data/local/bin but terminal is saying it's not found. do i have to edit permissions? what do i type in terminal? i tried "setup.sh" and ". Setup.sh" but to no avail.
  12. gambit07
    Offline

    gambit07 New Member

    Joined:
    Oct 22, 2010
    Messages:
    384
    Likes Received:
    0
    Trophy Points:
    0
    I edited permissions and finally got it to recognize the script by using . Setup.sh, however when I run it I get a bunch of errors about files not found (some of which should be there to remove) and the wifi supplicant scan and density were not changed (doesn't look like they ran at all). This is how my file looks

  13. jeffv2
    Offline

    jeffv2 Developer Developer

    Joined:
    Dec 23, 2010
    Messages:
    1,240
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    south jersey

    You have to run su first

    Sent from my Droid using Tapatalk
  14. jeffv2
    Offline

    jeffv2 Developer Developer

    Joined:
    Dec 23, 2010
    Messages:
    1,240
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    south jersey
    I'm going to firgure out what the permissions have to be.

    Sent from my Droid using Tapatalk
  15. gambit07
    Offline

    gambit07 New Member

    Joined:
    Oct 22, 2010
    Messages:
    384
    Likes Received:
    0
    Trophy Points:
    0
    I did, I also gave it full permissions, still not working for me
  16. jeffv2
    Offline

    jeffv2 Developer Developer

    Joined:
    Dec 23, 2010
    Messages:
    1,240
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    south jersey
    When you run it you have to type ". Setup.sh" or sh setup.sh

    To set the permissions just type. " chmod 747 /data/local/bin/* "

    And you can put anything into /data/local/bin,
    I put parted, jrummys allinone script. Pretty much every script I could find that didn't come with cyanogenmod.

    Sent from my Droid using Tapatalk
  17. jeffv2
    Offline

    jeffv2 Developer Developer

    Joined:
    Dec 23, 2010
    Messages:
    1,240
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    south jersey
    Whatg terminal are you using ?, & make sure your folders in /data/local/bin aren't capitalized.

    Sent from my Droid using Tapatalk
  18. gambit07
    Offline

    gambit07 New Member

    Joined:
    Oct 22, 2010
    Messages:
    384
    Likes Received:
    0
    Trophy Points:
    0
    yep they are not capitalized and the script runs with . Setup.sh, it just won't run anything in the script, says apk's aren't there that should be there and doesn't run the wifi or dpi at all as far as I can tell. I'm using terminal emulator
  19. jeffv2
    Offline

    jeffv2 Developer Developer

    Joined:
    Dec 23, 2010
    Messages:
    1,240
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    south jersey
    Try putting it on the root of your sdcard, then use . /sdcard/setup.sh

    Sent from my Droid using Tapatalk
  20. jeffv2
    Offline

    jeffv2 Developer Developer

    Joined:
    Dec 23, 2010
    Messages:
    1,240
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    south jersey
    Works fine here, it removes the apps & chages the build.prop stuff + my keys are changed. .... ill upload my setup.sh without the remap stuff for you.

    But I got to get back to my computer first :)

    Sent from my Droid using Tapatalk
Search tags for this page
android daily build script
,
create and run a script nightly
,
daily build script
,

nightly build script

,
ro.media.dec.jpeg.memcap