[Q] How to enable Diag Mode? - Asus Padfone X and S

I want to use QPST to unlock bands
But I have to enable Diag Mode first
I'v tried [setprop sys.usb.config diag,adb] [setprop persist.usb.eng 1] [echo 1 > /sys/class/android_usb/android0/enable]
but doesn't work...

windswoods said:
I want to use QPST to unlock bands
But I have to enable Diag Mode first
I'v tried [setprop sys.usb.config diag,adb] [setprop persist.usb.eng 1] [echo 1 > /sys/class/android_usb/android0/enable]
but doesn't work...
Click to expand...
Click to collapse
As far as I can tell you need a different pinout usb cable or something. Even in engineering mode and enabling diag mode does not work
I have tried everything I know and have come to the idea that the phones usb port has a different pinout for qcom usb and it is infact enabling. we can test this by flashing cm12 and trying to enable qcom usb. But I am not willing to go that far

tjsooley said:
As far as I can tell you need a different pinout usb cable or something. Even in engineering mode and enabling diag mode does not work
I have tried everything I know and have come to the idea that the phones usb port has a different pinout for qcom usb and it is infact enabling. we can test this by flashing cm12 and trying to enable qcom usb. But I am not willing to go that far
Click to expand...
Click to collapse
It sounds hard to do ..
I found this on the web:
on property:sys.usb.config=diag,adb
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 05C6
write /sys/class/android_usb/android0/idProduct 9025
write /sys/class/android_usb/android0/f_diag/clients diag
write /sys/class/android_usb/android0/f_serial/transports smd,tty
write /sys/class/android_usb/android0/f_rmnet/transports smd,bam
write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage
write /sys/class/android_usb/android0/enable 1
start adbd
setprop sys.usb.state $sys.usb.config
on property:sys.usb.config=diag,mdm,adb
stop adbd
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 05C6
write /sys/class/android_usb/android0/idProduct 9031
write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
write /sys/class/android_usb/android0/f_serial/transports hsic,tty
write /sys/class/android_usb/android0/f_serial/transport_names serial_hsic
write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic
write /sys/class/android_usb/android0/f_rmnet/transport_names rmnet_hsic
write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage
write /sys/class/android_usb/android0/enable 1
start adbd
setprop sys.usb.state ${sys.usb.config}
# Fusion 3 composition with diag_mdm and adb
on property:sys.usb.config=diag,diag_mdm,serial_hsic,serial_tty,rmnet_hsic,mass_storage,adb
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 05C6
write /sys/class/android_usb/android0/idProduct 9031
write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
write /sys/class/android_usb/android0/f_serial/transports hsic,tty
write /sys/class/android_usb/android0/f_serial/transport_names serial_hsic
write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic
write /sys/class/android_usb/android0/f_rmnet/transport_names rmnet_hsic
write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage
write /sys/class/android_usb/android0/enable 1
start adbd
setprop sys.usb.state ${sys.usb.config}
Powered by Gitiles
I try to use 'android terminal emulator' ,and then connect to PC
It appear a unknow device but I can't find driver for it..

windswoods said:
It sounds hard to do ..
I found this on the web:
on property:sys.usb.config=diag,adb
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 05C6
write /sys/class/android_usb/android0/idProduct 9025
write /sys/class/android_usb/android0/f_diag/clients diag
write /sys/class/android_usb/android0/f_serial/transports smd,tty
write /sys/class/android_usb/android0/f_rmnet/transports smd,bam
write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage
write /sys/class/android_usb/android0/enable 1
start adbd
setprop sys.usb.state $sys.usb.config
on property:sys.usb.config=diag,mdm,adb
stop adbd
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 05C6
write /sys/class/android_usb/android0/idProduct 9031
write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
write /sys/class/android_usb/android0/f_serial/transports hsic,tty
write /sys/class/android_usb/android0/f_serial/transport_names serial_hsic
write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic
write /sys/class/android_usb/android0/f_rmnet/transport_names rmnet_hsic
write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage
write /sys/class/android_usb/android0/enable 1
start adbd
setprop sys.usb.state ${sys.usb.config}
# Fusion 3 composition with diag_mdm and adb
on property:sys.usb.config=diag,diag_mdm,serial_hsic,serial_tty,rmnet_hsic,mass_storage,adb
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 05C6
write /sys/class/android_usb/android0/idProduct 9031
write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
write /sys/class/android_usb/android0/f_serial/transports hsic,tty
write /sys/class/android_usb/android0/f_serial/transport_names serial_hsic
write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic
write /sys/class/android_usb/android0/f_rmnet/transport_names rmnet_hsic
write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage
write /sys/class/android_usb/android0/enable 1
start adbd
setprop sys.usb.state ${sys.usb.config}
Powered by Gitiles
I try to use 'android terminal emulator' ,and then connect to PC
It appear a unknow device but I can't find driver for it..
Click to expand...
Click to collapse
Can you post the script file your using?

tjsooley said:
Can you post the script file your using?
Click to expand...
Click to collapse
I don't know how to use script file
I type it on 'android terminal emulator'
adb shell
su
stop adbd
echo 0 > /sys/class/android_usb/android0/enable
echo 1004 > /sys/class/android_usb/android0/idVendor
echo 631B > /sys/class/android_usb/android0/idProduct
echo 239 > /sys/class/android_usb/android0/bDeviceClass
echo 2 > /sys/class/android_usb/android0/bDeviceSubClass
echo 1 > /sys/class/android_usb/android0/bDeviceProtocol
echo tty > /sys/class/android_usb/android0/f_acm/acm_transports
echo diag,diag_mdm > /sys/class/android_usb/android0/f_diag/clients
echo acm,diag,mtp,adb > /sys/class/android_usb/android0/functions
echo 1 > /sys/class/android_usb/android0/enable 1
start adbd
setprop sys.usb.state diag,adb

