[Q] no wifi no bluetooth and now ... noob error caused bootloop - Galaxy S 5 Q&A, Help & Troubleshooting

hey guys long time reader first time poster
iv been a bit of a noob
i have here a customers phone that i fixed the screen on
after booting the phone up and checking it over i find that the wifi bluetooth and google play services are all in trouble and wont start
wifi is greyed out bluetooth switches itself off and google play services keep crashing
i assume the phone has recently got the lollipop update and that is whats causing the issues
i rooted the phone using skipsofts toolkit and all the recommended options twrp and so on phone rooted fine
done a bit of messing around with wifi files and stuff using guides online but none of this worked
then the brainstorm
try twrp recovery ... it may have answers
found what i thought was my answer
FIX PERMISSIONS .... ahh yes i thought ..... i permissions fault after the update ... whats the harm in trying anyway ??
thats when the phone become a nice soft brick
congratulations you have successfully entered bootloop mode
i know the bootloop has been caused by me clicking fix permissions on a perfectly working phone
the question is do any of you know how to reverse the fix permissions or revert to previous permissions ??
i know theres ways to recover the phone to a useable state but from what iv seen this means losing data
due to this being a customers phone and me being the idiot thats put it in a bootloop not her i dont want to lose a single user data byte !!
a big ask i know but if anyone can make miracles happen its the xda team u guys have saved my bacon more than once
should mention i had this same phone in about a month ago with another broken screen and wifi and bluetooth was working fine then
phone is sm-g900f
stock rom 5.0
build boa3
twrp 2.7.1.0 used
grabbed logcat info ( adb is enabled at samsung boot screen ... how lucky )
--------- beginning of main
W/asset ( 7518): Asset path /system/priv-app/GoogleServicesFramework/GoogleServicesFramework.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/CloudAgent/CloudAgent.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/DCMProvider/DCMProvider.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/ContextProvider/ContextProvider.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/DefaultContainerService/DefaultContainerService.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/DeviceTest/DeviceTest.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/DiagMonAgent/DiagMonAgent.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/DocumentService/DocumentService.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/DirectShareManager/DirectShareManager.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/EasyLauncher2/EasyLauncher2.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/FmmDM/FmmDM.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/FmmDS/FmmDS.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/GoogleBackupTransport/GoogleBackupTransport.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/GoogleOneTimeInitializer/GoogleOneTimeInitializer.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/GooglePartnerSetup/GooglePartnerSetup.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/HealthService/HealthService.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/Kies/Kies.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/LogsProvider/LogsProvider.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/ManagedProvisioning/ManagedProvisioning.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/MmsService/MmsService.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/NoiseField/NoiseField.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/OutOfFocusViewer_WQHD_K/OutOfFocusViewer_WQHD_K.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/PCWClientS18/PCWClientS18.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/PayWithPaypal/PayWithPaypal.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/PhaseBeam/PhaseBeam.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/FingerprintService/FingerprintService.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/ProxyHandler/ProxyHandler.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/SHealth3_5/SHealth3_5.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/SOAgent/SOAgent.apk is neither a directory nor file (type=0).
I/bootchecker( 7422): Sleep for 8 minutes
I/art ( 7518): DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/arm/[email protected]@[email protected]@classes.dex' for file location '/system/priv-app/SamsungLinkPlatform/SamsungLinkPlatform.apk': Failed to open oat filename for reading: No such file or directory
I/art ( 7518): DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/arm/[email protected]@[email protected][email protected]' for file location '/system/priv-app/SamsungApps_K/SamsungApps_K.apk': Failed to open oat filename for reading: No such file or directory
W/asset ( 7518): Asset path /system/priv-app/SNS/SNS.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/SamsungBilling/SamsungBilling.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/SecContactsProvider/SecContactsProvider.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/SecTelephonyProvider_Candy/SecTelephonyProvider_Candy.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/SecWallpaperPicker/SecWallpaperPicker.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/SecMediaProvider/SecMediaProvider.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/Tag/Tag.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/VoiceNote/VoiceNote.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/WallpaperCropper/WallpaperCropper.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/intelligenceservice/intelligenceservice.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/sCloudDataRelay/sCloudDataRelay.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/sCloudDataSync/sCloudDataSync.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/sCloudSyncCalendar/sCloudSyncCalendar.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/sCloudSyncContacts/sCloudSyncContacts.apk is neither a directory nor file (type=0).
I/art ( 7518): DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/arm/[email protected]@[email protected][email protected]' for file location '/system/priv-app/SPPPushClient_Prod/SPPPushClient_Prod.apk': Failed to open oat filename for reading: No such file or directory
W/asset ( 7518): Asset path /system/priv-app/sCloudSyncMemo/sCloudSyncMemo.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/Telecom/Telecom.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/sCloudSyncSNote3/sCloudSyncSNote3.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/SharedStorageBackup/SharedStorageBackup.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.whatsapp-2/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.android.vending-2/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.google.android.videos-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.android.chrome-2/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/flipboard.app-2/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.dsi.ant.service.socket-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /system/priv-app/wssyncmlnps/wssyncmlnps.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.google.android.apps.plus-2/base.apk is neither a directory nor file (type=0).
I/art ( 7518): DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/arm/[email protected]@[email protected]@classes.dex' for file location '/system/priv-app/Phonesky/Phonesky.apk': Failed to open oat filename for reading: No such file or directory
W/asset ( 7518): Asset path /data/app/com.sec.app.samsungprintservice-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.google.android.apps.books-2/base.apk is neither a directory nor file (type=0).
W/ResourceType( 7518): ResTable_typeSpec entry count inconsistent: given 2, previously 1633
W/asset ( 7518): Asset path /data/app/com.samsung.android.app.mirrorlink-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/uk.co.o2.android.myo2-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/tv.peel.smartremote-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.samsung.SMT-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.sec.spp.push-1/base.apk is neither a directory nor file (type=0).
W/ResourceType( 7518): ResTable_typeSpec entry count inconsistent: given 1, previously 1633
W/asset ( 7518): Asset path /data/app/com.google.android.webview-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.mobeam.barcodeService-1/base.apk is neither a directory nor file (type=0).
I/art ( 7518): DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/arm/[email protected]@[email protected]@classes.dex' for file location '/system/priv-app/MyGalaxyStub.2.0.3/MyGalaxyStub.2.0.3.apk': Failed to open oat filename for reading: No such file or directory
I/art ( 7518): DexFile_isDexOptNeeded failed to open oat file '/system/priv-app/MyGalaxyStub.2.0.3/arm/MyGalaxyStub.2.0.3.odex' for file location '/system/priv-app/MyGalaxyStub.2.0.3/MyGalaxyStub.2.0.3.apk': Failed to open oat filename for reading: No such file or directory
W/asset ( 7518): Asset path /data/app/com.qihoo.security-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.samsunguk.mygalaxy-2/base.apk is neither a directory nor file (type=0).
I/art ( 7518): DexFile_isDexOptNeeded failed to open oat file '/data/dalvik-cache/arm/[email protected]@[email protected]@classes.dex' for file location '/system/priv-app/Velvet/Velvet.apk': Failed to open oat filename for reading: No such file or directory
W/asset ( 7518): Asset path /data/app/com.pinterest-2/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.google.android.youtube-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.estrongs.android.pop-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.dropbox.android-2/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.sec.android.iap-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.google.android.gm-2/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.google.android.marvin.talkback-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.dsi.ant.plugins.antplus-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.google.android.apps.docs-2/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.google.android.play.games-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.google.android.talk-2/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.google.android.apps.maps-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.rbs.mobile.android.ubn-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.google.android.music-2/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.google.android.tts-2/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.yahoo.mobile.client.android.mail-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.google.android.googlequicksearchbox-2/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.samsung.android.sdk.samsunglink-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.scoompa.collagemaker-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.infraware.polarisviewer5-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.roidapp.photogrid-1/base.apk is neither a directory nor file (type=0).
W/ResourceType( 7518): ResTable_typeSpec entry count inconsistent: given 1, previously 1633
W/asset ( 7518): Asset path /data/app/air.uk.co.bbc.android.mediaplayer-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.lu.barcodescannerbanner-1/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.brilliantlabs.solitaire-2/base.apk is neither a directory nor file (type=0).
W/asset ( 7518): Asset path /data/app/com.google.android.apps.docs.editors.docs-2/base.apk is neither a directory nor file (type=0).
I/QCOM PowerHAL( 7518): QCOM power HAL initing.
I/QCOM PowerHAL( 7518): Dual core online
W/libsuspend( 7518): Error writing 'on' to /sys/power/state: Invalid argument
I/libsuspend( 7518): Selected wakeup count
D/MISC PowerHAL( 7518): sysfs_write +: /sys/class/power_supply/battery/lcd: 1
D/MISC PowerHAL( 7518): sysfs_write -: /sys/class/power_supply/battery/lcd: 1
I/QCOM PowerHAL( 7518): Got set_interactive hint
D/EnterprisePartitionManager( 7518): createConnector() for socket epm
W/SEAMS ( 7518): Service is null
W/SEAMS ( 7518): Service is null
D/EnterprisePartitionManager( 7518): onDaemonConnected() for socket epm
I/PersonaManagerService( 7518): Pruning of unwanted persona has started...
I/PersonaManagerService( 7518): Pruning mPersonas's size is 0
I/PersonaManagerService( 7518): <init> adding PersonaPolicyManagerService
looking bad ... can post more if required very small snippet

Seeing as almost every error is saying files dont exist, seems you may have managed to wipe /system or something.
Sent from my Twi5ted SM-G900A using Tapatalk

Rakuu said:
Seeing as almost every error is saying files dont exist, seems you may have managed to wipe /system or something.
Sent from my Twi5ted SM-G900A using Tapatalk
Click to expand...
Click to collapse
its a permissions error.
system has a low permission level and as such cant see its own files and results in system finding nothing it needs to be able to boot
it is a curable situation
just need the right man/woman to see the post
i have adb access
i have cygwin installed on the pc and all links up and reads fine
can pull and push files all day long
just need to set the permissions

killabyte0 said:
its a permissions error.
system has a low permission level and as such cant see its own files and results in system finding nothing it needs to be able to boot
it is a curable situation
just need the right man/woman to see the post
i have adb access
i have cygwin installed on the pc and all links up and reads fine
can pull and push files all day long
just need to set the permissions
Click to expand...
Click to collapse
I'm pretty sure itd be saying "permission denied" if they had improper perms, if you say you can push and pull files though i'll take your word for it, can you not just set the permissions with adb?
Sent from my Twi5ted SM-G900A using Tapatalk

Rakuu said:
I'm pretty sure itd be saying "permission denied" if they had improper perms, if you say you can push and pull files though i'll take your word for it, can you not just set the permissions with adb?
[QRCODE][/QRCODE]
Sent from my Twi5ted SM-G900A using Tapatalk
Click to expand...
Click to collapse
that is the hope yes i know it can be done but im unsure how to do it or if it would even be a viable option ie if i had to do every file manually it would be pointless and also i dont want to mess with things i dont know about. iv done enough damage already my linux background is limited

killabyte0 said:
that is the hope yes i know it can be done but im unsure how to do it or if it would even be a viable option ie if i had to do every file manually it would be pointless and also i dont want to mess with things i dont know about. iv done enough damage already my linux background is limited
Click to expand...
Click to collapse
The fix permissions wouldnt have done this unless the recovery was very broken, you had to have done something else. I just made a file on my server and changed the perms to 000 and tried to open it and got "permission denied" so no, those files are not there, it would say permission denied no matter how bad the permissions are.
Sent from my Twi5ted SM-G900A using Tapatalk

Rakuu said:
The fix permissions wouldn't have done this unless the recovery was very broken, you had to have done something else. I just made a file on my server and changed the perms to 000 and tried to open it and got "permission denied" so no, those files are not there, it would say permission denied no matter how bad the permissions are.
Sent from my Twi5ted SM-G900A using Tapatalk
Click to expand...
Click to collapse
lol must be something wrong with my eyes then because im looking at the files
as i said before its a permissions error
the system is not saying the files are missing
its saying each file is not a directory or a file
there has been a class change somewhere in relation to permissions
i understand you are trying to help me but please stop if you dont know what you are talking about
all hope is not lost and my files are not there ... if i was joe bloggs who knew no better you would of just had me delete all the files that are there and perfectly useable once permissions are repaired
fyi a permissions change alone can never delete a file

killabyte0 said:
lol must be something wrong with my eyes then because im looking at the files
as i said before its a permissions error
the system is not saying the files are missing
its saying each file is not a directory or a file
there has been a class change somewhere in relation to permissions
i understand you are trying to help me but please stop if you dont know what you are talking about
all hope is not lost and my files are not there ... if i was joe bloggs who knew no better you would of just had me delete all the files that are there and perfectly useable once permissions are repaired
fyi a permissions change alone can never delete a file
Click to expand...
Click to collapse
Yes i know, i mentioner earlier i run a server, i think i know what i'm talking about. If the files its saying arent there are there, then just do a recursive chmod through adb on the directories and then manually clean up whatever else needs it. If I were you i'd make a nandroid, wipe and reflash, then pull what you need from the nandroid.
Sent from my Twi5ted SM-G900A using Tapatalk

Rakuu said:
Yes i know, i mentioner earlier i run a server, i think i know what i'm talking about. If the files its saying arent there are there, then just do a recursive chmod through adb on the directories and then manually clean up whatever else needs it. If I were you i'd make a nandroid, wipe and reflash, then pull what you need from the nandroid.
Sent from my Twi5ted SM-G900A using Tapatalk
Click to expand...
Click to collapse
chmod to what level ? 666 777 775 ?
whats the adb command to recursive chmod a directory and how do i point to it ?
is it just abd chmod 777 /data ?
this is why i need help dont want to go screwing whit things i know nothing about and cause more damage

killabyte0 said:
chmod to what level ? 666 777 775 ?
whats the adb command to recursive chmod a directory and how do i point to it ?
is it just abd chmod 777 /data ?
this is why i need help dont want to go screwing whit things i know nothing about and cause more damage
Click to expand...
Click to collapse
Just realized, the fix permissions action in twrp doesnt actually even mess with file permissions, it fixes missmatched UIDs. You'want to do
Code:
adb shell chmod -R XXX /dir
Replacing xxx with the octal and /dir with the directory. Like i said though, the system says they arent there, no permissions error will make them invisible to the system, i would really just do a nandroid and reflash then pull what you need from the nandroid.
Sent from my Twi5ted SM-G900A using Tapatalk

Rakuu said:
Just realized, the fix permissions action in twrp doesnt actually even mess with file permissions, it fixes missmatched UIDs. You'want to do
Code:
adb shell chmod -R XXX /dir
Replacing xxx with the octal and /dir with the directory. Like i said though, the system says they arent there, no permissions error will make them invisible to the system, i would really just do a nandroid and reflash then pull what you need from the nandroid.
Sent from my Twi5ted SM-G900A using Tapatalk
Click to expand...
Click to collapse
humm well if this is just a uid error is it possible to boot the phone as root user ?

killabyte0 said:
humm well if this is just a uid error is it possible to boot the phone as root user ?
Click to expand...
Click to collapse
That wouldnt fix anything. I'm telling you, do what you canto back up everything you can off the phone and reflash.
Sent from my Twi5ted SM-G900A using Tapatalk

