[HD2 Android SD Development] copenhagen:
its go time

how to get a log of your shutdown:

in terminal:

logcat > /sdcard/shutdownlog.txt (and hit enter - you will not be given another terminal # prompt)

then HIT the HOME key - as to NOT QUIT terminal. you want logcat to run till the end.

press and hold end key to bring up the shutdown menu and choose either reboot or shutdown

DO NOT TOUCH ANYTHING or ill come there and eat your cat.

your device WILL shutdown/reboot.

when it comes back up you should have a nice new log file @ /sdcard/shutdownlog.txt

open it up in a text editor and look for the following:

...

I/ShutdownThread( 270): BEGIN CUSTOM SHUTDOWN SCRIPT FOR FRAZOR0X0R (dont ask... my best friend has a twisted sense of humor - easy to identify this section tho isnt it lol:cool:)

this is where we pause the OS shutdown and run our own:

I/ShutdownThread( 270): CUSTOM SCRIPT: +++ Running shutdown scripts +++

D/AudioHardwareQSD( 179): AudioHardware pcm playback is going to standby.

D/dalvikvm( 2798): GC_EXPLICIT freed 42K, 50% free 3485K/6919K, external 922K/1429K, paused 44ms

I/ShutdownThread( 270): CUSTOM SCRIPT: cannot delete non-empty directory: data/org.mhgames.jewels

I/ShutdownThread( 270): CUSTOM SCRIPT: cannot delete non-empty directory: data/org.appaware

I/ShutdownThread( 270): CUSTOM SCRIPT: cannot delete non-empty directory: data/org.adwfreak.launcher

as you can see I get this message also.. but this is just showing us that we are NOT removing stuff

that we want to save - the only stuff that ACTUALLY gets removed is extraneous files found on /sd-ext

that do NOT exist @ /data. Thinking of the /sdext partition as a mirror is the easiest way to understand this.

also keeping in mind that @ the next startup.. if there IS data @ /sdext that is NOT @ /data it will get restored....ie: an updated build first boot, a clean data.img, an accidental fat32 corruption/format.. and now the data does not exist @ /data/ . still with me? moving on

...

I/ShutdownThread( 270): CUSTOM SCRIPT: +++ Lazy unmount of /dev/block/mmcblk0p2

I/ShutdownThread( 270): CUSTOM SCRIPT: +++ Shutdown scripts complete +++

ext partition is now UNMOUNTED and unaccessable (just for safety reasons)

...

...

I/ShutdownThread( 270): Exited with error code 0

this is good.. no errors

regardless of errors however: RESUME OS SHUTDOWN

I/ShutdownThread( 270): Sending shutdown broadcast...

W/SyncManager( 270): Writing sync state before shutdown...

D/CMStats (21039): ACTION_SHUTDOWN: Setting checkedin=false

I/ShutdownThread( 270): Shutting down activity manager...

I/UsageStats( 270): Writing usage stats before shutdown...

W/BatteryStats( 270): Writing battery stats before shutdown...

W/ShutdownThread( 270): Turning off radio...

I/TelephonyRegistry( 270): notifyDataConnection: state=0 isDataConnectivityPossible=true reason=radioTurnedOff interfaceName=null networkType=3

I/ShutdownThread( 270): Waiting for Bluetooth and Radio...

D/pppd (23707): rcvd [LCP TermReq id=0x32]

...

D/pppd (23707): Script /etc/ppp/ip-down finished (pid 23989), status = 0x0

I/TelephonyRegistry( 270): notifyServiceState: 3 home null null null Unknown CSS not supported -1 -1RoamInd: -1DefRoamInd: -1EmergOnly: false

I/TelephonyRegistry( 270): notifyDataConnection: state=0 isDataConnectivityPossible=false reason=radioTurnedOff interfaceName=null networkType=0

I/ActivityManager( 270): Start proc com.android.vending for broadcast com.android.vending/.DeviceConfigurationReceiver: pid=23991 uid=10029 gids={1015, 3003}

I/ShutdownThread( 270): Radio and Bluetooth shutdown complete.

I/ShutdownThread( 270): Shutting down MountService

I/MountService( 270): Shutting down

I/PackageManager( 270): Updating external media status from mounted to unmounted

I/PackageManager( 270): Updating external media status from unmounted to unmounted

W/ShutdownThread( 270): Result code 0 from MountService.shutdown

I/ShutdownThread( 270): Rebooting, reason: null

BOOM RESTART

NEXT im gonna get you a startup log so you can see that too.