Here is a script file from that code. it does change the driver type. I tried the modified htc diag drivers forcing them and it does not work so if this did put the phone is qcom mode we need to find the drivers. to run the script you need to copy it to the /data and using root explorer click on it and select execute you will need to adjust the permissions to allow exec first

tjsooley said:
Here is a script file from that code. it does change the driver type. I tried the modified htc diag drivers forcing them and it does not work so if this did put the phone is qcom mode we need to find the drivers. to run the script you need to copy it to the /data and using root explorer click on it and select execute you will need to adjust the permissions to allow exec first
Click to expand...
Click to collapse
I successfully installed the driver,but QPST still not connected to the phone..

windswoods said:
I successfully installed the driver,but QPST still not connected to the phone..
Click to expand...
Click to collapse
I am in the same spot

tjsooley said:
As far as I can tell you need a different pinout usb cable or something. Even in engineering mode and enabling diag mode does not work
I have tried everything I know and have come to the idea that the phones[QRCODE][/QRCODE] usb port has a different pinout for qcom usb and it is infact enabling. we can test this by flashing cm12 and trying to enable qcom usb. But I am not willing to go that far
Click to expand...
Click to collapse
I have tried to flash cm12(cm-12.1-20150417-NIGHTLY-t00n.zip),then use different script file. But when I do when the phone is not even connected to the computer, really strange.
Finally, I went back to the Android 4.4...

9002 is no diag port for QPST, forcing HTC modified drivers wont work here. It should be Asus's own Qualcomm Port ( if there is any ).
https://play.google.com/store/apps/details?id=com.afp_group.software&hl , install this apk to Asus phone and try to find any secret code ( dial pad combination ). I have found a couple of secret codes that opens diag port for QPST and installed them with Qualcomm's own drivers, Vivo Xplay 3s for example, in early days. Please do a backup, some of secret codes do hard reset to phone. Hope this helps.
PS: Try on stock rom please.
---------- Post added at 10:35 PM ---------- Previous post was at 10:28 PM ----------
windswoods said:
I have tried to flash cm12(cm-12.1-20150417-NIGHTLY-t00n.zip),then use different script file. But when I do when the phone is not even connected to the computer, really strange.
Finally, I went back to the Android 4.4...
Click to expand...
Click to collapse
Trying to install cm11 and the command "setprop sys.usb.config diag,adb, or setprop persist.usb.eng 1" might help too. No diag ports in Android 5 with those scripts ( commands ) as far as i know ( experianced it on Oneplus, works on Kitkat, nothing on Lolipop).

os_man said:
9002 is no diag port for QPST, forcing HTC modified drivers wont work here. It should be Asus's own Qualcomm Port ( if there is any ).
https://play.google.com/store/apps/details?id=com.afp_group.software&hl , install this apk to Asus phone and try to find any secret code ( dial pad combination ). I have found a couple of secret codes that opens diag port for QPST and installed them with Qualcomm's own drivers, Vivo Xplay 3s for example, in early days. Please do a backup, some of secret codes do hard reset to phone. Hope this helps.
PS: Try on stock rom please.
---------- Post added at 10:35 PM ---------- Previous post was at 10:28 PM ----------
Trying to install cm11 and the command "setprop sys.usb.config diag,adb, or setprop persist.usb.eng 1" might help too. No diag ports in Android 5 with those scripts ( commands ) as far as i know ( experianced it on Oneplus, works on Kitkat, nothing on Lolipop).
Click to expand...
Click to collapse
Done that their is none. I know asus uses the calculator to enable the factory test mode its possible their is a calc code to enable the diag port

I got it!
I got it!
I got a special Nandroid can turn on diag mode
Use Recovery to restore it.
And it contain some tools can turn diag mode
https://drive.google.com/file/d/0BwZ5B9Qa5muabG9vVTRfc2sxMG8/view?usp=sharing

windswoods said:
I got it!
I got a special Nandroid can turn on diag mode
Use Recovery to restore it.
And it contain some tools can turn diag mode
https://drive.google.com/file/d/0BwZ5B9Qa5muabG9vVTRfc2sxMG8/view?usp=sharing
Click to expand...
Click to collapse
Awesome! WHat about QPST? What kind of driver do we need? Can i use this to my Padfone S?

paleszgergo said:
Awesome! WHat about QPST? What kind of driver do we need? Can i use this to my Padfone S?
Click to expand...
Click to collapse
QPST works perfect,I successfully unlocked bands thant I can use 3G in my country.
I think padfone s is the same, but I didn't have padfone s , you can try.

windswoods said:
I got it!
I got a special Nandroid can turn on diag mode
Use Recovery to restore it.
And it contain some tools can turn diag mode
https://drive.google.com/file/d/0BwZ5B9Qa5muabG9vVTRfc2sxMG8/view?usp=sharing
Click to expand...
Click to collapse
What recovery do you use? CWM or TWRP or stock?