mount /data partition and execute this command.
find /data -type d -exec chmod 775 {} \;
find /data -type f -exec chmod 644 {} \;
Or you can just reverse the fix permission script.
Since lollipop fix permission has been outdated by SELinux.
Code:
#! /system/bin/sh
#
# Warning: if you want to run this script in cm-recovery change the above to #!/sbin/sh
#
# fix_permissions - fixes permissions on Android data directories after upgrade
# [email protected]
#
# thanks to: http://blog.elsdoerfer.name/2009/05/25/android-fix-package-uid-mismatches/
#
# v1.1 - work with protected apps
# v1.2 - chown all the subfolders different than 'lib' and the single files [by ankn]
# v1.3 - support for the packages with userShareId; added parameter to support the remount
# mechanism in images different than Cyanogen [by ankn]
# v1.4 - fix the file and directory permissions as well [by smeat]
# v1.5 - integrate code by thenefield for logging and only making changes if needed [by smeat and thenefield]
# v1.6 - Don't mess with user's sdcard, log to it if present or to /data/data/ if not present [by farmatito]
# v1.7 - Simplify and improve readability of script a little, enforce safe default permissions where possible [by farmatito]
# v1.8 - Make sure we choose busybox applets when system binaries with the same name are available [by farmatito]
# v1.9 - reintegrated "chown all the subfolders different than 'lib' and the single files [by ankn]", fixed private app GID [by smeat]
# v1.10 - chmod and chown /data/data/$PACKAGE/lib as well [by smeat]
# v1.11 - logging of /data/data/$PACKAGE/lib, check if /data/data/$PACKAGE/lib needs be changed, fixed ls on chown [by smeat]
# v1.12 - reduced the number of finds down to one, chown and chmod actions reduced to a single loop, bug fixes and code clean up [by smeat]
# v1.13 - Minor Clean up [by farmatito]
# v1.14 - remove additional file checks in the chmod loop [by smeat]
# v1.15 - Apply correct ownership and permissions to the apks. [by farmatito]
# v1.16 - very minor cleanups, changed all command subsitutions to be new style [by smeat]
# v1.17 - Print version [by farmatito]
# v1.18 - print what app fix_permissions is working on [by smeat]
# v1.19 - Improve debug info [by farmatito]
# v1.20 - print what app fix_permissions is working on to the log as well [by smeat]
# v1.21 - Handle filenames with spaces correctly - fix version numbering - echo is a busybox applet [by farmatito]
# v1.22 - [ is a busybox applet when android shell is used [by farmatito]
# v1.23 - chmod, cat, mount and umount are busybox applets as well, make sure drives are mounted
# run nearly unchanged in recovery/ROM [by smeat]
# v1.24 - Minor cosmetic fix.
# v1.25 - Remove debug switch (needs getopt) add switch to remove stale data dirs of uninstalled apk packages. [by farmatito]
# v1.26 - Autodetect on which device /system is. [by farmatito]
# v1.27 - Don't complain if we can't remount /system ro and other minor fixes
# v1.28 - Fix mount rw /system and other minor fixes
# v1.29 - Fix some broken tests
VERSION="1.29"
# Turn debug on by uncommenting it in this script,
# by setting DEBUG=1 on the commandline, e.g.
# DEBUG=1 ./fix_permissions
# or by exporting DEBUG=1 before you run the script, e.g.
# export DEBUG=1
# ./fix_permissions
#DEBUG="1"
UID_MSG="Changing user ownership for:"
GID_MSG="Changing group ownership for:"
PERM_MSG="Changing permissions for:"
ECHO="busybox echo"
GREP="busybox grep"
EGREP="busybox egrep"
CAT="busybox cat"
CHOWN="busybox chown"
CHMOD="busybox chmod"
MOUNT="busybox mount"
UMOUNT="busybox umount"
CUT="busybox cut"
FIND="busybox find"
LS="busybox ls"
TR="busybox tr"
TEE="busybox tee"
TEST="busybox test"
SED="busybox sed"
RM="busybox rm"
CODEPATH=""
UID=""
GID=""
PACKAGE=""
REMOVE="0"
if $TEST "$1" = "-h"; then
$ECHO "Usage $0 [OPTIONS]"
$ECHO " -r remove stale data directories"
$ECHO " of uninstalled packages"
$ECHO " -V print version"
$ECHO " -h this help"
elif $TEST "$1" = "-V"; then
$ECHO "$0 $VERSION"
else
if $TEST "$1" = "-r"; then
REMOVE="1"
fi
if $TEST $( $GREP -c " /system " "/proc/mounts" ) -ne "0"; then
DEVICE=$( $GREP " /system " "/proc/mounts" | $CUT -d ' ' -f1 )
if $TEST "x$DEBUG" = "x1"; then
$ECHO "/system mounted on $DEVICE"
fi
if $TEST $( $GREP " /system " "/proc/mounts" | $GREP -c " ro " ) -ne "0"; then
$MOUNT -o remount,rw $DEVICE /system
SYSREMOUNT="1"
fi
else
$MOUNT /system > /dev/null 2>&1
SYSMOUNT="1"
fi
if $TEST $( $GREP -c " /data " "/proc/mounts" ) -eq "0"; then
$MOUNT /data > /dev/null 2>&1
DATAMOUNT="1"
fi
if $TEST -e /dev/block/mmcblk0p2 && $TEST $( $GREP -c " /system/sd " "/proc/mounts" ) -eq "0"; then
$MOUNT /system/sd > /dev/null 2>&1
SYSSDMOUNT="1"
fi
if $TEST $( $MOUNT | $GREP -c /sdcard ) -eq "0"; then
LOG_FILE="/data/fix_permissions.log"
else
LOG_FILE="/sdcard/fix_permissions.log"
fi
if $TEST ! -e "$LOG_FILE"; then
> $LOG_FILE
fi
$ECHO "Starting fix_permissions $VERSION $( date +"%m-%d-%Y %H:%M:%S" )" | $TEE -a $LOG_FILE
$CAT /data/system/packages.xml | $GREP "^<package" | $GREP serId | $GREP -v framework-res.apk | while read line; do
for i in $( $ECHO $line | $TR " " "\n" ); do
if $TEST $i = "<package"; then
CODEPATH=""
PACKAGE=""
UID=""
GID=""
elif ( $ECHO $i | $GREP "^codePath" > /dev/null ); then
CODEPATH=$( $ECHO $i | $CUT -d '"' -f 2 )
APPDIR0=$( $ECHO "$CODEPATH" | $CUT -d '/' -f 2 )
APPDIR1=$( $ECHO "$CODEPATH" | $CUT -d '/' -f 3 )
APPDIR2=$( $ECHO "$CODEPATH" | $CUT -d '/' -f 4 )
elif ( $ECHO $i | $GREP "^name" > /dev/null ); then
PACKAGE=$( $ECHO $i | $CUT -d '"' -f 2 )
elif ( $ECHO $i | $GREP "^userId" > /dev/null ); then
UID=$( $ECHO $i | $CUT -d '"' -f 2 )
GID=$UID
elif ( $ECHO $i | $GREP "^sharedUserId" > /dev/null ); then
UID=$( $ECHO $i | $CUT -d '"' -f 2 );
GID=$UID
fi
done
if $TEST "x$DEBUG" = "x1"; then
$ECHO "$CODEPATH $APPDIR0/$APPDIR1/$APPDIR2 $UID:$GID" | $TEE -a $LOG_FILE
else
$ECHO "Checking permissions for: $PACKAGE" | $TEE -a $LOG_FILE
fi
if $TEST -e "$CODEPATH"; then
OLD_UID=$( $LS -ln "$CODEPATH" | $TR -s ' ' | $CUT -d ' ' -f3 )
OLD_GID=$( $LS -ln "$CODEPATH" | $TR -s ' ' | $CUT -d ' ' -f4 )
if $TEST "$APPDIR0" = "system"; then
if $TEST "$OLD_UID" -ne "0"; then
$ECHO "$UID_MSG $CODEPATH from '$OLD_UID' to '0'" | $TEE -a $LOG_FILE
$CHOWN 0 "$CODEPATH"
fi
if $TEST "$OLD_GID" -ne "0"; then
$ECHO "$GID_MSG $CODEPATH from '$OLD_GID' to '0'" | $TEE -a $LOG_FILE
$CHOWN :0 "$CODEPATH"
fi
chmod 644 "$CODEPATH"
elif $TEST "$APPDIR0" = "data"; then
if $TEST "$APPDIR1" = "app"; then
if $TEST "$OLD_UID" -ne "1000"; then
$ECHO "$UID_MSG $CODEPATH from '$OLD_UID' to '1000'" | $TEE -a $LOG_FILE
$CHOWN 1000 "$CODEPATH"
fi
if $TEST "$OLD_GID" -ne "1000"; then
$ECHO "$GID_MSG $CODEPATH from '$OLD_GID' to '1000'" | $TEE -a $LOG_FILE
$CHOWN :1000 "$CODEPATH"
fi
chmod 644 "$CODEPATH"
elif $TEST "$APPDIR1" = "app-private"; then
if $TEST "$OLD_UID" -ne "1000"; then
$ECHO "$UID_MSG $CODEPATH from '$OLD_UID' to '1000'" | $TEE -a $LOG_FILE
$CHOWN 1000 "$CODEPATH"
fi
if $TEST "$OLD_GID" -ne "$GID"; then
$ECHO "$GID_MSG $CODEPATH from '$OLD_GID' to '$GID'" | $TEE -a $LOG_FILE
$CHOWN :$GID "$CODEPATH"
fi
chmod 640 "$CODEPATH"
fi
fi
if $TEST -d "/data/data/$PACKAGE"; then
OLD_UID=$( $LS -ldn "/data/data/$PACKAGE" | $TR -s ' ' | $CUT -d ' ' -f3 )
OLD_GID=$( $LS -ldn "/data/data/$PACKAGE" | $TR -s ' ' | $CUT -d ' ' -f4 )
if $TEST "$OLD_UID" -ne "$UID"; then
$ECHO "$UID_MSG /data/data/$PACKAGE from '$OLD_UID' to '$UID'" | $TEE -a $LOG_FILE
$CHOWN $UID "/data/data/$PACKAGE"
fi
if $TEST "$OLD_GID" -ne "$GID"; then
$ECHO "$GID_MSG /data/data/$PACKAGE from '$OLD_GID' to '$GID'" | $TEE -a $LOG_FILE
$CHOWN :$GID "/data/data/$PACKAGE"
fi
chmod 755 "/data/data/$PACKAGE"
fi
if $TEST -d "/data/data/$PACKAGE/lib"; then
OLD_UID=$( $LS -ldn "/data/data/$PACKAGE/lib" | $TR -s ' ' | $CUT -d ' ' -f3 )
OLD_GID=$( $LS -ldn "/data/data/$PACKAGE/lib" | $TR -s ' ' | $CUT -d ' ' -f4 )
if $TEST "$OLD_UID" -ne "1000"; then
$ECHO "$UID_MSG /data/data/$PACKAGE/lib from '$OLD_UID' to '1000'" | $TEE -a $LOG_FILE
$CHOWN 1000 "/data/data/$PACKAGE/lib"
fi
if $TEST "$OLD_GID" -ne "1000"; then
$ECHO "$GID_MSG /data/data/$PACKAGE/lib from '$OLD_GID' to '1000'" | $TEE -a $LOG_FILE
$CHOWN :1000 "/data/data/$PACKAGE/lib"
fi
chmod 755 "/data/data/$PACKAGE/lib"
fi
for package_dir in $( $LS "/data/data/$PACKAGE" ); do
if $TEST -d "/data/data/$PACKAGE/$package_dir"; then
$FIND "/data/data/$PACKAGE/$package_dir" ! -name lib\* | while read entry; do
if $TEST "x$DEBUG" = "x1"; then
$ECHO "'$entry'" | $TEE -a $LOG_FILE
fi
if $TEST -d "$entry"; then
LS_OUT=$( $LS -ldn "$entry" | $TR -s ' ' | $CUT -d ' ' -f 1-4 )
OLD_UID=$( $ECHO $LS_OUT | $CUT -d ' ' -f 3 )
OLD_GID=$( $ECHO $LS_OUT | $CUT -d ' ' -f 4 )
OLD_PERM=$( $ECHO $LS_OUT | $CUT -c2-10 )
IS_DIRECTORY="1"
else
LS_OUT=$( $LS -ln "$entry" | $TR -s ' ' | $CUT -d ' ' -f 1-4 )
OLD_UID=$( $ECHO $LS_OUT | $CUT -d ' ' -f 3 )
OLD_GID=$( $ECHO $LS_OUT | $CUT -d ' ' -f 4 )
OLD_PERM=$( $ECHO $LS_OUT | $CUT -c2-10 )
IS_DIRECTORY="0"
fi
if $TEST "$OLD_UID" -ne "$UID"; then
$ECHO "$UID_MSG $entry from '$OLD_UID' to '$UID'" | $TEE -a $LOG_FILE
$CHOWN $UID "$entry"
fi
if $TEST "$OLD_GID" -ne "$GID"; then
$ECHO "$GID_MSG $entry from '$OLD_GID' to '$GID'" | $TEE -a $LOG_FILE
$CHOWN :$GID "$entry"
fi
if $TEST "$IS_DIRECTORY" -eq "0"; then
if $TEST $( $ECHO "$entry" | $EGREP -c "/shared_prefs|/databases" ) != 0 \
&& $TEST "$OLD_PERM" != "rw-rw----"; then
$ECHO "$PERM_MSG $entry from $OLD_PERM to rw-rw---- (660)" | $TEE -a $LOG_FILE
chmod 660 "$entry"
elif $TEST $( $ECHO "$entry" | $EGREP -c "/cache/" ) != 0 \
&& $TEST "$OLD_PERM" != "rw-------"; then
$ECHO "$PERM_MSG $entry from $OLD_PERM to rw------- (600)" | $TEE -a $LOG_FILE
chmod 600 "$entry"
fi
fi
if $TEST "$IS_DIRECTORY" -eq "1"; then
if $TEST $( $ECHO "$entry" | $EGREP -c "/shared_prefs|/databases|/cache" ) != 0 \
&& $TEST "$OLD_PERM" != "rwxrwx--x"; then
$ECHO "$PERM_MSG $entry from $OLD_PERM to rwxrwx--x (771)" | $TEE -a $LOG_FILE
chmod 771 "$entry"
fi
fi
done
fi
done
else
$ECHO "$CODEPATH does not exist. Reinstall." | $TEE -a $LOG_FILE
if $TEST $REMOVE -eq "1" ; then
if $TEST -d /data/data/$PACKAGE ; then
$ECHO "Removing stale dir /data/data/$PACKAGE" | $TEE -a $LOG_FILE
$RM -R /data/data/$PACKAGE
fi
fi
fi
done
if $TEST "x$SYSREMOUNT" = "x1"; then
$MOUNT -o remount,ro $DEVICE /system > /dev/null 2>&1
fi
if $TEST "x$SYSSDMOUNT" = "x1"; then
$UMOUNT /system/sd > /dev/null 2>&1
fi
if $TEST "x$SYSMOUNT" = "x1"; then
$UMOUNT /system > /dev/null 2>&1
fi
if $TEST "x$DATAMOUNT" = "x1"; then
$UMOUNT /data > /dev/null 2>&1
fi
$ECHO "fix_permissions $VERSION has completed $( date +"%m-%d-%Y %H:%M:%S" )" | $TEE -a $LOG_FILE
fi