Could you post what you did in this rom to get qpat workong? I want to get ot working on padfrone s firmware
Sent from my ASUS_T00N using Tapatalk

tjsooley said:
Could you post what you did in this rom to get qpat workong? I want to get ot working on padfrone s firmware
Sent from my ASUS_T00N using Tapatalk
Click to expand...
Click to collapse
:good: yeah, the backup didnt work on padfone s

My step:
root
flash recovery (cwm6)
unlock bootloader
install padfone s rom
use recovery(cwm6) restore from sperial Nandroid backup
my deviceadfone x

windswoods said:
My step:
root
flash recovery (cwm6)
unlock bootloader
install padfone s rom
use recovery(cwm6) restore from sperial Nandroid backup
my deviceadfone x
Click to expand...
Click to collapse
Won't boot up. got CWM, unlocked BL, restored and then nothing happens

paleszgergo said:
Won't boot up. got CWM, unlocked BL, restored and then nothing happens
Click to expand...
Click to collapse
I do beleave his restore is padfone x firmware not s so you should need to boot cwm6 format everything then restore

Related

[Neo/Neo V] Qualcomm Diag Mode!

Hi guys,
I am looking for some info about how to enable Diag Mode, in order to get to the phone through QPST+QXDM. But until now, I got Nothing...
I read some post, but most of them refer to HTC devices. Does anybody knows if we can get connected to the Sony's Qualcomm Chipset? I am trying to do something similar to what ASCOM TEMS Invertigation kit does, but using Qualcomm environment.
Link Here!
Also this is the info that I have from Sony's Neo V chipset: Link Here!
Thanks!
Bonzi
http://forum.xda-developers.com/showthread.php?t=1248514
Maybe this?
JoHnNy08PL said:
http://forum.xda-developers.com/showthread.php?t=1248514
Maybe this?
Click to expand...
Click to collapse
Good info, but the path that it mentions is not available in my ROM, It also doesn't specify which Rom should we use. (I am using 4.0.4 Pureness)
adb shell, su, echo 1 > /sys/devices/virtual/usb_composite/modem/enable
[email protected]:/ # find / -iname *modem*
/system/usr/share/alsa/pcm/modem.conf
/sys/devices/virtual/android_usb/android0/f_modem >> /device >> Link a > /sys/devices/virtual/android_usb/android0/f_modem/device
/sys/class/android_usb/f_modem
/sys/module/smd_pkt/parameters/modem_wait_timeout
/sys/module/msm_rmnet/parameters/modem_wait
....
# find ./ -iname *enable*
./platform/chargalg/power_supply/chargalg/enable_monitoring_ambient_temp
./virtual/timed_output/vibrator/enable
./virtual/android_usb/android0/enable
....
I found the path in 2.3.4 but when I activated the adb link fails and I have to reboot the phone. Could it be because the BootLoader is Locked?
Any DEv that could help me ?
Also there is a Diag folder on /sys/devices/virtual/usb_composite/ folder. I changed the enable flag to 1 and the phone disconnect the adb session...
Thanks
Bonzi
bonzi22 said:
Good info, but the path that it mentions is not available in my ROM, It also doesn't specify which Rom should we use. (I am using 4.0.4 Pureness)
adb shell, su, echo 1 > /sys/devices/virtual/usb_composite/modem/enable
[email protected]:/ # find / -iname *modem*
/system/usr/share/alsa/pcm/modem.conf
/sys/devices/virtual/android_usb/android0/f_modem >> /device >> Link a > /sys/devices/virtual/android_usb/android0/f_modem/device
/sys/class/android_usb/f_modem
/sys/module/smd_pkt/parameters/modem_wait_timeout
/sys/module/msm_rmnet/parameters/modem_wait
....
# find ./ -iname *enable*
./platform/chargalg/power_supply/chargalg/enable_monitoring_ambient_temp
./virtual/timed_output/vibrator/enable
./virtual/android_usb/android0/enable
....
I found the path in 2.3.4 but when I activated the adb link fails and I have to reboot the phone. Could it be because the BootLoader is Locked?
Any DEv that could help me ?
Also there is a Diag folder on /sys/devices/virtual/usb_composite/ folder. I changed the enable flag to 1 and the phone disconnect the adb session...
Thanks
Bonzi
Click to expand...
Click to collapse
dears please explain about "adb shell, su, echo 1 > /sys/devices/virtual/usb_composite/modem/enable"
because in my case dont work, i have the same problem with you
Me too Suffering
while executing this
[email protected]:/ # find / -iname *modem*
gives
/system/framework/modemwarmup.jar
/sys/kernel/debug/smd/modem_err_f3
/sys/kernel/debug/smd/modem_err
/sys/kernel/debug/modem_notifier
/sys/module/smd_tty/parameters/modem_wait
/sys/module/msm_rmnet/parameters/modem_wait
/sys/fih_sw_info/fih_modem_crash_info
/data/data_test/modem_port_timeout
/data/data_test/modem_port_status
/data/dalvik-cache/[email protected]@[email protected]
/data/mlog/20160530_090325/modem_oemdbg_0_log.txt
/data/mlog/20160530_090325/modem_err_data_index01_log00.txt
/data/mlog/20160629_175250/modem_oemdbg_0_log.txt
/data/mlog/20160629_175250/modem_err_data_index01_log00.txt
/data/mlog/20160718_224803/modem_oemdbg_0_log.txt
/data/mlog/20160718_224803/modem_err_data_index01_log00.txt
/data/mlog/20160528_014415/modem_oemdbg_1_log.txt
/data/mlog/20160528_014415/modem_err_data_index01_log00.txt
/data/mlog/20160814_175808/modem_oemdbg_0_log.txt
/data/mlog/20160814_175808/modem_err_data_index01_log00.txt
/data/mlog/20160522_101125/modem_err_data_index01_log00.txt
/data/mlog/20160523_185156/modem_oemdbg_0_log.txt
/data/mlog/20160523_185156/modem_err_data_index01_log00.txt
and no such path shows in my phone (Sony ST21i, Android 4.0.4, MSM7225AA Chipset)

help for a script

hi all
i have an galaxy SIII
i am using script manager.
i want to write a script and i have 2 questions
- how to write a script who open an url with the web browser
- is there an function to send a ping to see if an local adress avalaible (192.168.1.X) if not avalaible is there an return error ?
(sorry to seem stupid but i am coming from windows and i am a bit lost for the moment )
thank u for giving me a your time
no suggestion ?
or advise
Google something like "android open browser from shell". You can do it using intents.
Also:
Code:
ping --help
this work in an script u put
am start -a android.intent.action.VIEW -n com.android.browser/.BrowserActivity http://www.google.fr
for chrome i find this
am start -a android.intent.action.VIEW -n com.android.chrome/.Main -d http://xxxxxxxx
but i not find for opera if someone have it
finally
opera =
am start -a android.intent.action.VIEW -n com.opera.browser/com.opera.Opera -d http://www.google.xxxx
hope this help someone
lol now i really need help coz i found nothing
i want to know which ip is reachable from 192.168.1.(1 to 9)
in a script to automate that and give me wish is reachable for use it in a command to browser.
(i know ping from terminal emulator but it's not what i am looking for)
forgive my english i hope you understand what i want ant hope too u help me with this
kondronaute said:
i want to know which ip is reachable from 192.168.1.(1 to 9)
in a script to automate that and give me wish is reachable for use it in a command to browser...
Click to expand...
Click to collapse
That's easy, check:
Code:
for var in {1..9}
do
echo "Looking for 192.168.1.$var..." #optional... jejeje
if ping 192.168.1.$var -c 1 > /dev/null
then
#Reachable, put here your command
else
#Unreachable, you can show an error here
fi
done
RoberGalarga said:
That's easy, check:
Code:
for var in {1..9}
do
echo "Looking for 192.168.1.$var..." #optional... jejeje
if ping 192.168.1.$var -c 1 > /dev/null
then
#Reachable, put here your command
else
#Unreachable, you can show an error here
fi
done
Click to expand...
Click to collapse
but ping command is not reconized by script manager i can only do it with terminal emulator ....
Really? I didn't know that (weird, BTW). Check if you need to use another command with Script Manager, or if you need to add something.
I dunno another way to achieve your goal... only using ping
lol i have a headeach with this and find nothing
RoberGalarga said:
Really? I didn't know that (weird, BTW). Check if you need to use another command with Script Manager, or if you need to add something.
I dunno another way to achieve your goal... only using ping
Click to expand...
Click to collapse
finally i have possibility to run ping you must just in option of script manager chek "override $PATH"
after 2 or 3 aspirin this work for me
#!/system/bin/sh
for i in $(seq 2 10);
do
host="192.168.1.$i"
ping -c 1 -W 1 $host > /dev/null &&
am start -a android.intent.action.VIEW -n com.android.browser/.BrowserActivity http://$host ;
done
i dont know why i have error with else and if with android shell ????
i thank u again for your help and hope the masters here help us a bit to understand, it's difficult coz there are differences with simple linux and this for french using windows :laugh:
Try if this help.
i have this kind of probleme http://forum.xda-developers.com/showthread.php?t=1045006
but i am usin the script manager editor on my phone !!!!!
i have not Windows EOL formatting
please if u are guru of busybox your help is needed to use if else and fi in a script.
must i download another version of busybox or add a command ????
i am fully rooted the path in script manager is good
edit = after trying and googleing
after if you must put [[your code without space before and after]] and after then (yourcode) :laugh:
hope i find the rest...
kondronaute said:
i have not Windows EOL formatting
Click to expand...
Click to collapse
Are you sure? Because if you have created the script in windows, you have that EOL formatting (whatever that means :silly. Try this:
Open Terminal Emulator, and type
Code:
echo "hello there" > /sdcard/newScript.sh
This will create a new and clean script in your SD Card.
Then, go to Script Manager, and edit that script. You can start deleting the text ("hello there") and adding this:
Code:
testvar=1
if [ "$testvar" = "1" ] ; then
echo "All is right"
fi
Ok, run the script. If you can see the text "All is right", that's it, problem solved
RoberGalarga said:
Are you sure? Because if you have created the script in windows, you have that EOL formatting (whatever that means :silly. Try this:
Open Terminal Emulator, and type
Code:
echo "hello there" > /sdcard/newScript.sh
This will create a new and clean script in your SD Card.
Then, go to Script Manager, and edit that script. You can start deleting the text ("hello there") and adding this:
Code:
testvar=1
if [ "$testvar" = "1" ] ; then
echo "All is right"
fi
Ok, run the script. If you can see the text "All is right", that's it, problem solved
Click to expand...
Click to collapse
you save my last neuron
thanks
edit =
my fault is i create a text file under windows (easier and can copy and past easily) after i put the file on my phone and copy past the code in a new script.
i not think that when i just copy past i past the EOL formatting ( i dont know what is that but its a bad thing )
that's mean i must abandon windows and migrate totally to linux
anyway that make me crazy and i am happy to sort it.
you are very helpfull many thanks again
new edit = i understand now why they say notepad++ is necessary

Starting adb on boot process? For debugging purposes...

Hi guys, i successfully build from scratch a device and vendor tree for my rom, and compile CM13 with no problems.
The roms boots but i get a bootloop when it come into "starting apps". My idea is get adb working on boot proccess.
I was googling but i couldn't get working....
This is my init.qcom.rc: https://drive.google.com/open?id=0ByjBTzGuQ9FIQldHTGxBWjdtczQ
And init.usb.rc generated by CM13: https://drive.google.com/open?id=0ByjBTzGuQ9FIc1ZVNnVpTVExOE0
Thanks
Well guy i was digging around and testing ALOT with no luck. Still can't enable adb at boot.
I try adding this properties on default.prop:
Code:
ro.adb.secure=0
ro.secure=0
ro.debuggable=1
persist.sys.usb.config=mtp,adb
An this in build.prop:
Code:
ro.default_usb_mode=0
persist.service.adb.enable=1
persist.service.debuggable=1
persist.sys.usb.config=mtp,adb
My device is a Forge TV, and it have a single usb port and no sdcard slot, so the only way to get a log is via usb...
In the stock rom, by default, starts in host mode (storage) and you have to go into config to change it into "device mode" to get usb adb working....
Probably i need to manage how the usb port starts at boot, i thought that "ro.default_usb_mode=0" was the solution...but no
Any help will be appreciated!
PS. lsusb doesn't recognize any device....only in fastboot mode
So i found out something interesting...in stock rom if i execute the command echo 0 > /proc/usb_device the device put itself in device mode and i can debug, putting that value to 1 reverts to storage.
I try to put that on init.d, or even on init.qcom.rc in the boot image with no luck....it's so frustating...
Ususally adbd should already be running this late during the boot.
Can you at least get an usb connection during boot? (check lsusb)
If you want to get at least a dmesg output during boot you could try the following:
set this in the build.prop
Code:
debug.sf.nobootanimation=1
set the following in your kernel defconfig
Code:
CONFIG_VGA_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y
(not all of them are needed but I forgot which ones are and which ones are not)
add this to the kernel command line
Code:
console=tty1 loglevel=7
This should at least show some output on the phone screen itself.
To run something in the console, you could try to connect an usb keyboard or use something like a scriptable virtual keyboard.
You might need to set loglevel to 1 or 0 if you don't want it to spam your console while working on it.
ruleh said:
Ususally adbd should already be running this late during the boot.
Can you at least get an usb connection during boot? (check lsusb)
If you want to get at least a dmesg output during boot you could try the following:
set this in the build.prop
Code:
debug.sf.nobootanimation=1
set the following in your kernel defconfig
Code:
CONFIG_VGA_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE=y
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y
(not all of them are needed but I forgot which ones are and which ones are not)
add this to the kernel command line
Code:
console=tty1 loglevel=7
This should at least show some output on the phone screen itself.
To run something in the console, you could try to connect an usb keyboard or use something like a scriptable virtual keyboard.
You might need to set loglevel to 1 or 0 if you don't want it to spam your console while working on it.
Click to expand...
Click to collapse
Hi, thanks alot for your answer! My device is a Razer Forge TV wich is an Android TV device. It's equiped with a single full usb 3.0 port and no sdcard slot. The port works in 2 ways, by default in host mode and device mode (the mode i need to get some debug output). In the stock rom executing "echo 0 > /proc/usb_device" enable this mode and remains on reboot. But doesn't seems to work on CM (i put the command on an init.d script). lsusb reports nothing (equal in stock rom when the port is in host mode).
I test the soluton you provided, but instead of bootanimation i get a black screen then optimizing apps, starting apps and reboot (wich is my main problem)....there's no output on screen...i'm stuck on this like 10 days or more...is so annoying...thanks again
achaw said:
Hi, thanks alot for your answer! My device is a Razer Forge TV wich is an Android TV device. It's equiped with a single full usb 3.0 port and no sdcard slot. The port works in 2 ways, by default in host mode and device mode (the mode i need to get some debug output). In the stock rom executing "echo 0 > /proc/usb_device" enable this mode and remains on reboot. But doesn't seems to work on CM (i put the command on an init.d script). lsusb reports nothing (equal in stock rom when the port is in host mode).
I test the soluton you provided, but instead of bootanimation i get a black screen then optimizing apps, starting apps and reboot (wich is my main problem)....there's no output on screen...i'm stuck on this like 10 days or more...is so annoying...thanks again
Click to expand...
Click to collapse
You could try to insert a usb stick, mount it, and then write dmesg and/or adb output to it using init.rc.
Alternatively you could try to enable adb over tcp and connect that way to it.
Alos try to chose a different tty in the kernel command line.
(btw are the following three lines present in your kernel defconfig?)
Code:
CONFIG_VT_CONSOLE=y
CONFIG_TTY=y
CONFIG_VT=y
ruleh said:
You could try to insert a usb stick, mount it, and then write dmesg and/or adb output to it using init.rc.
Alternatively you could try to enable adb over tcp and connect that way to it.
Alos try to chose a different tty in the kernel command line.
(btw are the following three lines present in your kernel defconfig?)
Code:
CONFIG_VT_CONSOLE=y
CONFIG_TTY=y
CONFIG_VT=y
Click to expand...
Click to collapse
I can't mount usb or enable adb over tcp becasuse the system reboot itself at starting apps...
Right now i'm testing with your new config, switching ttys because i'm still getting black screen instead some output...
Well after some days i remember that the Forge iss equipped with a ethernet port...i feel so stupid lol...
So i was able to debug via adb over tcp.... @ruleh thanks alot for your time!
I think "starting apps" happens when zygote is started.
If it is really the case then it should be possible to mount an usb stick and write the logs to it before everything reboots.
According to the init files I have, init.${ro.hardware}.rc would be the place to do the mount+write.
Ideally /system is mounted and /system/bin is in the path to access tools like logcat and dmesg.
Otherwise you could include them in /sbin which is (in most cases) part of the ramdisk.
It would probably be something like this:
Code:
on early-boot
#mkdir /mnt/usb
mount /dev/(usb_stick) /mnt/usb
exec /system/bin/dmesg > /mnt/usb/dmesg.log
exec /system/bin/logcat > /mnt/usb/logcat.log
(I have never used the init.rc files directly so I am not too sure.)
Also did you try "write /proc/usb_device 0" instead of "echo 0 > /proc/usb_device" in the init.rc files? (preferably before zygote starts...maybe init.usb.rc?)
Or you could try to remove the lines referencing zygote from the init.rc files and see if adbd starts then or not.
---------- Post added at 20:17 ---------- Previous post was at 20:16 ----------
achaw said:
Well after some days i remember that the Forge iss equipped with a ethernet port...i feel so stupid lol...
So i was able to debug via adb over tcp.... @ruleh thanks alot for your time!
Click to expand...
Click to collapse
I wish I read this a bit earlier...... oh well

Computer not detecting redmi note 4!!! after bootloader unlock!!???

hi guys,
i unlocked my bootloader yesterday and found out that my computer is not detecting my phone!! but it is chargin!
please tell me what should i do???
Device info:-
Redmi Note 4
snadragon 625
Add the following lines in your build.prop:
persist.service.adb.enable = 1
persist.sys.usb.config = mtp, adb
and enable USB debugging.
hamzaalijoiyah said:
Add the following lines in your build.prop:
persist.service.adb.enable = 1
persist.sys.usb.config = mtp, adb
and enable USB debugging.
Click to expand...
Click to collapse
thanks bro it worked
hamzaalijoiyah said:
Add the following lines in your build.prop:
persist.service.adb.enable = 1
persist.sys.usb.config = mtp, adb
and enable USB debugging.
Click to expand...
Click to collapse
where to paste these line in build.proop
lovewisher said:
where to paste these line in build.proop
Click to expand...
Click to collapse
at the bottom

[Linux] Porting native Linux to Galaxy Note9

This thread is about starting native Linux on Samsung Galaxy Note9. This isn't my first attempt to do such thing. The history looks like Galaxy Spica -> Galaxy J1 (2016) -> Galaxy Note9. So I know what I'm doing
Later I'll post instructions how to install and run it.
Note9 isn't my main device, so I won't work on dualboot. If some wants to make it, feel free to build dualboot (kexec) recovery and post it here.
Source code.
Kernel: https://github.com/LONELY-WOLF/crownlte-linux-os
First success
So, here is a first result.
With minor modifications to DECON (framebuffer) my Note9 is able to run Arch Linux form SD card.
So far it has no serial or USB console. I can't find a way to make UART JIG for Type-C Samsungs. USB gadgets are hardcoded and can't be easy changed to CDC ACM. This is not good and makes development harder.
Arch Linux says it started GUI but I don't know what happened to Xorg. It can be on back buffer or on another display (since Note9 has it via Type-C).
This would be awesome for me during pen testing?!
Def following!
Could install it on dualboot?
giorgior.r said:
Could install it on dualboot?
Click to expand...
Click to collapse
Yes, it's possible. As for now kernel is inside phone memory and root FS is on SD card.
There are two ways to install it alongside Android:
Flash Linux kernel as recovery. So when you try to enter recovery it'll boot into Linux. You lose recovery in this case.
Install special dualboot/kexec recovery and start Linux from recovery menu. (If someone will make such recovery for Note9)
All Linux files (except kernel) are on SD card. SD has following partition scheme:
Storage. That's what your Android sees as SD card. FAT32 or exFAT
Apps2SD. Is someone still using it? However this partition can be 1MB in size.
Linux rootfs. That's where Linux "ROM" lives.
So SD is also ready for daily use.
nice, have similar thing based on exynos-linux-stable and debian stretch wifi work but sound and usb not yet for me. how you enabled boot console? also need to swap red and blue channel because they are flipped on 24/32 bit colours
Sisah said:
nice, have similar thing based on exynos-linux-stable and debian stretch wifi work but sound and usb not yet for me. how you enabled boot console? also need to swap red and blue channel because they are flipped on 24/32 bit colours
Click to expand...
Click to collapse
For fbcon you need to patch decon driver. Take a look at my commits on GitHub.
Yes, RGB<->BGR is a common issue. I have it on J120F too. This hack work for J1. But it would be nice to find a source of the problem. I believe decon reports wrong color order.
WARNING! I had to disable fbcon on J1 because it messed up with Xorg.
Still no luck with USB. I try to configure it with configfs, but got error
Code:
Config c/1 of g1 needs at least one function
Looks like Samsung hardcoded something inside USB drivers.
Found out that USB configfs is heavily modified. That's the reason why Linux can't configure USB gadgets properly. Bring back compatibility seems to be a hard task.
ho ho ho... so long time im not play dualboot
sorry i have diferent question, i see on youtube, normal windows 10 work on lumia 950 and 950xl, what its that ?
Ce Doresti said:
ho ho ho... so long time im not play dualboot
sorry i have diferent question, i see on youtube, normal windows 10 work on lumia 950 and 950xl, what its that ?
Click to expand...
Click to collapse
Since I'm a Windows Phone hacker, I can answer your question
That project is very similar to what I do here. Starting from Windows Phone 8, phone OS and desktop one have one (NT) kernel. Just like Android and desktop Linux do. Windows you see on NL950 on YouTube is "Windows for ARM". It looks like desktop but it can't run normal Windows EXEs because of different processor architecture. Maybe it can run desktop .NET applications (I've made proof-of-concept EXE that worked on both Windows Mobile 5.0 and Windows XP) but I'm not sure.
Linux is a better way to get desktop OS on mobile device. Open source nature of most Linux software makes it possible to use almost any program on any processor architecture. Take a look at single board computers (like Raspberry Pi) if you want to see what Linux can do on ARM architecture.
I think win 10 for arm have integrated x86 emulator, so it probably launch nearly anything.
If i can have one more question. How you refreshing screen? Refresh rate is set to 0 and my every attempt to configure screen with fbset result in black screen and hard reset, so i must use infinite loop that send "1" to /sys/class/graphics/fb0/rotate to refresh my screen
-W_O_L_F- said:
Since I'm a Windows Phone hacker, I can answer your question
That project is very similar to what I do here. Starting from Windows Phone 8, phone OS and desktop one have one (NT) kernel. Just like Android and desktop Linux do. Windows you see on NL950 on YouTube is "Windows for ARM". It looks like desktop but it can't run normal Windows EXEs because of different processor architecture. Maybe it can run desktop .NET applications (I've made proof-of-concept EXE that worked on both Windows Mobile 5.0 and Windows XP) but I'm not sure.
Linux is a better way to get desktop OS on mobile device. Open source nature of most Linux software makes it possible to use almost any program on any processor architecture. Take a look at single board computers (like Raspberry Pi) if you want to see what Linux can do on ARM architecture.
Click to expand...
Click to collapse
thank you !
I can see the potential of this project if things go according to your vision.. I will for sure donate you for your amazing effort
Interesting, is it more for the challenge itself or what's your goal?
Linux on Dex works great for me, it's missing a gui if you don't connect it to a display but you could probably trick it to believe that the phone screen is an external display.
Sisah said:
I think win 10 for arm have integrated x86 emulator, so it probably launch nearly anything.
If i can have one more question. How you refreshing screen? Refresh rate is set to 0 and my every attempt to configure screen with fbset result in black screen and hard reset, so i must use infinite loop that send "1" to /sys/class/graphics/fb0/rotate to refresh my screen
Click to expand...
Click to collapse
Since we use the same kernel can you share your work on GitHub too? Also I need all your current work on OS. What image you use? What modifications you made? It's a good idea for me to migrate to the same distro. This can speed up our work.
-W_O_L_F- said:
Since we use the same kernel can you share your work on GitHub too? Also I need all your current work on OS. What image you use? What modifications you made? It's a good idea for me to migrate to the same distro. This can speed up our work.
Click to expand...
Click to collapse
Here is my config files for debian.
https://www.mediafire.com/file/ccziy42yj2bn28x/LINUX.zip
(Include precompiled mtev driver from meefik https://github.com/meefik/xorg-input-mtev
Also it set wacom driver for spen to work
)
kernel .config
https://www.mediafire.com/file/czrct62638xpkhz/.config
And debian install cdrom
https://cdimage.debian.org/debian-cd/current/arm64/iso-cd/
installation was little tricky, need to install linuxdeploy compile kernel with atleast isofs, systemv-ipc, vt console, kernel automounter-v4, fanotify and raid-dm support and put it to recovery.img, then dd it to BOOT partition.
Now download debian-installer.iso, extract ramdisk.gz from him and reboot to modified recovery.
Here mount system, go to terminal, type linuxdeploy shell.
Now we must unpack ramdisk.gz from installer with abootimg or mkbootimg, mount debian-installer.iso to unpacked-ramdisk/cdrom and then we can chroot to installer ramdisk with chroot /unpacked-ramdisk /bin/ash
After that just type
./init
debian-installer-startup
debian-installer
Use sdcard as root partition and install.
After installing base system it probably fail to setup apt, so we must open terminal in setup program then
mount --bind /cdrom /target/media/cdrom (need to create that dir first)
then
chroot /target /bin/bash
apt-cdrom add
apt-get update
Now you can run tasksel and install desktop (kde xfce and gnome work but need lightdm for virtual keyboard on login)
(Here is nice place to copy those config files i posted and run install.sh, but also be sure to install lightdm and onboard keyboard, its not in my pack)
after that type exit few times until you get back to installer where you can finish installation.
Then need to compile kernel make initrd and create boot.img (can be done in linuxdeploy on android)
Also copy /vendor from phone to installed system then wifi start working and we can install from netinst-cd with little less trouble, or install to .img maybe even folder from internal_sdcard, its much faster than booting from memory card
Here is my fresh install of debian stretch and kde, only modification is in lightdm-gtk-greeter.conf, 40-libinput.conf, xorg.conf (not needed much), /usr/share/initramfs-tools/scripts/local (hardcoded root partition and loop .img for boot) and added framebuffer_refresh systemd service. To install just unpack .zip to root of /data (sda25) and flash linux-boot.img to boot partition.
Sound, USB, and 24bit colors are still broken, but maybe still better than linux on dex with some hardware graphics acceleration like panfrost driver it may be better than my pc
Root - 16GB .img after unpack
https://mega.nz/#!zeAA3KzY!vK5g2HtI0H3CD654wx40w14VstT6ktLX6tzNsUMWNoU
Boot.img
https://mega.nz/#!LCQB0QJK!YKTflwPsAJosaxr0Bqlu_9XtfgCFxkgNCmrbyNNaBvM
Login as sisah with password 123456, root password 123456, kde wallet password is set to 123456 too. Made on n960f dual sim.
Sisah said:
Here is my fresh install of debian stretch and kde, only modification is in lightdm-gtk-greeter.conf, 40-libinput.conf, xorg.conf (not needed much), /usr/share/initramfs-tools/scripts/local (hardcoded root partition and loop .img for boot) and added framebuffer_refresh systemd service. To install just unpack .zip to root of /data (sda25) and flash linux-boot.img to boot partition.
Sound, USB, and 24bit colors are still broken, but maybe still better than linux on dex with some hardware graphics acceleration like panfrost driver it may be better than my pc
Root - 16GB .img after unpack
https://mega.nz/#!zeAA3KzY!vK5g2HtI0H3CD654wx40w14VstT6ktLX6tzNsUMWNoU
Boot.img
https://mega.nz/#!LCQB0QJK!YKTflwPsAJosaxr0Bqlu_9XtfgCFxkgNCmrbyNNaBvM
Login as sisah with password 123456, root password 123456, kde wallet password is set to 123456 too. Made on n960f dual sim.
Click to expand...
Click to collapse
Good work
@Sisah
I've managed to get USB to work. Here, take the code:
Code:
#!/bin/bash
mkdir -p /sys/kernel/config/usb_gadget/g1
cd /sys/kernel/config/usb_gadget/g1
echo 0xabcd > idVendor
echo 0x1234 > idProduct
mkdir -p strings/0x409
echo SM-960F > strings/0x409/serialnumber
echo Samsung > strings/0x409/manufacturer
echo Note9 > strings/0x409/product
# Config 1
mkdir -p configs/c.1
echo 120 > configs/c.1/MaxPower
mkdir -p configs/c.1/strings/0x409
echo "ACM" > configs/c.1/strings/0x409/configuration
mkdir functions/acm.GS0
ln -s functions/acm.GS0 configs/c.1
# Config 2
#mkdir -p configs/c.2
#echo 120 > configs/c.2/MaxPower
#mkdir -p configs/c.2/strings/0x409
#echo "RNDIS" > configs/c.2/strings/0x409/configuration
mkdir functions/rndis.usb0 # use default parameters
ln -s functions/rndis.usb0 configs/c.1
echo "acm,rndis" > /sys/class/android_usb/android0/functions
echo 10c00000.dwc3 > UDC
echo 1 > /sys/class/android_usb/android0/enable
# to unbind it: echo "" UDC; sleep 1; rm -rf /sys/kernel/config/usb_gadget/g1
/sbin/agetty -w -L 115200 ttyGS0 linux
exit 0
-W_O_L_F- said:
@Sisah
I've managed to get USB to work. Here, take the code:
Code:
#!/bin/bash
mkdir -p /sys/kernel/config/usb_gadget/g1
cd /sys/kernel/config/usb_gadget/g1
echo 0xabcd > idVendor
echo 0x1234 > idProduct
mkdir -p strings/0x409
echo SM-960F > strings/0x409/serialnumber
echo Samsung > strings/0x409/manufacturer
echo Note9 > strings/0x409/product
# Config 1
mkdir -p configs/c.1
echo 120 > configs/c.1/MaxPower
mkdir -p configs/c.1/strings/0x409
echo "ACM" > configs/c.1/strings/0x409/configuration
mkdir functions/acm.GS0
ln -s functions/acm.GS0 configs/c.1
# Config 2
#mkdir -p configs/c.2
#echo 120 > configs/c.2/MaxPower
#mkdir -p configs/c.2/strings/0x409
#echo "RNDIS" > configs/c.2/strings/0x409/configuration
mkdir functions/rndis.usb0 # use default parameters
ln -s functions/rndis.usb0 configs/c.1
echo "acm,rndis" > /sys/class/android_usb/android0/functions
echo 10c00000.dwc3 > UDC
echo 1 > /sys/class/android_usb/android0/enable
# to unbind it: echo "" UDC; sleep 1; rm -rf /sys/kernel/config/usb_gadget/g1
/sbin/agetty -w -L 115200 ttyGS0 linux
exit 0
Click to expand...
Click to collapse
Nice it enable usb, but still getting errors when i plug otg, and phone reboot if i connect it to pc, its strenge because i installed linux on more phones and otg alwais worked without any configuration.

Categories

Resources