Riyal said:
mount /data partition and execute this command.
find /data -type d -exec chmod 775 {} \;
find /data -type f -exec chmod 644 {} \;
Or you can just reverse the fix permission script.
Since lollipop fix permission has been outdated by SELinux.
Code:
#! /system/bin/sh
#
# Warning: if you want to run this script in cm-recovery change the above to #!/sbin/sh
#
# fix_permissions - fixes permissions on Android data directories after upgrade
# [email protected]
#
# thanks to: http://blog.elsdoerfer.name/2009/05/25/android-fix-package-uid-mismatches/
#
# v1.1 - work with protected apps
# v1.2 - chown all the subfolders different than 'lib' and the single files [by ankn]
# v1.3 - support for the packages with userShareId; added parameter to support the remount
# mechanism in images different than Cyanogen [by ankn]
# v1.4 - fix the file and directory permissions as well [by smeat]
# v1.5 - integrate code by thenefield for logging and only making changes if needed [by smeat and thenefield]
# v1.6 - Don't mess with user's sdcard, log to it if present or to /data/data/ if not present [by farmatito]
# v1.7 - Simplify and improve readability of script a little, enforce safe default permissions where possible [by farmatito]
# v1.8 - Make sure we choose busybox applets when system binaries with the same name are available [by farmatito]
# v1.9 - reintegrated "chown all the subfolders different than 'lib' and the single files [by ankn]", fixed private app GID [by smeat]
# v1.10 - chmod and chown /data/data/$PACKAGE/lib as well [by smeat]
# v1.11 - logging of /data/data/$PACKAGE/lib, check if /data/data/$PACKAGE/lib needs be changed, fixed ls on chown [by smeat]
# v1.12 - reduced the number of finds down to one, chown and chmod actions reduced to a single loop, bug fixes and code clean up [by smeat]
# v1.13 - Minor Clean up [by farmatito]
# v1.14 - remove additional file checks in the chmod loop [by smeat]
# v1.15 - Apply correct ownership and permissions to the apks. [by farmatito]
# v1.16 - very minor cleanups, changed all command subsitutions to be new style [by smeat]
# v1.17 - Print version [by farmatito]
# v1.18 - print what app fix_permissions is working on [by smeat]
# v1.19 - Improve debug info [by farmatito]
# v1.20 - print what app fix_permissions is working on to the log as well [by smeat]
# v1.21 - Handle filenames with spaces correctly - fix version numbering - echo is a busybox applet [by farmatito]
# v1.22 - [ is a busybox applet when android shell is used [by farmatito]
# v1.23 - chmod, cat, mount and umount are busybox applets as well, make sure drives are mounted
# run nearly unchanged in recovery/ROM [by smeat]
# v1.24 - Minor cosmetic fix.
# v1.25 - Remove debug switch (needs getopt) add switch to remove stale data dirs of uninstalled apk packages. [by farmatito]
# v1.26 - Autodetect on which device /system is. [by farmatito]
# v1.27 - Don't complain if we can't remount /system ro and other minor fixes
# v1.28 - Fix mount rw /system and other minor fixes
# v1.29 - Fix some broken tests
VERSION="1.29"
# Turn debug on by uncommenting it in this script,
# by setting DEBUG=1 on the commandline, e.g.
# DEBUG=1 ./fix_permissions
# or by exporting DEBUG=1 before you run the script, e.g.
# export DEBUG=1
# ./fix_permissions
#DEBUG="1"
UID_MSG="Changing user ownership for:"
GID_MSG="Changing group ownership for:"
PERM_MSG="Changing permissions for:"
ECHO="busybox echo"
GREP="busybox grep"
EGREP="busybox egrep"
CAT="busybox cat"
CHOWN="busybox chown"
CHMOD="busybox chmod"
MOUNT="busybox mount"
UMOUNT="busybox umount"
CUT="busybox cut"
FIND="busybox find"
LS="busybox ls"
TR="busybox tr"
TEE="busybox tee"
TEST="busybox test"
SED="busybox sed"
RM="busybox rm"
CODEPATH=""
UID=""
GID=""
PACKAGE=""
REMOVE="0"
if $TEST "$1" = "-h"; then
$ECHO "Usage $0 [OPTIONS]"
$ECHO " -r remove stale data directories"
$ECHO " of uninstalled packages"
$ECHO " -V print version"
$ECHO " -h this help"
elif $TEST "$1" = "-V"; then
$ECHO "$0 $VERSION"
else
if $TEST "$1" = "-r"; then
REMOVE="1"
fi
if $TEST $( $GREP -c " /system " "/proc/mounts" ) -ne "0"; then
DEVICE=$( $GREP " /system " "/proc/mounts" | $CUT -d ' ' -f1 )
if $TEST "x$DEBUG" = "x1"; then
$ECHO "/system mounted on $DEVICE"
fi
if $TEST $( $GREP " /system " "/proc/mounts" | $GREP -c " ro " ) -ne "0"; then
$MOUNT -o remount,rw $DEVICE /system
SYSREMOUNT="1"
fi
else
$MOUNT /system > /dev/null 2>&1
SYSMOUNT="1"
fi
if $TEST $( $GREP -c " /data " "/proc/mounts" ) -eq "0"; then
$MOUNT /data > /dev/null 2>&1
DATAMOUNT="1"
fi
if $TEST -e /dev/block/mmcblk0p2 && $TEST $( $GREP -c " /system/sd " "/proc/mounts" ) -eq "0"; then
$MOUNT /system/sd > /dev/null 2>&1
SYSSDMOUNT="1"
fi
if $TEST $( $MOUNT | $GREP -c /sdcard ) -eq "0"; then
LOG_FILE="/data/fix_permissions.log"
else
LOG_FILE="/sdcard/fix_permissions.log"
fi
if $TEST ! -e "$LOG_FILE"; then
> $LOG_FILE
fi
$ECHO "Starting fix_permissions $VERSION $( date +"%m-%d-%Y %H:%M:%S" )" | $TEE -a $LOG_FILE
$CAT /data/system/packages.xml | $GREP "^<package" | $GREP serId | $GREP -v framework-res.apk | while read line; do
for i in $( $ECHO $line | $TR " " "\n" ); do
if $TEST $i = "<package"; then
CODEPATH=""
PACKAGE=""
UID=""
GID=""
elif ( $ECHO $i | $GREP "^codePath" > /dev/null ); then
CODEPATH=$( $ECHO $i | $CUT -d '"' -f 2 )
APPDIR0=$( $ECHO "$CODEPATH" | $CUT -d '/' -f 2 )
APPDIR1=$( $ECHO "$CODEPATH" | $CUT -d '/' -f 3 )
APPDIR2=$( $ECHO "$CODEPATH" | $CUT -d '/' -f 4 )
elif ( $ECHO $i | $GREP "^name" > /dev/null ); then
PACKAGE=$( $ECHO $i | $CUT -d '"' -f 2 )
elif ( $ECHO $i | $GREP "^userId" > /dev/null ); then
UID=$( $ECHO $i | $CUT -d '"' -f 2 )
GID=$UID
elif ( $ECHO $i | $GREP "^sharedUserId" > /dev/null ); then
UID=$( $ECHO $i | $CUT -d '"' -f 2 );
GID=$UID
fi
done
if $TEST "x$DEBUG" = "x1"; then
$ECHO "$CODEPATH $APPDIR0/$APPDIR1/$APPDIR2 $UID:$GID" | $TEE -a $LOG_FILE
else
$ECHO "Checking permissions for: $PACKAGE" | $TEE -a $LOG_FILE
fi
if $TEST -e "$CODEPATH"; then
OLD_UID=$( $LS -ln "$CODEPATH" | $TR -s ' ' | $CUT -d ' ' -f3 )
OLD_GID=$( $LS -ln "$CODEPATH" | $TR -s ' ' | $CUT -d ' ' -f4 )
if $TEST "$APPDIR0" = "system"; then
if $TEST "$OLD_UID" -ne "0"; then
$ECHO "$UID_MSG $CODEPATH from '$OLD_UID' to '0'" | $TEE -a $LOG_FILE
$CHOWN 0 "$CODEPATH"
fi
if $TEST "$OLD_GID" -ne "0"; then
$ECHO "$GID_MSG $CODEPATH from '$OLD_GID' to '0'" | $TEE -a $LOG_FILE
$CHOWN :0 "$CODEPATH"
fi
chmod 644 "$CODEPATH"
elif $TEST "$APPDIR0" = "data"; then
if $TEST "$APPDIR1" = "app"; then
if $TEST "$OLD_UID" -ne "1000"; then
$ECHO "$UID_MSG $CODEPATH from '$OLD_UID' to '1000'" | $TEE -a $LOG_FILE
$CHOWN 1000 "$CODEPATH"
fi
if $TEST "$OLD_GID" -ne "1000"; then
$ECHO "$GID_MSG $CODEPATH from '$OLD_GID' to '1000'" | $TEE -a $LOG_FILE
$CHOWN :1000 "$CODEPATH"
fi
chmod 644 "$CODEPATH"
elif $TEST "$APPDIR1" = "app-private"; then
if $TEST "$OLD_UID" -ne "1000"; then
$ECHO "$UID_MSG $CODEPATH from '$OLD_UID' to '1000'" | $TEE -a $LOG_FILE
$CHOWN 1000 "$CODEPATH"
fi
if $TEST "$OLD_GID" -ne "$GID"; then
$ECHO "$GID_MSG $CODEPATH from '$OLD_GID' to '$GID'" | $TEE -a $LOG_FILE
$CHOWN :$GID "$CODEPATH"
fi
chmod 640 "$CODEPATH"
fi
fi
if $TEST -d "/data/data/$PACKAGE"; then
OLD_UID=$( $LS -ldn "/data/data/$PACKAGE" | $TR -s ' ' | $CUT -d ' ' -f3 )
OLD_GID=$( $LS -ldn "/data/data/$PACKAGE" | $TR -s ' ' | $CUT -d ' ' -f4 )
if $TEST "$OLD_UID" -ne "$UID"; then
$ECHO "$UID_MSG /data/data/$PACKAGE from '$OLD_UID' to '$UID'" | $TEE -a $LOG_FILE
$CHOWN $UID "/data/data/$PACKAGE"
fi
if $TEST "$OLD_GID" -ne "$GID"; then
$ECHO "$GID_MSG /data/data/$PACKAGE from '$OLD_GID' to '$GID'" | $TEE -a $LOG_FILE
$CHOWN :$GID "/data/data/$PACKAGE"
fi
chmod 755 "/data/data/$PACKAGE"
fi
if $TEST -d "/data/data/$PACKAGE/lib"; then
OLD_UID=$( $LS -ldn "/data/data/$PACKAGE/lib" | $TR -s ' ' | $CUT -d ' ' -f3 )
OLD_GID=$( $LS -ldn "/data/data/$PACKAGE/lib" | $TR -s ' ' | $CUT -d ' ' -f4 )
if $TEST "$OLD_UID" -ne "1000"; then
$ECHO "$UID_MSG /data/data/$PACKAGE/lib from '$OLD_UID' to '1000'" | $TEE -a $LOG_FILE
$CHOWN 1000 "/data/data/$PACKAGE/lib"
fi
if $TEST "$OLD_GID" -ne "1000"; then
$ECHO "$GID_MSG /data/data/$PACKAGE/lib from '$OLD_GID' to '1000'" | $TEE -a $LOG_FILE
$CHOWN :1000 "/data/data/$PACKAGE/lib"
fi
chmod 755 "/data/data/$PACKAGE/lib"
fi
for package_dir in $( $LS "/data/data/$PACKAGE" ); do
if $TEST -d "/data/data/$PACKAGE/$package_dir"; then
$FIND "/data/data/$PACKAGE/$package_dir" ! -name lib\* | while read entry; do
if $TEST "x$DEBUG" = "x1"; then
$ECHO "'$entry'" | $TEE -a $LOG_FILE
fi
if $TEST -d "$entry"; then
LS_OUT=$( $LS -ldn "$entry" | $TR -s ' ' | $CUT -d ' ' -f 1-4 )
OLD_UID=$( $ECHO $LS_OUT | $CUT -d ' ' -f 3 )
OLD_GID=$( $ECHO $LS_OUT | $CUT -d ' ' -f 4 )
OLD_PERM=$( $ECHO $LS_OUT | $CUT -c2-10 )
IS_DIRECTORY="1"
else
LS_OUT=$( $LS -ln "$entry" | $TR -s ' ' | $CUT -d ' ' -f 1-4 )
OLD_UID=$( $ECHO $LS_OUT | $CUT -d ' ' -f 3 )
OLD_GID=$( $ECHO $LS_OUT | $CUT -d ' ' -f 4 )
OLD_PERM=$( $ECHO $LS_OUT | $CUT -c2-10 )
IS_DIRECTORY="0"
fi
if $TEST "$OLD_UID" -ne "$UID"; then
$ECHO "$UID_MSG $entry from '$OLD_UID' to '$UID'" | $TEE -a $LOG_FILE
$CHOWN $UID "$entry"
fi
if $TEST "$OLD_GID" -ne "$GID"; then
$ECHO "$GID_MSG $entry from '$OLD_GID' to '$GID'" | $TEE -a $LOG_FILE
$CHOWN :$GID "$entry"
fi
if $TEST "$IS_DIRECTORY" -eq "0"; then
if $TEST $( $ECHO "$entry" | $EGREP -c "/shared_prefs|/databases" ) != 0 \
&& $TEST "$OLD_PERM" != "rw-rw----"; then
$ECHO "$PERM_MSG $entry from $OLD_PERM to rw-rw---- (660)" | $TEE -a $LOG_FILE
chmod 660 "$entry"
elif $TEST $( $ECHO "$entry" | $EGREP -c "/cache/" ) != 0 \
&& $TEST "$OLD_PERM" != "rw-------"; then
$ECHO "$PERM_MSG $entry from $OLD_PERM to rw------- (600)" | $TEE -a $LOG_FILE
chmod 600 "$entry"
fi
fi
if $TEST "$IS_DIRECTORY" -eq "1"; then
if $TEST $( $ECHO "$entry" | $EGREP -c "/shared_prefs|/databases|/cache" ) != 0 \
&& $TEST "$OLD_PERM" != "rwxrwx--x"; then
$ECHO "$PERM_MSG $entry from $OLD_PERM to rwxrwx--x (771)" | $TEE -a $LOG_FILE
chmod 771 "$entry"
fi
fi
done
fi
done
else
$ECHO "$CODEPATH does not exist. Reinstall." | $TEE -a $LOG_FILE
if $TEST $REMOVE -eq "1" ; then
if $TEST -d /data/data/$PACKAGE ; then
$ECHO "Removing stale dir /data/data/$PACKAGE" | $TEE -a $LOG_FILE
$RM -R /data/data/$PACKAGE
fi
fi
fi
done
if $TEST "x$SYSREMOUNT" = "x1"; then
$MOUNT -o remount,ro $DEVICE /system > /dev/null 2>&1
fi
if $TEST "x$SYSSDMOUNT" = "x1"; then
$UMOUNT /system/sd > /dev/null 2>&1
fi
if $TEST "x$SYSMOUNT" = "x1"; then
$UMOUNT /system > /dev/null 2>&1
fi
if $TEST "x$DATAMOUNT" = "x1"; then
$UMOUNT /data > /dev/null 2>&1
fi
$ECHO "fix_permissions $VERSION has completed $( date +"%m-%d-%Y %H:%M:%S" )" | $TEE -a $LOG_FILE
fi
Click to expand...
Click to collapse
Thanks for stepping in, i was really at a loss.
Sent from my Twi5ted SM-G900A using Tapatalk

Riyal said:
mount /data partition and execute this command.
find /data -type d -exec chmod 775 {} \;
find /data -type f -exec chmod 644 {} \;
Or you can just reverse the fix permission script.
Since lollipop fix permission has been outdated by SELinux.
Code:
#! /system/bin/sh
#
# Warning: if you want to run this script in cm-recovery change the above to #!/sbin/sh
#
# fix_permissions - fixes permissions on Android data directories after upgrade
# [email protected]
#
# thanks to: http://blog.elsdoerfer.name/2009/05/25/android-fix-package-uid-mismatches/
#
# v1.1 - work with protected apps
# v1.2 - chown all the subfolders different than 'lib' and the single files [by ankn]
# v1.3 - support for the packages with userShareId; added parameter to support the remount
# mechanism in images different than Cyanogen [by ankn]
# v1.4 - fix the file and directory permissions as well [by smeat]
# v1.5 - integrate code by thenefield for logging and only making changes if needed [by smeat and thenefield]
# v1.6 - Don't mess with user's sdcard, log to it if present or to /data/data/ if not present [by farmatito]
# v1.7 - Simplify and improve readability of script a little, enforce safe default permissions where possible [by farmatito]
# v1.8 - Make sure we choose busybox applets when system binaries with the same name are available [by farmatito]
# v1.9 - reintegrated "chown all the subfolders different than 'lib' and the single files [by ankn]", fixed private app GID [by smeat]
# v1.10 - chmod and chown /data/data/$PACKAGE/lib as well [by smeat]
# v1.11 - logging of /data/data/$PACKAGE/lib, check if /data/data/$PACKAGE/lib needs be changed, fixed ls on chown [by smeat]
# v1.12 - reduced the number of finds down to one, chown and chmod actions reduced to a single loop, bug fixes and code clean up [by smeat]
# v1.13 - Minor Clean up [by farmatito]
# v1.14 - remove additional file checks in the chmod loop [by smeat]
# v1.15 - Apply correct ownership and permissions to the apks. [by farmatito]
# v1.16 - very minor cleanups, changed all command subsitutions to be new style [by smeat]
# v1.17 - Print version [by farmatito]
# v1.18 - print what app fix_permissions is working on [by smeat]
# v1.19 - Improve debug info [by farmatito]
# v1.20 - print what app fix_permissions is working on to the log as well [by smeat]
# v1.21 - Handle filenames with spaces correctly - fix version numbering - echo is a busybox applet [by farmatito]
# v1.22 - [ is a busybox applet when android shell is used [by farmatito]
# v1.23 - chmod, cat, mount and umount are busybox applets as well, make sure drives are mounted
# run nearly unchanged in recovery/ROM [by smeat]
# v1.24 - Minor cosmetic fix.
# v1.25 - Remove debug switch (needs getopt) add switch to remove stale data dirs of uninstalled apk packages. [by farmatito]
# v1.26 - Autodetect on which device /system is. [by farmatito]
# v1.27 - Don't complain if we can't remount /system ro and other minor fixes
# v1.28 - Fix mount rw /system and other minor fixes
# v1.29 - Fix some broken tests
VERSION="1.29"
# Turn debug on by uncommenting it in this script,
# by setting DEBUG=1 on the commandline, e.g.
# DEBUG=1 ./fix_permissions
# or by exporting DEBUG=1 before you run the script, e.g.
# export DEBUG=1
# ./fix_permissions
#DEBUG="1"
UID_MSG="Changing user ownership for:"
GID_MSG="Changing group ownership for:"
PERM_MSG="Changing permissions for:"
ECHO="busybox echo"
GREP="busybox grep"
EGREP="busybox egrep"
CAT="busybox cat"
CHOWN="busybox chown"
CHMOD="busybox chmod"
MOUNT="busybox mount"
UMOUNT="busybox umount"
CUT="busybox cut"
FIND="busybox find"
LS="busybox ls"
TR="busybox tr"
TEE="busybox tee"
TEST="busybox test"
SED="busybox sed"
RM="busybox rm"
CODEPATH=""
UID=""
GID=""
PACKAGE=""
REMOVE="0"
if $TEST "$1" = "-h"; then
$ECHO "Usage $0 [OPTIONS]"
$ECHO " -r remove stale data directories"
$ECHO " of uninstalled packages"
$ECHO " -V print version"
$ECHO " -h this help"
elif $TEST "$1" = "-V"; then
$ECHO "$0 $VERSION"
else
if $TEST "$1" = "-r"; then
REMOVE="1"
fi
if $TEST $( $GREP -c " /system " "/proc/mounts" ) -ne "0"; then
DEVICE=$( $GREP " /system " "/proc/mounts" | $CUT -d ' ' -f1 )
if $TEST "x$DEBUG" = "x1"; then
$ECHO "/system mounted on $DEVICE"
fi
if $TEST $( $GREP " /system " "/proc/mounts" | $GREP -c " ro " ) -ne "0"; then
$MOUNT -o remount,rw $DEVICE /system
SYSREMOUNT="1"
fi
else
$MOUNT /system > /dev/null 2>&1
SYSMOUNT="1"
fi
if $TEST $( $GREP -c " /data " "/proc/mounts" ) -eq "0"; then
$MOUNT /data > /dev/null 2>&1
DATAMOUNT="1"
fi
if $TEST -e /dev/block/mmcblk0p2 && $TEST $( $GREP -c " /system/sd " "/proc/mounts" ) -eq "0"; then
$MOUNT /system/sd > /dev/null 2>&1
SYSSDMOUNT="1"
fi
if $TEST $( $MOUNT | $GREP -c /sdcard ) -eq "0"; then
LOG_FILE="/data/fix_permissions.log"
else
LOG_FILE="/sdcard/fix_permissions.log"
fi
if $TEST ! -e "$LOG_FILE"; then
> $LOG_FILE
fi
$ECHO "Starting fix_permissions $VERSION $( date +"%m-%d-%Y %H:%M:%S" )" | $TEE -a $LOG_FILE
$CAT /data/system/packages.xml | $GREP "^<package" | $GREP serId | $GREP -v framework-res.apk | while read line; do
for i in $( $ECHO $line | $TR " " "\n" ); do
if $TEST $i = "<package"; then
CODEPATH=""
PACKAGE=""
UID=""
GID=""
elif ( $ECHO $i | $GREP "^codePath" > /dev/null ); then
CODEPATH=$( $ECHO $i | $CUT -d '"' -f 2 )
APPDIR0=$( $ECHO "$CODEPATH" | $CUT -d '/' -f 2 )
APPDIR1=$( $ECHO "$CODEPATH" | $CUT -d '/' -f 3 )
APPDIR2=$( $ECHO "$CODEPATH" | $CUT -d '/' -f 4 )
elif ( $ECHO $i | $GREP "^name" > /dev/null ); then
PACKAGE=$( $ECHO $i | $CUT -d '"' -f 2 )
elif ( $ECHO $i | $GREP "^userId" > /dev/null ); then
UID=$( $ECHO $i | $CUT -d '"' -f 2 )
GID=$UID
elif ( $ECHO $i | $GREP "^sharedUserId" > /dev/null ); then
UID=$( $ECHO $i | $CUT -d '"' -f 2 );
GID=$UID
fi
done
if $TEST "x$DEBUG" = "x1"; then
$ECHO "$CODEPATH $APPDIR0/$APPDIR1/$APPDIR2 $UID:$GID" | $TEE -a $LOG_FILE
else
$ECHO "Checking permissions for: $PACKAGE" | $TEE -a $LOG_FILE
fi
if $TEST -e "$CODEPATH"; then
OLD_UID=$( $LS -ln "$CODEPATH" | $TR -s ' ' | $CUT -d ' ' -f3 )
OLD_GID=$( $LS -ln "$CODEPATH" | $TR -s ' ' | $CUT -d ' ' -f4 )
if $TEST "$APPDIR0" = "system"; then
if $TEST "$OLD_UID" -ne "0"; then
$ECHO "$UID_MSG $CODEPATH from '$OLD_UID' to '0'" | $TEE -a $LOG_FILE
$CHOWN 0 "$CODEPATH"
fi
if $TEST "$OLD_GID" -ne "0"; then
$ECHO "$GID_MSG $CODEPATH from '$OLD_GID' to '0'" | $TEE -a $LOG_FILE
$CHOWN :0 "$CODEPATH"
fi
chmod 644 "$CODEPATH"
elif $TEST "$APPDIR0" = "data"; then
if $TEST "$APPDIR1" = "app"; then
if $TEST "$OLD_UID" -ne "1000"; then
$ECHO "$UID_MSG $CODEPATH from '$OLD_UID' to '1000'" | $TEE -a $LOG_FILE
$CHOWN 1000 "$CODEPATH"
fi
if $TEST "$OLD_GID" -ne "1000"; then
$ECHO "$GID_MSG $CODEPATH from '$OLD_GID' to '1000'" | $TEE -a $LOG_FILE
$CHOWN :1000 "$CODEPATH"
fi
chmod 644 "$CODEPATH"
elif $TEST "$APPDIR1" = "app-private"; then
if $TEST "$OLD_UID" -ne "1000"; then
$ECHO "$UID_MSG $CODEPATH from '$OLD_UID' to '1000'" | $TEE -a $LOG_FILE
$CHOWN 1000 "$CODEPATH"
fi
if $TEST "$OLD_GID" -ne "$GID"; then
$ECHO "$GID_MSG $CODEPATH from '$OLD_GID' to '$GID'" | $TEE -a $LOG_FILE
$CHOWN :$GID "$CODEPATH"
fi
chmod 640 "$CODEPATH"
fi
fi
if $TEST -d "/data/data/$PACKAGE"; then
OLD_UID=$( $LS -ldn "/data/data/$PACKAGE" | $TR -s ' ' | $CUT -d ' ' -f3 )
OLD_GID=$( $LS -ldn "/data/data/$PACKAGE" | $TR -s ' ' | $CUT -d ' ' -f4 )
if $TEST "$OLD_UID" -ne "$UID"; then
$ECHO "$UID_MSG /data/data/$PACKAGE from '$OLD_UID' to '$UID'" | $TEE -a $LOG_FILE
$CHOWN $UID "/data/data/$PACKAGE"
fi
if $TEST "$OLD_GID" -ne "$GID"; then
$ECHO "$GID_MSG /data/data/$PACKAGE from '$OLD_GID' to '$GID'" | $TEE -a $LOG_FILE
$CHOWN :$GID "/data/data/$PACKAGE"
fi
chmod 755 "/data/data/$PACKAGE"
fi
if $TEST -d "/data/data/$PACKAGE/lib"; then
OLD_UID=$( $LS -ldn "/data/data/$PACKAGE/lib" | $TR -s ' ' | $CUT -d ' ' -f3 )
OLD_GID=$( $LS -ldn "/data/data/$PACKAGE/lib" | $TR -s ' ' | $CUT -d ' ' -f4 )
if $TEST "$OLD_UID" -ne "1000"; then
$ECHO "$UID_MSG /data/data/$PACKAGE/lib from '$OLD_UID' to '1000'" | $TEE -a $LOG_FILE
$CHOWN 1000 "/data/data/$PACKAGE/lib"
fi
if $TEST "$OLD_GID" -ne "1000"; then
$ECHO "$GID_MSG /data/data/$PACKAGE/lib from '$OLD_GID' to '1000'" | $TEE -a $LOG_FILE
$CHOWN :1000 "/data/data/$PACKAGE/lib"
fi
chmod 755 "/data/data/$PACKAGE/lib"
fi
for package_dir in $( $LS "/data/data/$PACKAGE" ); do
if $TEST -d "/data/data/$PACKAGE/$package_dir"; then
$FIND "/data/data/$PACKAGE/$package_dir" ! -name lib\* | while read entry; do
if $TEST "x$DEBUG" = "x1"; then
$ECHO "'$entry'" | $TEE -a $LOG_FILE
fi
if $TEST -d "$entry"; then
LS_OUT=$( $LS -ldn "$entry" | $TR -s ' ' | $CUT -d ' ' -f 1-4 )
OLD_UID=$( $ECHO $LS_OUT | $CUT -d ' ' -f 3 )
OLD_GID=$( $ECHO $LS_OUT | $CUT -d ' ' -f 4 )
OLD_PERM=$( $ECHO $LS_OUT | $CUT -c2-10 )
IS_DIRECTORY="1"
else
LS_OUT=$( $LS -ln "$entry" | $TR -s ' ' | $CUT -d ' ' -f 1-4 )
OLD_UID=$( $ECHO $LS_OUT | $CUT -d ' ' -f 3 )
OLD_GID=$( $ECHO $LS_OUT | $CUT -d ' ' -f 4 )
OLD_PERM=$( $ECHO $LS_OUT | $CUT -c2-10 )
IS_DIRECTORY="0"
fi
if $TEST "$OLD_UID" -ne "$UID"; then
$ECHO "$UID_MSG $entry from '$OLD_UID' to '$UID'" | $TEE -a $LOG_FILE
$CHOWN $UID "$entry"
fi
if $TEST "$OLD_GID" -ne "$GID"; then
$ECHO "$GID_MSG $entry from '$OLD_GID' to '$GID'" | $TEE -a $LOG_FILE
$CHOWN :$GID "$entry"
fi
if $TEST "$IS_DIRECTORY" -eq "0"; then
if $TEST $( $ECHO "$entry" | $EGREP -c "/shared_prefs|/databases" ) != 0 \
&& $TEST "$OLD_PERM" != "rw-rw----"; then
$ECHO "$PERM_MSG $entry from $OLD_PERM to rw-rw---- (660)" | $TEE -a $LOG_FILE
chmod 660 "$entry"
elif $TEST $( $ECHO "$entry" | $EGREP -c "/cache/" ) != 0 \
&& $TEST "$OLD_PERM" != "rw-------"; then
$ECHO "$PERM_MSG $entry from $OLD_PERM to rw------- (600)" | $TEE -a $LOG_FILE
chmod 600 "$entry"
fi
fi
if $TEST "$IS_DIRECTORY" -eq "1"; then
if $TEST $( $ECHO "$entry" | $EGREP -c "/shared_prefs|/databases|/cache" ) != 0 \
&& $TEST "$OLD_PERM" != "rwxrwx--x"; then
$ECHO "$PERM_MSG $entry from $OLD_PERM to rwxrwx--x (771)" | $TEE -a $LOG_FILE
chmod 771 "$entry"
fi
fi
done
fi
done
else
$ECHO "$CODEPATH does not exist. Reinstall." | $TEE -a $LOG_FILE
if $TEST $REMOVE -eq "1" ; then
if $TEST -d /data/data/$PACKAGE ; then
$ECHO "Removing stale dir /data/data/$PACKAGE" | $TEE -a $LOG_FILE
$RM -R /data/data/$PACKAGE
fi
fi
fi
done
if $TEST "x$SYSREMOUNT" = "x1"; then
$MOUNT -o remount,ro $DEVICE /system > /dev/null 2>&1
fi
if $TEST "x$SYSSDMOUNT" = "x1"; then
$UMOUNT /system/sd > /dev/null 2>&1
fi
if $TEST "x$SYSMOUNT" = "x1"; then
$UMOUNT /system > /dev/null 2>&1
fi
if $TEST "x$DATAMOUNT" = "x1"; then
$UMOUNT /data > /dev/null 2>&1
fi
$ECHO "fix_permissions $VERSION has completed $( date +"%m-%d-%Y %H:%M:%S" )" | $TEE -a $LOG_FILE
fi
Click to expand...
Click to collapse
hi Riyal thanks for joining in what do i do with this script you have sent ? is it already reversed or is thei what i have already run and needs reversed ? how do i run this script on the phone ?
i run the 2 chmod commands and thing iv lost adb access via the boot screen now (still have adb via twrp recovery)
i now have sound with my samsung logo
dont remember having that before so possibly fixed something

OK... I was thinking this must be a SELinux issue we're having so why not do this instead...
1. Boot to TWRP and mount data.
2. Open TWRP's built in terminal
3. Type these commands to fix SELinux issues with the files in data.
Code:
setenforce 0
getenforce
restorecon -RF /data
setenforce 0 - this should set the SELinux status to permissive.
getenforce - this should output the SELinux status. Note that this must output "permissive" if it's "enforcing" execute the first command again.
restorecon -RF /data - this should restore the security context of the files in the /data partition
after executing the 3 commands reboot again to system.

Riyal said:
OK... I was thinking this must be a SELinux issue we're having so why not do this instead...
1. Boot to TWRP and mount data.
2. Open TWRP's built in terminal
3. Type these commands to fix SELinux issues with the files in data.
Code:
setenforce 0
getenforce
restorecon -RF /data
setenforce 0 - this should set the SELinux status to permissive.
getenforce - this should output the SELinux status. Note that this must output "permissive" if it's "enforcing" execute the first command again.
restorecon -RF /data - this should restore the security context of the files in the /data partition
after executing the 3 commands reboot again to system.
Click to expand...
Click to collapse
i ran getenforce first to see the status it was enforcing
setenforce 0 and rerun getenforce now permissive
attempted to run restorecon -RF /data but come up with : invalid option -- F
usage: restorecon [-nrRv] pathname...
rebooted to system to see how we done so far if any change at all
appear to be no further forward
was going to run the command again without the F flag but figured without me knowing the usage of the flags this could do more harm than good

@killabyte0
It failed... Try running without the F option... Seems like restorecon for android is crippled :/ But try doing the commands again but this time execute restorecon without the F which would be
Code:
restorecon -R /data

Riyal said:
@killabyte0
It failed... Try running without the F option... Seems like restorecon for android is crippled :/ But try doing the commands again but this time execute restorecon without the F which would be
Code:
restorecon -R /data
Click to expand...
Click to collapse
~ # restorecon -R /data
/sbin/sh: ~: not found
~ #

killabyte0 said:
~ # restorecon -R /data
/sbin/sh: ~: not found
~ #
Click to expand...
Click to collapse
Did you mount /data?
Sent from my Twi5ted SM-G900A using Tapatalk

Related

[Q]zipalign on boot code

Hey there
I just found out that robocik zipalign on boot code was as same as maxisma ones
robocik​
Code:
#!/system/bin/sh
# Automatic ZipAlign by Wes Garner
# ZipAlign files in /data that have not been previously ZipAligned (using md5sum)
# Thanks to oknowton for the changes
# Changelog:
# 1.1 (12/1/09) Switched to zipalign -c 4 to check the apk instead of MD5 (oknowton)
# 1.0 (11/30/09) Original
LOG_FILE=/data/zipalign.log
if [ -e $LOG_FILE ]; then
rm $LOG_FILE;
fi;
[B]echo "Starting Automatic ZipAlign $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
for apk in /system/sd/app/*.apk ; do[/B]
zipalign -c 4 $apk;
ZIPCHECK=$?;
if [ $ZIPCHECK -eq 1 ]; then
echo ZipAligning $(basename $apk) | tee -a $LOG_FILE;
zipalign -f 4 $apk /cache/$(basename $apk);
if [ -e /cache/$(basename $apk) ]; then
cp -f -p /cache/$(basename $apk) $apk | tee -a $LOG_FILE;
rm /cache/$(basename $apk);
else
echo ZipAligning $(basename $apk) Failed | tee -a $LOG_FILE;
fi;
else
echo ZipAlign already completed on $apk | tee -a $LOG_FILE;
fi;
done;
echo "Automatic ZipAlign finished at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
Maxisma​
Code:
#!/system/bin/sh
echo "++++ ZIP ALIGNMENT PROCESS STARTING ++++"
LOG_FILE=/data/zipalign.log
if [ -e $LOG_FILE ]; then
rm $LOG_FILE;
fi;
[B]echo "Starting DC Automatic ZipAlign $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
for apk in /data/app/*.apk ; do[/B]
zipalign -c 4 $apk;
ZIPCHECK=$?;
if [ $ZIPCHECK -eq 1 ]; then
echo ZipAligning $(basename $apk) | tee -a $LOG_FILE;
zipalign -f 4 $apk /cache/$(basename $apk);
if [ -e /cache/$(basename $apk) ]; then
cp -f -p /cache/$(basename $apk) $apk | tee -a $LOG_FILE;
rm /cache/$(basename $apk);
else
echo ZipAligning $(basename $apk) Failed DC | tee -a $LOG_FILE;
fi;
else
echo DCZipAlign already completed on $apk | tee -a $LOG_FILE;
fi;
done;
echo "Automatic ZipAlign finished at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
echo "++++ ZIP ALIGNMENT PROCESS FINISHED ++++"
I have bold the differences between this two codes
So are this two codes work the same? Does it need /system/bin/sh in order to run the command line? If I change the #!/system/bin/sh (the first line) to #!/system/xbin/bash,will it work too? If I have don't have the bash file in /system/xbin/ ,will it work too? Are bash and sh the same?
BTW,erasmux's boot OC pack also included a 09betterzipalign in it (he said it wasn't his)
Here is the code
Code:
#!/system/xbin/bash
LOG_FILE=/data/zipalign.log
ZIPALIGNDB=/data/zipalign.db
SYSTEM=$(mount|grep "/system "|awk '{ print $1 }')
function mountrw {
mount | grep "/system " | grep rw >/dev/null || mount -o remount,rw $SYSTEM /system
}
function mountro {
mount | grep "/system " | grep ro >/dev/null || mount -o remount,ro $SYSTEM /system
}
[ -e $LOG_FILE ] && rm $LOG_FILE
[ -f $ZIPALIGNDB ] || touch $ZIPALIGNDB
echo "Starting FV Automatic ZipAlign $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE
for DIR in /system/app /data/app /data/app-private ; do
cd $DIR
for APK in *.apk ; do
if [ $APK -ot $ZIPALIGNDB ] && [ $(grep "$DIR/$APK" $ZIPALIGNDB|wc -l) -gt 0 ] ; then
echo "Already checked: $DIR/$APK" | tee -a $LOG_FILE
else
zipalign -c 4 $APK
if [ $? -eq 0 ] ; then
echo "Already aligned: $DIR/$APK" | tee -a $LOG_FILE
grep "$DIR/$APK" $ZIPALIGNDB > /dev/null || echo $DIR/$APK >> $ZIPALIGNDB
else
echo "Now aligning: $DIR/$APK" | tee -a $LOG_FILE
zipalign -f 4 $APK /cache/$APK
mountrw
cp -f -p /cache/$APK $APK
rm -f /cache/$APK
grep "$DIR/$APK" $ZIPALIGNDB > /dev/null || echo $DIR/$APK >> $ZIPALIGNDB
fi
fi
done
done
mountro
touch $ZIPALIGNDB
echo "Automatic ZipAlign finished at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE
the first line is #!/system/xbin/bash,so it needs the bash file in the /system/xbin folder in order to work,rite? Is it the same as robocik and maxisma code?
What is this?
make something clear!!
robocik's script looks for apks to zipalign at "/system/sd/app/"
while Maxisma's looks at "/data/app/"
When looking at the dirs, robably robocik's mounts things as well in another script. Maybe apps2sd?
The first long line is quite unimportant, it just states "hey I'm zipalign and ready to work", with different names/texts.
I believed bash was based on sh, can't tell for sure. I always learned to follow the sh guidelines to get max compability. Maybe some linux-expert can tell you for sure, or just try to google it a little
riemervdzee said:
robocik's script looks for apks to zipalign at "/system/sd/app/"
while Maxisma's looks at "/data/app/"
When looking at the dirs, robably robocik's mounts things as well in another script. Maybe apps2sd?
The first long line is quite unimportant, it just states "hey I'm zipalign and ready to work", with different names/texts.
I believed bash was based on sh, can't tell for sure. I always learned to follow the sh guidelines to get max compability. Maybe some linux-expert can tell you for sure, or just try to google it a little
Click to expand...
Click to collapse
After some hours of research,I found out most of the ROM in XDA all include sh file (I didn't check all of it but most of them included sh file) but not all included bash file (10 out of 4 rom included bash file),this means in order to run the code,I need bash file in xbin (did a adb logcat and found out a line that says busybox runparts - blah blah blah /system/etc/init.d/09betterzipalign [the one that has #!/system/xbin/bash line on it] error running something like that)
BTW,robocik and maxisma one are almost the same,how can robocik ones can zipalign /system/sd/app/,he didn't change the code or anything,just type in the log file,thats all...
One more thing,y can't we run zipalign-on-boot on all the apps that were installed through the Android Market or wasn't installed on the /data/app?
Ng LC said:
Hey there
I just found out that robocik zipalign on boot code was as same as maxisma ones
robocik​
Code:
#!/system/bin/sh
# Automatic ZipAlign by Wes Garner
# ZipAlign files in /data that have not been previously ZipAligned (using md5sum)
# Thanks to oknowton for the changes
# Changelog:
# 1.1 (12/1/09) Switched to zipalign -c 4 to check the apk instead of MD5 (oknowton)
# 1.0 (11/30/09) Original
LOG_FILE=/data/zipalign.log
if [ -e $LOG_FILE ]; then
rm $LOG_FILE;
fi;
[B]echo "Starting Automatic ZipAlign $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
for apk in /system/sd/app/*.apk ; do[/B]
zipalign -c 4 $apk;
ZIPCHECK=$?;
if [ $ZIPCHECK -eq 1 ]; then
echo ZipAligning $(basename $apk) | tee -a $LOG_FILE;
zipalign -f 4 $apk /cache/$(basename $apk);
if [ -e /cache/$(basename $apk) ]; then
cp -f -p /cache/$(basename $apk) $apk | tee -a $LOG_FILE;
rm /cache/$(basename $apk);
else
echo ZipAligning $(basename $apk) Failed | tee -a $LOG_FILE;
fi;
else
echo ZipAlign already completed on $apk | tee -a $LOG_FILE;
fi;
done;
echo "Automatic ZipAlign finished at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
Maxisma​
Code:
#!/system/bin/sh
echo "++++ ZIP ALIGNMENT PROCESS STARTING ++++"
LOG_FILE=/data/zipalign.log
if [ -e $LOG_FILE ]; then
rm $LOG_FILE;
fi;
[B]echo "Starting DC Automatic ZipAlign $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
for apk in /data/app/*.apk ; do[/B]
zipalign -c 4 $apk;
ZIPCHECK=$?;
if [ $ZIPCHECK -eq 1 ]; then
echo ZipAligning $(basename $apk) | tee -a $LOG_FILE;
zipalign -f 4 $apk /cache/$(basename $apk);
if [ -e /cache/$(basename $apk) ]; then
cp -f -p /cache/$(basename $apk) $apk | tee -a $LOG_FILE;
rm /cache/$(basename $apk);
else
echo ZipAligning $(basename $apk) Failed DC | tee -a $LOG_FILE;
fi;
else
echo DCZipAlign already completed on $apk | tee -a $LOG_FILE;
fi;
done;
echo "Automatic ZipAlign finished at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
echo "++++ ZIP ALIGNMENT PROCESS FINISHED ++++"
I have bold the differences between this two codes
So are this two codes work the same? Does it need /system/bin/sh in order to run the command line? If I change the #!/system/bin/sh (the first line) to #!/system/xbin/bash,will it work too? If I have don't have the bash file in /system/xbin/ ,will it work too? Are bash and sh the same?
BTW,erasmux's boot OC pack also included a 09betterzipalign in it (he said it wasn't his)
Here is the code
Code:
#!/system/xbin/bash
LOG_FILE=/data/zipalign.log
ZIPALIGNDB=/data/zipalign.db
SYSTEM=$(mount|grep "/system "|awk '{ print $1 }')
function mountrw {
mount | grep "/system " | grep rw >/dev/null || mount -o remount,rw $SYSTEM /system
}
function mountro {
mount | grep "/system " | grep ro >/dev/null || mount -o remount,ro $SYSTEM /system
}
[ -e $LOG_FILE ] && rm $LOG_FILE
[ -f $ZIPALIGNDB ] || touch $ZIPALIGNDB
echo "Starting FV Automatic ZipAlign $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE
for DIR in /system/app /data/app /data/app-private ; do
cd $DIR
for APK in *.apk ; do
if [ $APK -ot $ZIPALIGNDB ] && [ $(grep "$DIR/$APK" $ZIPALIGNDB|wc -l) -gt 0 ] ; then
echo "Already checked: $DIR/$APK" | tee -a $LOG_FILE
else
zipalign -c 4 $APK
if [ $? -eq 0 ] ; then
echo "Already aligned: $DIR/$APK" | tee -a $LOG_FILE
grep "$DIR/$APK" $ZIPALIGNDB > /dev/null || echo $DIR/$APK >> $ZIPALIGNDB
else
echo "Now aligning: $DIR/$APK" | tee -a $LOG_FILE
zipalign -f 4 $APK /cache/$APK
mountrw
cp -f -p /cache/$APK $APK
rm -f /cache/$APK
grep "$DIR/$APK" $ZIPALIGNDB > /dev/null || echo $DIR/$APK >> $ZIPALIGNDB
fi
fi
done
done
mountro
touch $ZIPALIGNDB
echo "Automatic ZipAlign finished at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE
the first line is #!/system/xbin/bash,so it needs the bash file in the /system/xbin folder in order to work,rite? Is it the same as robocik and maxisma code?
Click to expand...
Click to collapse
Thanks mate, getting this error
I//system/xbin/busybox( 1215): /system/etc/init.d/97zipalign: line 24: tee: command not found
I//system/xbin/busybox( 1215): /system/etc/init.d/97zipalign: line 15: tee: command not found
I//system/xbin/busybox( 1215): /system/etc/init.d/97zipalign: line 16: basename: command not found
I//system/xbin/busybox( 1215): /system/etc/init.d/97zipalign: line 15: basename: command not found
Any idea?

[DEV/TOOL] Automated(ish) T-Mobile Theme Generator

A script I've been working on for a couple of days. Still a work in progress so if you suck less, I could use improvements. It's real simple:
** Put this script in a stock theme template like Cyanbread
1.) Place a source ROM you want to theme for, the base ROM/THROM you're taking images from and a stock theme template (like Cyanbread) and set them in the script at the top.
2.) Modify the script as needed (it's not done as of this writing) and set verbosity out the output, etc.
2.) Run the script and it will do the work
The code should be pretty self explanatory and I'll update it as I go. Just about finished at this point.
Screenshot shows you what it does
Code:
#!/bin/bash
# ------------------------- Set theme name TODO
# themeName=$(cat Android.mk | grep LOCAL_PACKAGE_NAME | sed 's/^LOCAL_PACKAGE_NAME\s:=\s//g')
# read -p "Enter theme name. Enter for default [$themeName]: " REPLY
# REPLY=${REPLY:-$themeName}
# echo "Theme name is $themeName"
# ------------------------- for testing to spare the parameters
SRCROM="ABSOLUTE/PATH/TO/ROOT/OF/SOURCEROM"
BASEROM="ABSOLUTE/PATH/TO/ROOT/OF/BASEROM/YOURE/THEMING/FOR"
# my example:
# SRCROM=~/GBSense2.1/
# BASEROM=~/cm_glacier_full-42/
# running this script from ~/haxzamatic-Templatebread--918313e/
DSTROM=$(pwd)
LOGFILE=$DSTROM/logfile.log
decompile_rom(){
cd $1/app
if [ ! -d $1/app/Browser/ ]; then # need apktool for drawables
#apktool if framework/framework_res.apk
#if [ -e framework/com.htc.resources.apk ]; then
# apktool if framework/com.htc.resources.apk
#fi
for i in `ls $1/app/*.apk`; do echo "Decompiling $i"; apktool d $i; done
cd ../framework
for i in `ls $1/framework/*.apk`; do echo "Decompiling $i"; apktool d $i; done
else
echo "Already decompiled"
fi
}
decompile_rom $SRCROM/system
decompile_rom $BASEROM/system
cd $DSTROM
rm $DSTROM/res/xml/*.xml
echo "" > appendleftovers.tmp
# ------------------------- Log file purge and title
cat <<EOF > $LOGFILE
*********************************************************
Missing files from $SRCROM
*********************************************************
EOF
# ------------------------- Redirections.xml
cat <<EOF > res/xml/redirections.xml
<?xml version="1.0" encoding="utf-8"?>
<theme-redirections
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:pluto="http://www.w3.org/2001/pluto.html">
EOF
# ------------------------- Android.xml
echo "<resource-redirections>">$DSTROM/res/xml/android.xml
# ------------------------- Main Loop
find "$BASEROM" -type f -name "*.png" | while read fimg; do
# ------------------------- Base Params
FIMGFNAME=$(cat $(dirname $fimg)"/../../apktool.yml" | grep "apkFileName" | sed 's/apkFileName:\s//g' | sed 's/\.apk//g' )
FIMGPNAME=$(cat $(dirname $fimg)"/../../AndroidManifest.xml" | grep "package" | tr " " "\n" | grep package= | cut -d \" -f 2)
if [ $FIMGPNAME = "android" ]; then FIMGPNAME=framework_res; fi
FIMGDNAME=$(echo $(dirname $fimg) | sed "s/\(.*\)\///" )
cd $DSTROM
if [ "$FIMGFNAME" = "framework-res" ] || [ "$FIMGFNAME" = "com.htc.resources" ]; then wp="framework"
else wp="app"
fi
# -------------------------
SRCFILEPATH=$SRCROM/system/$wp/$FIMGFNAME/res/$FIMGDNAME/$DESTFILE
SRCFILENAME=$(echo $(basename $fimg))
DSTFILEPATH=$DSTROM/system/$wp/$FIMGFNAME/res/$FIMGDNAME/$DESTFILE
DSTFILENAME=$(echo $(echo $FIMGPNAME|sed 's/\./_/g')"_$(basename $fimg)")
BSEFILEPATH=$BASEROM/system/$wp/$FIMGFNAME/res/$FIMGDNAME/$DESTFILE
BSEFILENAME=$(echo $(basename $fimg))
# -------------------------
[ -d res ] || mkdir res
[ -d res/$FIMGDNAME ] || mkdir res/$FIMGDNAME
# -------------------------
if [ -f $SRCFILEPATH$SRCFILENAME ]; then
echo "cp $SRCFILEPATH$SRCFILENAME $DSTROM/res/$FIMGDNAME/$DSTFILENAME"
cp $SRCFILEPATH$SRCFILENAME $DSTROM/res/$FIMGDNAME/$DSTFILENAME
# ------------------------- Redirections.xml
thispname=$(cat $(dirname $fimg)"/../../AndroidManifest.xml" | grep "package" | tr " " "\n" | grep package= | cut -d \" -f 2)
if ! grep -iq $thispname $DSTROM/res/xml/redirections.xml ; then
echo "<package-redirections android:name=\"$thispname\" android:minSdkVersion=\"7\" android:resource=\"@xml/$(echo $thispname|sed 's/\./_/g')\" />" >>$DSTROM/res/xml/redirections.xml
fi
# ------------------------- Android.xml
drawrsrc=$(echo $SRCFILENAME | sed 's/\(.*\)\..*/\1/' | sed 's/\.9//g')
drawrdst=$(echo $DSTFILENAME | sed 's/\(.*\)\..*/\1/' | sed 's/\.9//g')
echo "<item name=\"@drawable/$drawrsrc\">@drawable/$drawrdst</item>" >>$DSTROM/res/xml/android.xml
# ------------------------- Package Redirections
drawrfnamenoext=$(echo $drawrsrc | sed 's/\./_/g')
dstfilenameparsed=$(echo $drawrdst | sed 's/\./_/g')
dstredirfname=`echo "$DSTROM/res/xml/$(echo $FIMGPNAME | sed 's/\./_/g').xml"`
if [ ! -f $dstredirfname ]; then
cat <<EOF > $dstredirfname
<?xml version="1.0" encoding="utf-8"?>
<resource-redirections>
EOF
echo "$dstredirfname" >> appendleftovers.tmp
fi
echo "<item name=\"drawable/$drawrfnamenoext\">@drawable/$dstfilenameparsed</item>" >>$dstredirfname
else
echo "[MISSING]: $SRCFILEPATH$SRCFILENAME" >> $LOGFILE
#echo "1.) $fimg" >> $LOGFILE
#echo "2.) $FIMGFNAME" >> $LOGFILE
#echo "3.) $FIMGPNAME" >> $LOGFILE
#echo "4.) $FIMGDNAME" >> $LOGFILE
#echo "5.) $SRCFILEPATH" >> $LOGFILE
#echo "6.) $SRCFILENAME" >> $LOGFILE
#echo "7.) $DSTFILEPATH" >> $LOGFILE
#echo "8.) $DSTFILENAME" >> $LOGFILE
#echo "9.) $BSEFILEPATH" >> $LOGFILE
#echo "10.)$BSEFILENAME" >> $LOGFILE
#echo "------------------------------" >> $LOGFILE
fi
# echo "1.) $fimg"
# echo "2.) $FIMGFNAME"
# echo "3.) $FIMGPNAME"
# echo "4.) $FIMGDNAME"
# echo "5.) $SRCFILEPATH"
# echo "6.) $SRCFILENAME"
# echo "7.) $DSTFILEPATH"
# echo "8.) $DSTFILENAME"
# echo "9.) $BSEFILEPATH"
# echo "10.)$BSEFILENAME"
# echo "------------------------------"
# ------------------------- Example output:
# 1.) ~/cm_glacier_full-42/system/app/Browser/res/drawable-hdpi/fav_icn_background.png
# 2.) Browser
# 3.) com.android.browser
# 4.) drawable-hdpi
# 5.) ~/GBSense2.1/system/app/Browser/res/drawable-hdpi/
# 6.) fav_icn_background.png
# 7.) ~/haxzamatic-Templatebread--918313e/system/app/Browser/res/drawable-hdpi/
# 8.) com_android_browser_fav_icn_background.png
# 9.) ~/cm_glacier_full-42/system/app/Browser/res/drawable-hdpi/
# 10.)fav_icn_background.png
done
# ------------------------- Close out the XML tags
echo "</resource-redirections>">>$DSTROM/res/xml/android.xml
echo "</theme-redirections>">>$DSTROM/res/xml/redirections.xml
cat $DSTROM/appendleftovers.tmp | while read thistmp; do
echo "</resource-redirections>" >> $thistmp
done
rm $DSTROM/appendleftovers.tmp
echo "FINISHED:::::::::::::::::::::::::::::::::::::::::::::::::::::::"
reserved for spam

Boot Process research based on 2.2.3 Verizon WebDoctor

WIP research into HP Pre* boot process
Theoretical plan: port user-part to compatible droid - Pre3["rib"/"mantaray"]->XperiaRay["ST18i"]
Well, upstart scripts are complete... now for tracking dbus/luna services that are needed for the port to run..
Kernel configs:
linux-*/arch/arm/configs/rib_defconfig = pre3
linux-*/arch/arm/configs/semc_urushi_defconfig = xperia_ray
Device highlights:
sony: CONFIG_INPUT_APDS9702 (proximity filter)
sony: CONFIG_MDDI_NOVATEK_PANEL_SHARP_LS033T3LX01 (sharp display)
sony: CONFIG_MDDI_NOVATEK_PANEL_TMD_LT033MDV1000 (tmds controller)
sony: CONFIG_SND_MSM_MVS7x30_SOC (integrated audio)
sony: CONFIG_TI1271 (wifi)
sony: CONFIG_TOUCHSCREEN_CLEARPAD_I2C (synaptics clearpad)
palm: CONFIG_MT9P013 (5MP cmos)
palm: CONFIG_PMIC8058_UPL (qualcomm power management)
palm: CONFIG_SND_SOC_WM8994 (wolfson micro, 24bit 4-chan dac, 2-chan adc, 100dB SNR, Nice !)
palm: CONFIG_TOUCHSCREEN_CY8CTMA300 (cypress)
palm pre3 = "rib" or "mantaray"
WIFI: Pre3 -> Atheros 6K ar6000 driver = ar6k, non-upstream!, hardcoded in PmWifiService
Pre(1) -> Marvell sd8686 sd8xxx driver
Seems the biggest problem will be porting the WiFi manager, to make TexasInstruments 1271 look like an Atheros 6k series..
palm devices:
castle == Pre
pixie == Pixi ?
broadway == Pre2?
mantaray == Pre3
windsornot
topaz == TouchPad
opal
What do EVT1 EVT2 EVT3 / DVT1 DVT2 DVT3 mean ?
What are "opal" and "windsornot" devices ?
actual bootup code
Code:
/sbin/mkbootfs.sh -- or/and -- /sbin/tcpostflash.sh
for initrd...
cp /sbin/boot-init /sbin/init
/sbin/boot-init
echo "Mounting proc filesystem"
mount -t proc none /proc
echo "Mounting sysfs filesystem"
mount -t sysfs none /sys
echo "Creating /dev"
mount -t tmpfs -o mode=0755 none /dev
echo "Creating/Mounting /dev/pts"
mkdir /dev/pts
mount -t devpts -o gid=5,mode=620 none /dev/pts
mknod /dev/null c 1 3
mknod /dev/zero c 1 5
mknod /dev/systty c 4 0
mknod /dev/tty c 5 0
mknod /dev/console c 5 1
mknod /dev/ptmx c 5 2
mknod /dev/fb c 29 0
mknod /dev/tty0 c 4 0
mknod /dev/tty1 c 4 1
mknod /dev/tty2 c 4 2
mknod /dev/tty3 c 4 3
mknod /dev/tty4 c 4 4
mknod /dev/tty5 c 4 5
mknod /dev/tty6 c 4 6
mknod /dev/tty7 c 4 7
mknod /dev/tty8 c 4 8
mknod /dev/tty9 c 4 9
mknod /dev/tty10 c 4 10
mknod /dev/tty11 c 4 11
mknod /dev/tty12 c 4 12
mknod /dev/ttyS0 c 4 64
mknod /dev/ttyS1 c 4 65
mknod /dev/ttyS2 c 4 66
mknod /dev/ttyS3 c 4 67
mknod /dev/urandom c 1 9
mknod /dev/mmcblk0 b 179 0
mknod /dev/mmcblk0p1 b 179 1
mknod /dev/mmcblk0p2 b 179 2
mknod /dev/mmcblk0p3 b 179 3
mknod /dev/mmcblk0p4 b 179 4
mknod /dev/mmcblk0p5 b 179 5
mknod /dev/mmcblk0p6 b 179 6
mknod /dev/mmcblk0p7 b 179 7
mknod /dev/mmcblk0p8 b 179 8
mknod /dev/mmcblk0p9 b 179 9
mknod /dev/mmcblk0p10 b 179 10
mknod /dev/mmcblk0p11 b 179 11
mknod /dev/mmcblk0p12 b 179 12
mknod /dev/mmcblk0p13 b 179 13
mknod /dev/mmcblk0p14 b 179 14
mknod /dev/mmcblk0p15 b 179 15
lvm.static vgscan --ignorelockingfailure
lvm.static lvchange -ay --ignorelockingfailure /dev/mapper/store-root
mount -o ro /dev/mapper/store-root /realroot
/sbin/pivot_root /realroot /realroot/boot
umount /boot/dev/pts
umount /boot/dev
umount /boot/proc
umount /boot/sys
export EARLY_BOOT_STOP=`date -U`
exec /sbin/init
/sbin/init
/sbin/upstart -s /usr/sbin/setcpushares-upstart
(setcpusharesupstart sets up cgroup for every new task,
based with /etc/default/cpushareholder)
upstart config from dir <- /etc/event.d
upstart emits "startup" ->
/etc/event.d/rcS is started
telinit 2 -> emit "runlevel 2"
emit "stopping/stopped rcS"
"runlevel 2" -> /etc/event.d/banner
/etc/init.d/banner start
echo "Please wait: booting..." > $vtmaster
emit "stopping/stopped banner"
"stopped banner" -> /etc/event.d/sysfs
/etc/init.d/sysfs.sh start
mount -t proc proc /proc
mount sysfs /sys -t sysfs
echo 1 > /proc/sys/vm/oom_dump_tasks
emit "stopping/stopped sysfs"
"stopped sysfs" -> /etc/event.d/udev
/etc/init.d/udev start
mountpoint -q /dev/
echo "Starting the hotplug events dispatcher" "udevd"
## not loading as no /etc/event.d/udevd
# udevd --daemon
mkdir -p /dev/.udev/ /dev/.udev/db/ /dev/.udev/queue/ /dev/.udevdb/
make_extra_nodes (based on /etc/udev/links.conf)
echo "Synthesizing the initial hotplug events"
udevtrigger --subsystem-nomatch=platform --subsystem-nomatch=backlight
echo "Waiting for /dev to be fully populated"
udevsettle --timeout=$udevd_timeout
chmod 1777 /dev/shm
emit "stopping/stopped udev"
"stopped udev" -> /etc/event.d/alignment
echo "3" > /proc/cpu/alignment
emit "stopping/stopped alignment"
"stopped alignment" -> /etc/event.d/modutils
/etc/init.d/modutils.sh start
echo "Calculating module dependencies ..."
depmod -Ae
echo -n "Loading modules: "
foreach $module $args in /etc/modules
modprobe $module $args
emit "stopping/stopped modutils"
"stopped modutils" -> /etc/event.d/cgroups
. /etc/default/cpushareholder
cpushareholder_init
mkdir -p /dev/cpuacct
mount -t cgroup -o cpu,cpuacct none /dev/cpuacct
mkdir -p /dev/cpuacct/UX/APP
mkdir -p /dev/cpuacct/REST/BG
...
echo 7500 > /dev/cpuacct/UX/cpu.shares
echo 2500 > /dev/cpuacct/REST/cpu.shares
for $taskid in /dev/cpuacct/tasks
echo $taskid > /dev/cpuacct/REST/DAEMONS
emit "stopping/stopped cgroups"
"stopped cgroups" -> /etc/event.d/mountall
/etc/init.d/mountall.sh start
. /etc/default/rcS
. /etc/default/mount_checks
MOUNT_STAMP=/var/umount.stamp
WIPE_FLAGS_FILE=/var/.flags/on_mount
echo "$0: Mounting local filesystems..."
lvm.static vgscan --ignorelockingfailure
lvm.static vgchange -ay --ignorelockingfailure
echo "$0: vgscan/vgchange done" > /dev/kmsg
fsck -y -v /dev/mapper/store-root/var 2>&1 #/var with /dev/store
#fsck -y -v /dev/mmcblk0p3 2>&1 #/var without /dev/store
echo "$0: fsck of /var done" > /dev/kmsg
mount -a -t nonfs,vfat,ext3,tmpfs
# means NOnfs,NOvfat,NOext3,NOtmpfs: man mount
mount /var
if "mount /var" errors, do fixup:
/usr/sbin/fixup_partition.sh --mountpoint /var
umount -f /dev/mapper/store-var # up to 5 times in a loop
fsck -y /dev/mapper/store-var
mount /dev/mapper/store-var
echo "$0: /var mounted" > /dev/kmsg
clock_from_var.sh
hwclock -s -u #only do the following updates if hardware time is wrong
if (hw_time is wrong)
#date -S -s `date -d $(cat /etc/version) "+%s"`
date -S -s `cat /var/preferences/com.palm.power/time_saver`
echo "$0: set clock from $TIME_SRC: $(date)" > /dev/kmsg
hwclock -w -u
else
echo "$0: using /dev/rtc time: $(date)" > /dev/kmsg
lunaprop -n com.palm.system -m -s last_umount_clean [0|1 :/var/umount.stamp exists]
check that all /var/* are directories
if not_dir($path) rm -f $path;mkdir -p $path
if no_clean_mount() fixup_partition.sh --mountpoint /var/log --force-fsck
if exists /var/.rootfs_fsck fixup_partition.sh --device=/dev/mapper/store-media --force-fsck
rm -f /media/internal/FSCK*.REC # FAT lost blocks
rm -f /var/tmp; mkdir -p /var/tmp #reset /var/tmp as a directory and not a symlink
mount -a -t vfat,ext3,tmpfs #mount the automounted fs
echo "$0: rest mounted" > /dev/kmsg
check if everything mounted nicely. if not: fixup_partition.sh them
echo "$0: filesystem checking done" > /dev/kmsg
setup_cryptofs # based on /etc/cryptofs.conf, http://reboot78.re.funpic.de/cryptofs/
mkdir /media/internal/.palm
mountcfs -s /media/internal/.palm/.cryptofs -m /media/cryptofs -k /media/internal/.palm
cryptofs -o nonempty -o allow_other -s -r [params].. # based on .cryptofs
echo "$0: setup_cryptofs done" > /dev/kmsg
lunaprop -n com.palm.system -m -s media_fixed_how 1 # result from fixup_partitions on media partition
report reboot reasons: lines that start with "reason" in /var/umount.stamp
echo $REASON | rdx_reporter -F -C "rebooter" -c "rebooter" -d "$0"
rm -rf /var/lock/*
if any errors on "fsck /var"
echo "encountered error running fsck on /var: $VARFSCKRES $VARFSCK" \ ## res=error code, varfsck=output
| rdx_reporter -F -C "Fsck Error" -c "Fsck Error" -d "$Fsck error"
if error=4 (MAJOR ERROR) -> echo $error >/var/log/.fsck_error
date > /var/log/var_fsck.log
echo $VARFSCK >> /var/log/var_fsck.log ## last fsck output
... skipped developer-only rw rootfs stuff, reboting for rw-check and rm'ing /boot/uImage if error
touch /var/log/var_fsck.log /var/log/root_fsck.log
cat /var/log/var_fsck.log /var/log/root_fsck.log > /var/log/fsck.log
echo "$0: done reporting fsck results" > /dev/kmsg
run-parts /etc/init.d/postmountall.d:
check_initctl
if not_pipe(/dev/initctl) -> rm -f /dev/initctl; mknod -m 600 /dev/initctl p
keep_klog
cd /var/log
mv klog_1.txt.gz klog_2.txt.gz
klog last |gzip -c > klog_1.txt.gz # klog buffer from previous boot
dmesg -s 100000 | gzip -c > dmesg.txt.gz
kernel_lastboot
rdx_reporter $args ## nothing to report in clean case
lnsasetup
. /etc/default/lnsa.sh
mkdir -p /var/palm/system-services
mkdir -p /var/palm/ls2/roles
mkdir -p /var/palm/event.d
echo 'exec /bin/true' >/tmp/lnsa_marker
cp /tmp/lnsa_marker /var/palm/event.d/;msa_marker # actually, cp to tmp, sync, mv tmp real
rm /tmp/lnsa_marker
initctl newdir /var/palm/event.d ## add dir other than /etc/init.d to list, could trigger
logmods
mkdir -p /dev/logdir
mmc_protect
no "mmc_protect" binary => does nothing
report_lostandfound
for each path=("lost+found" dir) found on any mounted partition,
ls -lA $path | rdx_reporter ...
touch $path/_landf_rdxd_reported_marker_ ## so it doesn't report again
rm_varlogtmp
rm -rf /var/log/temp
runlevel
touch /var/run/utmp
runlevel --set 2 ## might trigger something, but probably doesn't
scaling
echo ondemandtcl >/sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
kill -USR1 1 ## for bootloggerd ?
echo "$0 done" > /dev/kmsg
mkdir -p /var/preferences
chown root /var/preferences
chmod 777 /var/preferences
mkdir -p /var/home/root
mkdir -p /var/tmp
emit "stopping/stopped mountall"
"stopped mountall" -> swaphack, tokens, timezone, watchdogd
-> /etc/event.d/swaphack
/etc/init.d/swaphack.sh
if /var/swap -> rm /var/swap # using /dev/store/swap now !
if !/dev/store/swap
dd if=/dev/zero of=/dev/store/swap bs=100663296 count=1 # 96MB of swap
mkswap /dev/store/swap
echo cfq > /sys/block/mmcblk0/queue/scheduler
echo 6000 > /proc/sys/vm/dirty_expire_centisecs
swapon /dev/store/swap
emit "stopping/stopped swaphack" -> compcache
/etc/event.d/compcache
swapoff -a
sleep 1
modprobe xvmalloc
modprobe ramzswap memlimit_kb=25600 backing_swap=/dev/store/swap
sleep 3
swapon /dev/ramzswap0 -p 100
emit "stopping/stopped compcache" -> no listeners
-> /etc/event.d/timezone
no /usr/bin/tzset -> do nothing
emit "stopping/stopped timezone" -> no listeners
-> /etc/event.d/watchdogd
/sbin/watchdogd #respawn
talks to /dev/watchdog, pings every X seconds
emit "stopping/stopped watchdogd" -> no listeners
-> /etc/event.d/tokens
/sbin/tokens --mount #trenchcoat=storage flasher + tokens=fs-tokens supports omap24xx,omap34xx,msm,tegra
source: http://subversion.palm.com/main/nova/palm/trenchcoat/submissions/132.4/trenchcoat.c
reads /dev/tokens -> OEM Data:
ProductName,Modem,RAMSize,FlashSize,HwoRev,BToADDR,WIFIoADDR,ProdSN,ProductSKU
emit "stopping/stopped tokens" -> /etc/event.d/populate-volatile
/etc/init.d/populate-volatile.sh start
/sbin/popvol < /etc/default/popvol.d/* # actually, for file in `ls`...
/etc/default/popvol.d/00_core
mkdir|/var/backups|0|0|0755
mkdir|/var/cache|0|0|0755
mkdir|/var/lib|0|0|0755
mkdir|/var/lib/ipkg|0|0|0755
mkdir|/var/lib/misc|0|0|0755
mkdir|/var/lib/software|0|0|0755
mkdir|/var/lib/software/ModemFiles|0|0|0755
mkdir|/var/lib/software/SessionFiles|0|0|0755
mkdir|/var/lib/software/tmp|0|0|0755
mkdir|/var/lib/update|0|0|0755
mkdir|/var/local|0|0|02755
mkdir|/var/lock|0|0|01777
mkdir|/var/lock/subsys|0|0|0755
mkdir|/var/log|0|0|0755
mkdir|/var/run|0|0|0755
mkdir|/var/spool|0|0|0755
mkdir|/tmp|0|0|01777
touch|/var/run/utmp|0|0|0644
touch|/var/log/wtmp|0|0|0644
mknod|/dev/heap|0|0|1|5|020644
/etc/default/popvol.d/01_pulse
mkdir|/var/run/pulse|31|31|0755
/etc/default/popvol.d/02_jail
mkdir|/var/palm|0|0|0755
mkdir|/var/palm/jail|0|0|0755
mkdir|/var/palm/data|0|0|0755
emit "stopping/stopped populate-volatile" -> devpts, minicore2
-> /etc/event.d/minicore2 # everything disabled, so doing nothing much
echo "" > /proc/sys/kernel/minicore_pattern
echo "" > /proc/sys/kernel/core_pattern
emit "stopping/stopped minicore2" -> no listeners
-> /etc/init.d/devpts.sh start
mknod -m 666 /dev/ptmx c 5 2
mkdir -p /dev/pts
mount -t devpts devpts /dev/pts -ogid=5,mode=620 ## 5="tty", 600='mesg n' default
emit "stopping/stopped devpts" -> hostname
-> /etc/init.d/hostname.sh start
hostname -F /etc/hostname # "webos-device"
emit "stopping/stopped hostname" -> pmsyslogd, pmklogd, urandom, usbctrl
-> /etc/event.d/pmsyslogd #PmLogDaemon, logs to /var/log/messages
/usr/bin/pmsyslogd -z -f 6 -m # UTZ/C tstamp, usec resolution, monotonic
emit "stopping/stopped pmsyslogd" -> no listeners
-> /etc/event.d/pmklogd # logs to /var/log/pmklogd.log
/usr/bin/pmklogd -n -d 1 #startup delay=1sec, "-n"=run in foreground??
emit "stopping/stopped pmklogd" -> no listeners
-> /etc/event.d/urandom
/etc/init.d/urandom start
echo "Initializing random number generator..."
cat /var/lib/urandom/random-seed >/dev/urandom
emit "stopping/stopped urandom" -> no listeners
-> /etc/event.d/usbctrl
if usbnet enabled
/sbin/modprobe -q g_composite product=0x101 #0x103 for armv6l
else if novacom enabled
/sbin/modprobe -q g_composite product=0x8002 #0x8012 for armv6l
else #(normal)
/sbin/modprobe -q g_composite product=0x8004 #0x8012 for armv6l
emit "stopping/stopped usbctrl" -> networking
-> /etc/event.d/networking
/etc/init.d/networking start
ifup -a -f # /etc/network/interfaces - auto=lo,usb0:1
echo "done."
emit "stopping/stopped networking" -> bootmisc
=========== AT THIS STAGE, ONLY BOOTMISC THREAD EXECUTION CONTINUES ============
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-> /etc/init.d/bootmisc.sh start
if "OMAP3430" matches /proc/cpuinfo
echo 600000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
echo 500000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
## needs to be set twice, board bug
chmod 666 /dev/tty[p-za-e][0-9a-f]
chown root:tty /dev/tty[p-za-e][0-9a-f]
if /etc/ld.so.cache symlinks to /var/cache/ld.so.cache
/sbin/ldconfig -C /var/cache/ld.so.cache
else
rm -f /var/cache/ld.so.cache
emit "stopping/stopped bootmisc" -> novacomd, ls-hubd_private, ttyS2
-> /etc/event.d/ttyS2
/sbin/getty console 115200 vt100
-> /etc/event.d/novacomd
#no /var/gadget/novacom_enabled => do nothing
#otherwise: mkdir /dev/gadget; mount -tgadgetfs /dev/gadget; /sbin/novacomd
emit "stopping/stopped novacomd"
-> /etc/event.d/ls-hubd_private #ls=LunaService
/usr/bin/ls-hubd --conf /etc/ls2/ls-private.conf --pmloglib
# /home/reviewdaemon/projects/nova/oe/BUILD-mantaray/work/luna-service2-2.0.0-131.2/131.2/src/hub/conf.c
#/usr/bin/ls-monitor /usr/bin/LunaSysMgr js, using /tmp/com.palm.private_hub
# UGLY HACK!!!!: /sbin/initctl emit --no-wait %s-ready
/sbin/initctl emit --no-wait ls-hubd_private-ready
..emit "ls-hubd_private-ready" -> /etc/event.d/ls-hubd_public
"ls-hubd_private-ready" ->
-> /etc/event.d/ls-hubd_public
/usr/bin/ls-hubd --public --conf /etc/ls2/ls-public.conf --pmloglib
/sbin/initctl emit --no-wait ls-hubd_private-ready
..emit "ls-hubd_public-ready" -> finish, node_fork_server
..at some point.. emit "stopping/stopped ls-hubd_public" -> ls-hubd_public_watchdog
-> /etc/event.d/ls-hubd_public_watchdog
/usr/sbin/reboot_ls-hubd_if.sh ${EXIT_STATUS} ls-hubd_public
..at some point.. emit "stopping/stopped ls-hubd_private" -> ls-hubd_private_watchdog
-> /etc/event.d/ls-hubd_private_watchdog
/usr/sbin/reboot_ls-hubd_if.sh ${EXIT_STATUS} ls-hubd_private
=========== AT THIS STAGE, PRV/PUB LS ARE RUNNING AND ONLY ONE UPSTART SIGNAL thread REMAINS ============
continuation of upstart scripts after Luna Service hub is started
Code:
"ls-hubd_public-ready" (emitted using /sbin/initctl from within /usr/bin/ls-hubd)
-> finish, node_fork_server
-> /etc/event.d/node_fork_server
if memtotal from /proc/meminfo >524288 (512M)
mkdir -p /var/palm/node
touch /var/palm/node/fork
/usr/palm/nodejs/node --max_old_space_size=23068672 /usr/palm/nodejs/fork_server.js ## 23068672=22MB
/sbin/initctl emit --no-wait node_fork_server-ready
else /sbin/initctl emit node_fork_server-ready
emit "node_fork_server-ready" -> no listeners
..emit "stopping/stopped node_fork_server" -> no listeners
-> /etc/event.d/finish
# record upstart timing for boottime tracking.
# $EARLY_BOOT_PID is set in /sbin/boot-init, ran from /sbin/tcpostflash.sh, /sbin/mkbootfs.sh, /sbin/upstart
mkdir -p /tmp/misc-props
echo -n $EARLY_BOOT_PID > /tmp/misc-props/pids.early_start
echo -n $EARLY_BOOT_START > /tmp/misc-props/timing.early_start
echo -n $EARLY_BOOT_STOP > /tmp/misc-props/timing.early_stop
echo -n $UPSTART_STARTTIME > /tmp/misc-props/timing.upstart_begin
echo -n $$ > /tmp/misc-props/pids.upstart_finish
echo -n `date -U` > /tmp/misc-props/timing.upstart_finish
/etc/init.d/bootmark.sh start
echo (16_random_bytes_in_hex) > /var/log/bootmark
run-parts /etc/event.d/finish-poststart.d
/etc/event.d/finish-poststart.d/001-mountcrypt
/usr/bin/mountcrypt /dev/mapper/store-mojodb store-cryptodb /dev/mapper/store-filecache store-cryptofilecache
mount /var/db
mount /var/file-cache
/etc/event.d/finish-poststart.d/020-setup_jails
rm -f /etc/nojail
emit "stopping/stopped finish" ->
logctld, configurator, mojodb, powerlog, PmNetConfigManager, pulseaudio, LunaDownloadMgr,
eventreporter, powerd, rdxd, lnsawait, Qmuxd, bluetooth, fontconfig_cache, certstoreinit,
tempdb, qcomm_rmt_storage, keymanager, filecache, hidd, memchute, passthrud, ossinfo,
mediaserver, audiod, PmModemEfsLogger, extractfs, TelephonyInterfaceLayer
-> TelephonyInterfaceLayer (no listeners for stop signals)
exec /usr/bin/PmWsfDaemon -c /etc/til.d/tilwsf.conf # /usr/lib/libTelephonyInterfaceLayer.so, -c /etc/til.d/til.conf
#Src/Core/NativeHost/BladeLoaderDl.cpp:101 dlopen()
#Src/Core/NativeHost/BladeLoaderDl.cpp:373 Calling %s to create service blade
#Luna Type=LunaTelephony,LunaMessaging ServiceName=com.palm.telephony
#LaunchCodeExternalApp=com.palm.app.phonediag
#LaunchCodeExternalAppCodesCdma=786;3836;33284;3282;477;673;123;889;8378;3366;\
#..72346;633;8766;87633;2539;7738;66236;2833766;28337633;
#LaunchCodeExternalAppCodesGsm=786;
#LunaMessaging ServiceName=com.palm.messagingrouter Interface=LunaInterfaceSms
#services supported by the GSM phone
#THandlersGsm=ServiceStateGsm;ServiceCallGsm;ServiceSmsGsm;ServiceLbsGsm;ServiceAudioGsm;
#..ServiceDeviceUsageGsm;ServiceSsGsm;ServiceDeviceCfgGsm;ServiceDataGsm;
#PHandlers=ServiceSim;ServicePower;ServiceSpb;ServiceStk;
# sprint verizon bellmo chinatel
-> extractfs (no listeners for stop signals)
mkdir -p /var/luna/data/extractfs
/usr/bin/extractfs -f /var/luna/data/extractfs #something to do with image extraction
umount -f /var/luna/data/extractfs
-> PmModemEfsLogger (no stop listeners)
# no modem in /proc/cmdline for normal users => not doing anything, otherwise PmModemEfsLogger would log ramdump etc
-> audiod (no stop listeners)
/usr/sbin/audiod -n -1 # com.palm.audio version 368.49, uses /etc/audio/{a,b,c}/global.conf
#/home/reviewdaemon/projects/nova/oe/BUILD-mantaray/staging/
#..arm-none-linux-gnueabi/include/boost/dynamic_bitset/dynamic_bitset.hpp etc
-> mediaserver (no stop listeners)
ionice -c1 /usr/bin/mediaserver --gst-debug=1 # version 428.51, should have been --gst-debug-level=1
-> ossinfo (no stop listeners) #copies PDF to media partition
cp /usr/lib/ossinfo/Open\ Source\ Information.pdf /media/internal/Open\ Source\ Information.pdf
-> passthrud (no stop listeners) #com.palm.usbpassthrough
#/usr/bin/start-passthrud # would run if had /var/preferences/com.palm.usbpassthrough/passthrud.conf
-> memchute (no stop listeners)
echo "0,85,95,114,120" > /sys/module/lowmemnotify/parameters/thresholds_enter
echo "0,80,90,108,112" > /sys/module/lowmemnotify/parameters/thresholds_leave
/usr/sbin/memchute # kills top 5 memory-using-procs if >THRESHOLD when low on memory
-> hidd (no stop listeners)
mkdir -p /dev/cgroup/input
echo $$ > /dev/cgroup/input/tasks #current process id
/usr/bin/hidd -v -f /etc/hidd/HidPlugins.xml --output-syslog
#plugins: keypad,touchpanel,accelerometer,compass,proximity,lightg,AVrcp(bluetooth),inputdev
-> keymanager (no listeners)
/usr/bin/keymanager -c '{"log":{"appender":{"type":"syslog"},"levels":{"default":"warning","keymanager":"info"}}}'
#using /var/palm/data/keys.db, /var/palm/data/otakeys.db, 4809febfe1df7d2a108fddc388cdb29e
#.. store-cryptodb.key, store-cryptofilecache.key, /var/luna/data/.passcode, "please", "youdidntsaythemagicword"
#does sql-style db work: SELECT id,ownerID,keyID,data,keysize,type,scope,hash FROM keytable WHERE id = ?
#.. SELECT id FROM keytable WHERE ownerId LIKE ?
# "EJGlZxDhLvgXn+p/K9s8gQ==" (base64)
-> qcomm_rmt_storage (no listeners)
/usr/sbin/qcom_rmt_storage /dev/mmcblk0p7 /dev/mmcblk0p8
#uses /dev/rmt_storage, /boot/modem_fs1, /boot/modem_fs2
-> tempdb (no listeners)
#does nothing!
-> certstoreinit (no listeners)
mkdir -p /var/ssl/crl
zcat /etc/ssl/crl/*.gz >/var/ssl/crl/crl-bundle.crl
mkdir -p /var/ssl/trustedcerts
cd /var/ssl/trustedcerts && tar xzf /etc/ssl/certs/calinks.tgz
mkdir -p /var/ssl/public
echo '01' > /var/ssl/serial
mkdir -p /var/ssl/certs
mkdir -p /var/ssl/private
touch /var/ssl/index.txt
luna-send -n 1 luna://com.palm.certificatemanager/addcrl \
'{"url":"http://crl.palm-contentid.pp.trustcenter.de/crl/v2/palmcontentid-CA-I.crl"}'
-> bluetooth (no listeners)
/usr/bin/BluetoothMonitor
-> Qmuxd (no listeners)
/usr/bin/Qmuxd #RMNET qmi connection
-> lnsawait (no listeners)
# "preventing started event from going out" ?
initctl status lnsa_marker
if no status -> loop. otherwise return ok
# should return nonzero since /var/palm/event.d was added to initctl dirs previously
# during mountall->mountall.sh->postmountall.d/lnsasetup
-> rdxd (no listeners)
/usr/bin/rdxd -s #Remote Diagnostics (incl. Telephony)
#uses /etc/rdxd.conf, /usr/lib/rdxd/*.sh scripts
-> powerd (no listeners)
mkdir -p /var/preferences/com.palm.power
cp /usr/var/preferences/com.palm.power /var/preferences/com.palm.power #use cp tmp;sync;mv tmp real
#config /sys/ parameters for PM on msm8x60, not applicable to phones
#for other devices seems there's nothing extra to do
-> eventreporter (no listeners)
/usr/bin/eventreporterserver #uses /tmp/evts.sock, /tmp/events.dat, JSON messages
-> LunaDownloadMgr (no listeners)
mkdir -p /dev/cgroup/web
echo $$ >/dev/cgroup/web/tasks # puts current process into web cgroup, later done with setcpushares-task
env CHARSET="UTF-8" /usr/bin/LunaDownloadMgr # ionice -c 3 on TouchPad (topaz)
# palm://com.palm.connectionmanager/setnovacommode {"isEnabled":true, "bypassFirstUse":false}
# palm://com.palm.connectionmanager/getStatus {"subscribe":true}
# palm://com.palm.bus/signal/registerServerStatus {"serviceName":"com.palm.connectionmanager", "subscribe":true}
# palm://com.palm.lunabus/signal/addmatch {"category":"/storaged", "method":"MSMAvail"}
# .. {"category":"/storaged", "method":"MSMProgress"}
# .. {"category":"/storaged", "method":"MSMEntry"}
# .. {"category":"/storaged", "method":"MSMFscking"}
# uses curl for downloads, /etc/palm/downloadManager.conf, /etc/palm/downloadManager-platform.conf
# logs into db: "DELETE FROM DownloadHistory WHERE owner = %", "DELETE FROM DownloadHistory WHERE ticket = %lu"
-> powerlog (no listeners)
/usr/sbin/powerlog -i 60 -c $CPUCOUNT -f $FREQ_COUNT -m
# cpucount = cpus, freq_count=number of freqs, -i60=60seconds, -m=topmemusers
-> mojodb (no listeners)
/usr/bin/mojodb-luna -c /etc/palm/mojodb.conf /var/db #version 1.9-52.16-mantaray, using /tmp/mojodb/tempdb_init
-> logctld (no listeners)
/usr/bin/logctld -v
#GPS: /var/log/gpsfixes, /var/log/gpsfixes_*.csv
#calls /sbin/logctld_clear_all.sh, /sbin/logctld_collect_all.sh
#palm://com.palm.service.collectlogs/autosend
-> pulseaudio
mkdir -p /home/root/.pulse
ionice -c1 /usr/bin/pulseaudio --log-target=syslog
#uses /etc/pulse/system.pa , /etc/pulse/default.pa, /etc/pulse/daemon.conf, /usr/lib/pulse-0.9.22/modules
#compiled using: /home/reviewdaemon/projects/nova/oe/BUILD-mantaray/staging/arm-none-linux-gnueabi/include
#.. -fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 -fno-strict-aliasing
#.. -fno-inline-functions -g -ffast-math -D_FORTIFY_SOURCE=2 -fno-common -fdiagnostics-show-option
emit "started pulseaudio" -> systemsoundsloader
->> systemsoundsloader (no listeners)
/usr/bin/systemSoundsLoader #loadSystemSounds from /usr/share/systemsounds/* or *-ondemand.pcm
-> fontconfig_cache
ionice -c 3 nice -n 20 fc-cache #run cache rebuild as nicely as possible
touch /var/cache/fontconfig/cached
emit "stopped fontconfig_cache" -> browserserver, smartkey
->>smartkey (no listeners)
mkdir -p /dev/cgroup/web
echo $$ > /dev/cgroup/web/tasks # this process goes into web cgroup
/usr/bin/SmartKeyService #SpellChecker - find best candidates based on dictionary, score map, frequency map
#uses XT9: /usr/palm/smartkey/XT9, /etc/palm/smartkey.conf
->>browserserver (no listeners)
export LD_PRELOAD="/usr/lib/libptmalloc3.so" #use custom malloc for browser
mkdir -p /dev/cgroup/web
echo $$ > /dev/cgroup/web/tasks # files this process into web control group
/usr/bin/BrowserServer #version 2.0.0-237.13, -d 30000 on TouchPad (topaz) +browserservermojo
#uses /var/luna/data/browser/icons, /var/palm/data/browser-cookies.db /dev/msm_vidc_dec /dev/pmem_adsp
chmod -R g+w /var/ssl
chown -R root.luna /var/ssl
chown luna:luna -R /var/palm/data/http_* /var/palm/data/https_*
chmod -R o+rwx /var/palm/data/http_* /var/palm/data/https_*
#conf from /etc/palm/browser-app.conf, /etc/palm/browser-app-platform.conf, /etc/ssl/openssl.cnf
-> filecache
/usr/bin/filecache -c {\"log\":{\"appender\":{\"type\":\"syslog\"},\"levels\":{\"default\":\"warning\"}}}
emit "started filecache" -> LunaSysService, LunaUniversalSearchMgr
->>LunaSysService
/usr/bin/LunaSysService
#uses /usr/lib/luna/customization/region.json, /etc/palm/region.json,
#.. /usr/lib/luna/customization/locale.txt, /etc/palm/locale.txt,
#.. /etc/palm/defaultPreferences.txt, /etc/palm/defaultPreferences-platform.txt
#.. /usr/lib/luna/customization/cust-preferences.txt, /etc/palm/CustomerCareNumber.txt
#.. /var/luna/preferences/systemprefs.db, systemprefs_backup.db
# does ntp time update from ntp0.palmws.com (ntpdate -bqu)
#.. /etc/palm/palm-customization-info
->>LunaUniversalSearchMgr (no listeners)
export LD_PRELOAD=/usr/lib/libmemcpy.so
/usr/bin/LunaUniversalSearchMgr
# addDBSearchItem/removeDBSearchItem, modifyActionProvider
# /usr/lib/luna/customization/resources/*/UniversalSearchList.json
# SELECT value FROM SearchPreference WHERE key=%Q
# CREATE TABLE IF NOT EXISTS SearchList (id TEXT, category TEXT, displayName TEXT, iconFilePath TEXT, url TEXT,
# suggestURL TEXT, launchParam TEXT, type TEXT, enabled INTEGER, version INTEGER, PRIMARY KEY(id, category) );
# CREATE TABLE IF NOT EXISTS DBSearchList (id TEXT PRIMARY KEY, category TEXT, displayName TEXT,
# iconFilePath TEXT, url TEXT, launchParam TEXT, launchParamDbField TEXT, dbQuery TEXT, displayFields TEXT,
# batchQuery INTEGER, enabled INTEGER, version INTEGER );
# CREATE TABLE IF NOT EXISTS SearchPreference (key TEXT NOT NULL ON CONFLICT FAIL UNIQUE ON CONFLICT REPLACE,
# value TEXT);
-> PmNetConfigManager
/usr/bin/PmNetConfigManager
#logs to /tmp/netconfigmanager.log
#interfaces with netfilter, iptables, enabling/disabling nat, routes, mtu clamping:
# /usr/sbin/iptables -D FORWARD -t mangle -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
# /usr/sbin/iptables -A FORWARD -t mangle -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
# /usr/sbin/iptables -t nat --flush
# RTSP: /usr/sbin/iptables -I INPUT -p udp --sport 6970:6999 -j ACCEPT
# mDNS: /usr/sbin/iptables -I OUTPUT -p udp -m udp --dport 5353 -o %s -j DROP
# NAT: /usr/sbin/iptables -t nat -I POSTROUTING -o %s -j MASQUERADE
# /sbin/dhclient -d -cf /etc/pmnetconfig/webOsDhclient.conf -sf /etc/pmnetconfig/webOsDhclient-script -lf -pf ..
# /usr/bin/ntpdate -uq %s pool.ntp.org
# traceroute,ping,arping, wifi authenticator,tether, /etc/pmnetconfig/staticroutes, novacom
# /sbin/sysctl -n -e -q -p /etc/pmnetconfig/netsysctrl.conf
# /sbin/ip rule flush; /proc/sys/net/ipv4/route/flush
emit "started PmNetConfigManager" -> mdnsd, PmWiFiService
->>mdnsd (no listeners)
/usr/sbin/mdnsd -debug # mDNSResponder-258.14, /etc/mdnsd.conf -> /var/log/mdnsd.log
# services url: http://www.dns-sd.org/ServiceTypes.html
->>PmWifiService (no listeners)
check if /dev/tokens/WIFIoADDR exists
/usr/bin/PmWiFiService
# hardwired for Atheros AR6000:
# insmod /lib/modules/`uname -r`/kernel/net/wifi/ar6000.ko || rmmod ar6000
# /tmp/ath6k/token_bdata.SD32.bin || /var/preferences/com.palm.wifi/skip-token-caldata
# ath6k/hw2.1.1/bdata.SD32.bin ath6k/hw2.1.1/3g_bdata.SD32.bin ath6k/hw2.1.1/lte_bdata.SD32.bin
# /lib/firmware/ath6k
# uses /usr/sbin/wpa_supplicant and hostapd
# /sbin/dhclient -cf /etc/PmWiFiDhclient.conf -sf /etc/PmWiFiDhclient-script -lf -pf /var/run/dhclient.eth0.pid
-> configurator
! luna-send -n 1 palm://com.palm.configurator/run '{"types":["dbkinds","filecache"]}' # triggers service launch?
! luna-send -n 1 palm://com.palm.configurator/run '{"types":["dbpermissions"]}' # triggers service launch?
initctl emit datastore-initialized
-> "datastore-initialized" -> /etc/event.d/activitymanager
->>activitymanager # manages activity lists, cgroup priorities
/usr/bin/activitymanager -c {\"log\":{\"appender\":{\"type\":\"syslog\"},\"levels\":{\"default\":\"warning\"}}}
/sbin/initctl emit activitymanager-ready
-> "activitymanager-ready" -> configurator-async, filenotifyd, UpdateDaemon
->>configurator-async (no listeners)
! luna-send -n 1 palm://com.palm.configurator/run '{"types":["activities"]}' #triggers service?
->>filenotifyd (no listeners)
ionice -c2 -n7 /usr/bin/filenotifyd
# create table if not exists files (path TEXT UNIQUE ON CONFLICT REPLACE,
# size INTEGER, modified INTEGER)
# create table if not exists actions (revision INTEGER PRIMARY KEY AUTOINCREMENT,
# action_type INTEGER, size INTEGER, modified INTEGER, path TEXT, new_path TEXT)
# insert into files (path, size, modified) values (?,?,?) // insert
# select size, modified from files where path=? // get
# delete from files where path=? // remove
# update files set path=? where path=? // rename
# select path, size, modified from files where path like ? // directory list
# insert into actions (action_type, size, modified, path, new_path) values (?,?,?,?,?)
# select revision, action_type, size, modified, path, new_path from actions
# where revision >= ? order by revision asc limit ?
# select count(*) from action
# delete from actions where revision < ?
->>UpdateDaemon (no listeners)
/usr/bin/UpdateDaemon
# mount /var/lib/update
# tar xvzf /var/lib/update/data.tar.gz -m --no-same-owner --no-same-permissions
# OmaDm [-set_domain|-client|-task|-server|-prepare]
# server: https://ps.palmws.com/palmcsext/swupdateserver
# curl proxy: 68.28.31.33:80 (sprint), headers
# Expect: Cache-Control: no-cache
# User-Agent: palm/1.0 // InitHeader ?
# User-Agent: HTTP SyncML Client [en] (WinNT; I)
# Accept-Language: en
# Accept: application/vnd.syncml.dm+xml
# Content-Type: application/vnd.syncml.dm+xml
# Accept-Charset: utf-8
# x-syncml-hmac: algorithm= , username=" ", mac=
# name: omadm.swupdate.palm.com
# password: serverguestpassword
# name: guest
# passwird: guestpassword
# extra ips: 68.28.15.12, 68.28.31.12, 63.168.238.41, 68.168.229.130
# /var/lib/update/PmUpdater // /usr/bin/PmUpdater exists
#/usr/bin/mmipkg, /sbin/tellbootie
! luna-send -n 1 palm://com.palm.configurator/run '{"types":["activities"]}' # triggers service launch?
emit "stopped configurator" -> LunaSysMgr, PmWanDaemon
->>PmWanDaemon (no listeners)
/usr/bin/PmWsfDaemon -c /etc/wan.d/wan.conf # load /usr/lib/libPmWsfWanBlade.so
# set up wan connection, check TETH-ENTITLEMENT
->>LunaSysMgr
emit "started LunaSysMgr" -> CustomizationService, firstuse-createDefaultAccount,
mediasyncexporter, pubsubservice, vpnremover-eventd
->> CustomizationService (no listeners)
luna-send -n 1 luna://com.palm.lunabus/signal/registerServerStatus '{"serviceName":"com.palm.systemservice","subscribe":true}'
# up to 3 times, 10sec retry, until "connected" in output
luna-send -n 1 luna://com.palm.service.customization/customize '{}'
# up to 4 times, 15sec retry, until "connected" in output
->> firstuse-createDefaultAccount (no listeners)
luna-send -n 1 palm://com.palm.accountservices/createNovaAccount '{"createDefaultAccount":true}'
->> mediasyncexporter (no listeners)
if exists /media/internal/iPod_Control # means there is media data to export
luna-send -i -n 1 palm://com.palm.activitymanager/create \
'{"start":true, \
"type":{"priority":"lowest"}, \
"activity":{"name":"mediasyncexporter", "description": "export media sync data to standard media files", \
"callback": {"method": "palm://com.palm.mediasyncexporter/export", "params": {}}}}'
->> pubsubservice (no listeners)
/usr/bin/pubsubservice #uses /var/pubsub/cache, /var/pubsub/pubsubhandlers.conf, /etc/palm/pubsub_handlers/
# most probably uses xmpp protocol, jabber server j005.palmws.com, http://jabber.org/protocol/pubsub#node_config
# docs here: http://xmpp.org/extensions/xep-0060.html
->> vpnremover-eventd (no listeners)
# ! removes the VPN Service App/Framework from App Catalog !
luna-send -n 1 palm://com.palm.appinstaller/remove '{"packageName": "com.palm.app.vpn"}'
luna-send -n 1 palm://com.palm.appinstaller/remove '{"packageName": "com.palm.app.vpnframework"}'
echo "1" > /proc/sys/vm/overcommit_memory
mkdir -p /var/luna/preferences
mkdir -p /dev/cgroups/ui /dev/cgroups/application /dev/cgroups/focused /dev/cgroups/unfocused \
/dev/cgroups/unfocused/none /dev/cgroups/unfocused/lowest /dev/cgroups/unfocused/low /dev/cgroups/unfocused/normal \
/dev/cgroups/unfocused/high /dev/cgroups/unfocused/highest
/bin/echo $$ > /dev/cgroups/ui/tasks
/bin/echo 18432 > /dev/cgroups/ui/cpu.shares
export LD_PRELOAD="/usr/lib/libptmalloc3.so"
/usr/bin/LunaSysMgr -s [if first-time, add "-u minimal -a com.palm.app.firstuse"]
# use /etc/palm/luna.conf /etc/palm/luna-platform.conf
# application paths defined:
# /var/luna/applications/ /var/palm/data/com.palm.appInstallService /media/cryptofs/apps
# usr/palm/applications usr/palm/packages usr/palm/services
# /media/cryptofs/apps/usr/lib/ipkg/info /media/cryptofs/tmp
# /usr/luna/launchpoints/ /var/luna/launchpoints/
# /usr/lib/luna/system/luna-systemui/ /usr/lib/luna/system/luna-applauncher/
# /usr/palm/sysmgr/images/ /usr/palm/sysmgr/localization /usr/palm/sysmgr-cust/localization
# /var/luna/preferences/
# /usr/palm/command-resource-handlers.json /var/usr/palm/command-resource-handlers-active.json
# SysMgr compiled against Qt 4.6.1, HW egl render mode
# /usr/bin/jailer -t -i %s (launching processes) with LD_PRELOAD libpvrtc.so
# deals with cards and card-processes/subsumers
/sbin/initctl emit first-use-finished
emit "first-use-finished" -> configurator (already ran)
/sbin/initctl emit --no-wait LunaSysMgr-ready
emit "LunaSysMgr-ready" -> LunaReady, tap2share
->> tap2share (no listeners)
/usr/sbin/tap2shared #/dev/a6_[0-9] or a23 device for transfers, topaz has back and rear A6
->> LunaReady
mkdir -p /dev/cgroups/application
/bin/echo $(pidof WebAppMgr) > /dev/cgroups/application/tasks
/bin/echo 2048 > /dev/cgroups/ui/cpu.shares
emit "started LunaReady" -> customization-install
->> customization-install
# call customization service to install any stub apps
luna-send -n 1 -a com.palm.service.customization palm://com.palm.service.customization/postFirstUseInstall '{}'
# hack to turn on wifi after first use the first time only
luna-send -n 1 -a com.palm.service.customization palm://com.palm.wifi/setstate '{ "state": "enabled" }'
# create a semaphore so that the app install and the wifi setting only ever run one time
touch /var/luna/data/Customization/postfirstuse_complete.txt
======================= UPSTART SCRIPTS END HERE =================================
--
luna-send uses liblunaservice.so which uses the previously-started ls-hub for message transfer
/var/preferences/com.palm.bus/public_bus_default
/tmp/com.palm.private_hub /tmp/com.palm.public_hub
HUB_INET_ADDRESS
192.168.2.101:4412 192.168.2.101:4411 127.0.0.1:4412 127.0.0.1:4411
com.palm.configurator = /usr/share/dbus-1/system-services/com.palm.configurator.service
TODO: d-bus/luna services statup...
silvioster said:
palm devices:
castle == Pre
pixie == Pixi ?
broadway == Pre2?
mantaray == Pre3
windsornot
topaz == TouchPad
opal
What do EVT1 EVT2 EVT3 / DVT1 DVT2 DVT3 mean ?
What are "opal" and "windsornot" devices ?
Click to expand...
Click to collapse
broadway = Veer
roadrunner = Pre2
opal = TouchPad Go (7 inch)
windsornot = never released device
EVT = early prototypes
DVT = later prototypes, close to production.
-- Rod
silvioster said:
WIFI: Pre3 -> Atheros 6K ar6000 driver = ar6k, non-upstream!, hardcoded in PmWifiService
Pre(1) -> Marvell sd8686 sd8xxx driver
Seems the biggest problem will be porting the WiFi manager, to make TexasInstruments 1271 look like an Atheros 6k series..
Click to expand...
Click to collapse
ar6k is upstream in the staging branch since 2.6.37 according this :
lxr.free-electrons.com/source/drivers/staging/ath6kl/htc2/AR6000/ar6k.c?v=2.6.37;a=arm

Tizen

As tizen source is available now I wondered if anyone has taken a look at it yet.
I prepared my machine to start building it and test it.
Will publish updates in this thread.
Sent from my GT-I9300 using xda premium
Another mobile OS. Like there isnt enough already.
Subscribe
Tapatalk 2-vel küldve az én GT-I9300-ről
As far as I have read the new phone with Tizen which Samsung will release (i9500) uses the i9300 modem.
Looking at the structure, used kernel etc now.
For building a kickstart file is used, it is looking like this:
Code:
# -*-mic2-options-*- -f loop [email protected]@-rs.tar.gz -*-mic2-options-*-
#
# Do not Edit! Generated by:
# kickstarter.py
#
lang en_US.UTF-8
keyboard us
timezone --utc America/Los_Angeles
# ROOT fs partition
#part / --size=800 --ondisk mmcblk0p --fstype=ext4 --label=platform
# Use larger partition for creation, and will be shrinked at last, workaround of libzypp bug
#part / --size=2000 --ondisk mmcblk0p --fstype=ext4 --label=platform
# DATA partition
#part /opt/ --size=1800 --ondisk mmcblk0p --fstype=ext4 --label=data
# ROOT fs partition
part / --size=1700 --ondisk mmcblk0p --fstype=ext4 --label=platform
# DATA partition
part /opt/ --size=3000 --ondisk mmcblk0p --fstype=ext4 --label=data
# UMS partition
part /opt/media/ --size=300 --ondisk mmcblk0p --fstype=vfat --label=ums
rootpw tizen
bootloader --timeout=0 --append="rootdelay=5"
desktop --autologinuser=root
user --name root --groups audio,video --password ''
repo --name=Tizen-main --baseurl=https://download.tizen.org/snapshots/trunk/common/@[email protected]/repos/main/armv7l/packages/ --save --ssl_verify=no
repo --name=Tizen-base --baseurl=https://download.tizen.org/snapshots/trunk/common/@[email protected]/repos/base/armv7l/packages/ --save --ssl_verify=no
%packages
@tizen-c210
@tizen-bootstrap
-glib2-static
-gettext-tools
-eglibc-utils
-imake
-giflib-utils
-brcm-gps-daemon
-insserv
%end
%prepackages
libgcc
eglibc
sqlite
zlib
libpython
libdlog
libcap
libattr
default-files-slp
busybox
python-base
libacl
glib2
tzdata-slp
vconf
libxml2
heynoti
openssl
shared-mime-info
libudev
security-server
dbus-libs
cert-svc
libsecurity-server-client
%end
%post
echo 'kickstart post script start'
if [ -d /etc/init.d ]; then
cp /etc/init.d/* /etc/rc.d/init.d/ -rdf
fi
rm -rf /etc/init.d*
ln -sf /etc/rc.d/init.d /etc/init.d
# Without this line the rpm don't get the architecture right.
echo -n 'armv7l-meego-linux' > /etc/rpm/platform
ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N ""
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ""
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ""
ail_initdb
/opt/apps/com.samsung.menu-screen/bin/menuscreen_initdb
cat > /usr/bin/press << EOF
#!/bin/sh
JUNK="SLP"
[ "\$1" ] && TIMEOUT="\$1" || TIMEOUT="1"
echo "Press return key to stop scripts"
read -t \$TIMEOUT JUNK
exit \$?
EOF
chmod +x /usr/bin/press
ln -s /opt/etc/X11/xkb /usr/share/X11
echo "UDEV_PERSISTENT_STORAGE=no" >> /etc/sysconfig/udev
rm -rf /usr/include
rm -rf /usr/share/man
rm -rf /usr/share/doc
MAJOR="2"
MINOR="0"
cat >/etc/info.ini <<EOF
[Version]
Major=$MAJOR;
Minor=$MINOR;
Build=TIZEN_`date +%Y%m%d`_1;
Order=;
[Build]
Date=`date +%Y.%m.%d`;
Time=`date +%H:%M:%S`;
EOF
ln -sf /etc/info.ini /opt/etc/info.ini
ln -sf /etc/info.ini /usr/etc/info.ini
mkdir -p /home/app
cp -a /etc/skel/.e /home/app/
chown -R 5000:5000 /home/app
chmod 0755 /home/app
chown -R 5000:5000 /opt/home/app
chmod 0755 /opt/home/app
cat > /usr/lib/systemd/system/usb-debug.service << EOF
[Unit]
Description=Start usb networking for debugging
ConditionPathExists=/sys/devices/platform/usb_mode/UsbMenuSel
[Service]
Type=oneshot
RemainAfterExit=yes
Environment=PATH=/bin:/sbin
ExecStart=/bin/bash -c 'echo 4 > /sys/devices/platform/usb_mode/UsbMenuSel'
ExecStart=/sbin/ifconfig usb0 192.168.129.3 netmask 255.255.255.0
ExecStop=/bin/bash -c 'echo 0 > /sys/devices/platform/usb_mode/UsbMenuSel'
#
# We now don't launch this USB mode hack by default. If you need that, run this:
# systemctl enable usb-debug.service
# or create a link manually like below:
# ln -s ../usb-debug.service /usr/lib/systemd/system/basic.target.wants/usb-debug.service
#
[Install]
WantedBy=basic.target
EOF
# required for the connman systemd service
cat > /etc/sysconfig/connman << EOF
OPTIONS="-W wext"
EOF
# required for the wpa_supplicant systemd service
cat > /etc/sysconfig/wpa_supplicant << EOF
OPTIONS="-Dwext"
EOF
ldconfig
rpm --rebuilddb
echo 'kickstart post script end'
%end
%post --nochroot
%end
News ?
It is nice Android to have competition but from what I saw on youtube Tizen is just android stuck at version 2.3. Is there anything new except that there will be no native apps?
gud to here that
now wating for ur good work

SM-T230NU - Generate .config used by a running a kernel

Is it possible to create a new kernel config file used by the running kernel for the SM-T230NU? If so, what are the steps to create one? The reason I am asking is I want to use the .config file to create a Kernel module. The module is LiME.ko and it is used to acquire the tablet's memory image which I use for forensic analysis. The challenge is that default Samsung Kernels/ROM's do not appear to come with a kernel .config file.
Your help is appreciated.
Thanks,
http://opensource.samsung.com/reception/receptionSub.do?method=sub&sub=F&searchValue=SM-T230
-> arch/arm/config
https://github.com/GalaxyTab4/andro...h/arm/configs/pxa1088_degaswifi_eur_defconfig
-> my GitHub
checking for ikconfig
->
Code:
#!/bin/sh
# ----------------------------------------------------------------------
# extract-ikconfig - Extract the .config file from a kernel image
#
# This will only work when the kernel was compiled with CONFIG_IKCONFIG.
#
# The obscure use of the "tr" filter is to work around older versions of
# "grep" that report the byte offset of the line instead of the pattern.
#
# (c) 2009,2010 **** Streefland <****@streefland.net>
# Licensed under the terms of the GNU General Public License.
# ----------------------------------------------------------------------
cf1='IKCFG_ST\037\213\010'
cf2='0123456789'
dump_config()
{
if pos=`tr "$cf1\n$cf2" "\n$cf2=" < "$1" | grep -abo "^$cf2"`
then
pos=${pos%%:*}
tail -c+$(($pos+8)) "$1" | zcat > $tmp1 2> /dev/null
if [ $? != 1 ]
then # exit status must be 0 or 2 (trailing garbage warning)
cat $tmp1
exit 0
fi
fi
}
try_decompress()
{
for pos in `tr "$1\n$2" "\n$2=" < "$img" | grep -abo "^$2"`
do
pos=${pos%%:*}
tail -c+$pos "$img" | $3 > $tmp2 2> /dev/null
dump_config $tmp2
done
}
# Check invocation:
me=${0##*/}
img=$1
if [ $# -ne 1 -o ! -s "$img" ]
then
echo "Usage: $me <kernel-image>" >&2
exit 2
fi
# Prepare temp files:
tmp1=/tmp/ikconfig$$.1
tmp2=/tmp/ikconfig$$.2
trap "rm -f $tmp1 $tmp2" 0
# Initial attempt for uncompressed images or objects:
dump_config "$img"
# That didn't work, so retry after decompression.
try_decompress '\037\213\010' xy gunzip
try_decompress '\3757zXZ\000' abcde unxz
try_decompress 'BZh' xy bunzip2
try_decompress '\135\0\0\0' xxx unlzma
try_decompress '\211\114\132' xy 'lzop -d'
try_decompress '\002\041\114\030' xyy 'lz4 -d -l'
# Bail out:
echo "$me: Cannot find kernel config." >&2
exit 1
Thank you for getting back to me. You have been very helpful. I have a related question. How do I install the kernel I downloaded from the opensource.samsung site to my SM-T230NU?
I have created a kernel .config file from the downloaded kernel from the link you provided and subsequently generated a zImage file but I do not know how to create the ramdisk and boot.img. I tried installing the kernel using AnyKernel and Heimdall but it fails. Can you provide guidance or a tutorial on how to do this? I would rather not install a ROM. Only the kernel.
I really appreciate the help.
sub77 said:
http://opensource.samsung.com/reception/receptionSub.do?method=sub&sub=F&searchValue=SM-T230
-> arch/arm/config
https://github.com/GalaxyTab4/andro...h/arm/configs/pxa1088_degaswifi_eur_defconfig
-> my GitHub
checking for ikconfig
->
Code:
#!/bin/sh
# ----------------------------------------------------------------------
# extract-ikconfig - Extract the .config file from a kernel image
#
# This will only work when the kernel was compiled with CONFIG_IKCONFIG.
#
# The obscure use of the "tr" filter is to work around older versions of
# "grep" that report the byte offset of the line instead of the pattern.
#
# (c) 2009,2010 **** Streefland <****@streefland.net>
# Licensed under the terms of the GNU General Public License.
# ----------------------------------------------------------------------
cf1='IKCFG_ST\037\213\010'
cf2='0123456789'
dump_config()
{
if pos=`tr "$cf1\n$cf2" "\n$cf2=" < "$1" | grep -abo "^$cf2"`
then
pos=${pos%%:*}
tail -c+$(($pos+8)) "$1" | zcat > $tmp1 2> /dev/null
if [ $? != 1 ]
then # exit status must be 0 or 2 (trailing garbage warning)
cat $tmp1
exit 0
fi
fi
}
try_decompress()
{
for pos in `tr "$1\n$2" "\n$2=" < "$img" | grep -abo "^$2"`
do
pos=${pos%%:*}
tail -c+$pos "$img" | $3 > $tmp2 2> /dev/null
dump_config $tmp2
done
}
# Check invocation:
me=${0##*/}
img=$1
if [ $# -ne 1 -o ! -s "$img" ]
then
echo "Usage: $me <kernel-image>" >&2
exit 2
fi
# Prepare temp files:
tmp1=/tmp/ikconfig$$.1
tmp2=/tmp/ikconfig$$.2
trap "rm -f $tmp1 $tmp2" 0
# Initial attempt for uncompressed images or objects:
dump_config "$img"
# That didn't work, so retry after decompression.
try_decompress '\037\213\010' xy gunzip
try_decompress '\3757zXZ\000' abcde unxz
try_decompress 'BZh' xy bunzip2
try_decompress '\135\0\0\0' xxx unlzma
try_decompress '\211\114\132' xy 'lzop -d'
try_decompress '\002\041\114\030' xyy 'lz4 -d -l'
# Bail out:
echo "$me: Cannot find kernel config." >&2
exit 1
Click to expand...
Click to collapse

Categories

Resources