Hello,
I like to think i'm pretty good with linux, but i'm new to android, so please bear with me.
I have rooted the phone, and I've been poking around a bit and some questions arises:
1. In the root, i found several init.*rc files, which one is used for booting the phone?
2. usbd - this daemon seems to control the USB state (mass storage, pc mode, cdrom) - Is there some documentation for how to control this? I'd like to put some ISOs on my sdcard and use the phone to emulate a cdrom, and I think this would be possible through this.
It opens the socket /dev/socket/usbd, so I assume it will be controlled through this.
When i have time I'll poke more, but its useless if someone else already looked at this.
3. Is there a way to boot the phone into a debug state? I'd like to replace the /osh filesystem, but in order to unmount it I think I need to enter some kind of debug mode/single user mode?
4. Do we have the source code for the kernel with all the TI goodness? And is there a way of updating this?
Other than this I have some issues with sound my heavily modified webtop, alsa is the way to go, right?
Hopefully I'll get this sorted out and I'll be able to enjoy full debian on the webtop and in the terminal.
OMG, I have absolutely no answers for you, but I hope SOMEONE does, cause I wanna see more from this! You pose some great questions/possibilities! Being only a dabbler in Linux makes me useless, but I understand what you're looking for, and I wannit too!
\\Carved into this thread by my RAZR//
http://android-gz.com
I am not a Android developer, but, I like to treat Android as one of the GNU/Linux environment.
Usually, I always starts with dmesg. There are lot's of hints and pointers about the hardware itself.
Snippet from dmesg.
Code:
<5>[ 0.000000] Kernel command line: console=/dev/null rw [email protected] vram=20M omapgpu.vram=0:4M,1:16M,2:16MT init=/init ip=off mmcparts=mmcblk1:p7(pds),p8(utags),p14(boot),p15(recovery),p16(cdrom),p17(misc),p18(cid),p19(kpanic),p20(system),p21(cache),p22(preinstall),p23(webtop),p24(userdata),p25(emstorage) mot_sst=1
From the kernel boot parameters, you can see how Linux kernel allocates the MTD blocks.
2) I also like to 'browse' the filesystem...
Code:
PC$ adb shell
Android$ su
Android# ls -l -R / > /sdcard/lists.txt
Android# exit
Android$ exit
PC$ adb pull /sdcard/lists.txt
Look at tools/utilities in /system/bin or /system/xbin ...
For alsa, try look in /osh/usr/share/alsa ... it may have something useful for you.
Sorry, I cannot answer all of your questions, but, hope the my tips can help you to explore more about Android OS.
To know more about your device, this one might be a good starter...
Code:
PC$ adb bugreport
Anyway good luck.
Thank you.
Related
Hi there, i was trying to run Debian on my pro, but i cant install it! i try two methods, the Linux installer Beta 1.7 (say kernel dosnt have ext and loop support) and the SU terminal emulator way (cant chmod to 4755 any file, even using the su command - from here: http://www.talkandroid.com/android-forums/android-development/1091-install-debian-android.html )...
My pro is ROOTED with latest z4root, i even do a factory repair with pc companion...
Any advice???
Regards!
I tried this as well... no loop is no loop ( required for chroot type runs )
works on a Samsung i5700 I have at work tho...
thnx for the reply, so i can add loop and the ext thing? or we need a custom kernel? , what rom have the samsung?, in other hand i dont know why i cant chmod the files, even using root explorer! regards...
needs a new kernel yes.
i5700 is running samdroid cooked ( forget which version, but added multitouch )
damn :/
now why i cant chmod the files using su terminal emulator or root explorer? maybe is because my sdcard is formated in fat32, regards!
fat32 knows nothing about *nix style permissions, in a way though... all files on a fat32 are set 0777, but not really... heh
For what it's worth, I've just had Debian running in a chroot on my X10 Mini Pro, using the instructions at talkandroid.com, as mentioned by the original poster. Sorry, but as a new poster, I'm not allowed to link directly to those directions. This is with stock ROM, upgraded to Android 2.1, rooted with SuperOneClick.
A few modifications are necessary to make it work. I'm going to try to describe what I've done, but I am working backwards, so it's entirely possible that I'll leave something out and you could suffer disastrous consequences. So please be sure you back up all crucial data before proceeding, and be prepared to accept the possibility that your phone could be destroyed in the process.
First of all, the instructions tell you to run scripts from your SD card, which isn't going to work unless the card has a partition with a Linux-compatible file system. I suggest following the directions as far as step 4. Then replace the "bootdeb" file in the "debian" directory with the modified version attached to this post. Rename it "bootdeb". Then you will have to run the following commands manually, preferably using adb shell, but it can be done in a terminal on the phone. Either way, using the ash shell helps by providing command completion and history.
As root (su):
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock0 /system
mkdir /data/local/mnt
cd /sdcard/debian
cp bootdeb /data/local/bin #note: you may need to mkdir /data/local/bin first
cd /data/local/bin/
chmod 4777 bootdeb
You should now be able to run the bootdeb script to start up Debian.
The installation file says, "Be sure to run /scripts/onetime.sh as root from the shell after your FIRST 'boot'." This will prompt you to set a root password.
At this point, the Debian installation is command line only and root only. The image file needs to be resized before much can be added.
The other files in the Debian directory may be useful, but they all need to be modified before they can be used.
This is only a beginning. I don't know that I'm likely to get very far with it, so anyone else who's inclined to jump in and make this work better is welcome to do so!
edit: correcting grammatical error
Just in case anyone else shares my obsession -- I mean interest in getting Debian to run on an X10 Mini Pro, I thought I should report my progress. Or lack thereof.
Actually, as I said in the previous post, command line Debian works, and that's a lot of power to have available. But it would be nice to get X working, despite the lack of video drivers.
There's a lot of information out there about setting up X with a VNC server on an Android phone, then running a VNC client to access the graphic environment. The source of most accounts seems to be a thread at the androidfanatic forums, with the title "Gnome, KDE, IceWM or LXDE Desktop on your Android!"
(Sorry, I'm still too new at this to be allowed to post links, so this is the only way I can indicate where to find the information.)
I've tried lots of variations on those directions, trying to adapt them to the X10 Mini Pro. And I've had a little success. I can get to the Icewm or LXDE desktop and run the terminal program, but I can't start any programs that use X. Invariably, I get this error:
Error: Can't open display: :1.0
I've run out of ideas, so I'm taking a break from the project. If anyone else is interested enough to try, good luck to you!
For what it's worth, the most recent and comprehensive account of running Debian with X on Android phones appears to be at lanrat.com, in the "android" directory, filename "debian".
@RobbH
Very interesting! I'm waiting a new 8gb card so that I try it! Should you come up with any new progress please report here
Hello Android Devs,
I am a linux admin, looking to help out. Is there a good place to do a quick comparison of commands btw linux and android ? Or where various scripts / special android locations of files.
I have been typing into my touchpad's Terminal Emulator and getting pretty irritated with no tab completion. I think I am going to buy a bluetooth keyboard. The other issue I was hoping Devs could help me find is, where is the fsck.vfat ? or e2fsck -o vfat? I have been having heck of time trying to find this and other normal linux commands without locate or tab completion. man e2fsck (no man pages found lol).
My "sdcard" in dmesg says needs to fsck'd, and I would like to help out because I see forum posts here and rootkitz.forums about just deleting the partition lol.
Thanks for advice
SorrowsTyr
Install Hacker's Keyboard from Market, this one has buttons like Ctrl and Tab.
Sweet I will try that thanks!
-Gary
On my Droid3 e2fsck is located in /system/bin. I am also seeing a fsck.msdos, but no fsck.vfat.
I also remember seeing someone was compiling a BASH shell for Android. This would give you the tab completion that Busybox doesn't have.
Sent from my Nexus S using XDA App
yes there is bash in android , just type it, if you want bash with root privies the most reliable way to do that is su -c "bash"
also dont fsck in android that will get you bad results just look at what happened in a1, better way to that is using webos either using tailor in preware which is a nice front end that unmounts and fscks your media partition or install xecutah and using the command line fsck it (remember to unmount first)
ps: path to the media partition is dev/store/media
sorrowstyr said:
Hello Android Devs,
I am a linux admin, looking to help out. Is there a good place to do a quick comparison of commands btw linux and android ? Or where various scripts / special android locations of files.
I have been typing into my touchpad's Terminal Emulator and getting pretty irritated with no tab completion. I think I am going to buy a bluetooth keyboard. The other issue I was hoping Devs could help me find is, where is the fsck.vfat ? or e2fsck -o vfat? I have been having heck of time trying to find this and other normal linux commands without locate or tab completion. man e2fsck (no man pages found lol).
My "sdcard" in dmesg says needs to fsck'd, and I would like to help out because I see forum posts here and rootkitz.forums about just deleting the partition lol.
Thanks for advice
SorrowsTyr
Click to expand...
Click to collapse
You should try this:
http://www.mediafire.com/file/g52q4...1.0-tenderloin-sdcard_check_fix_r4-signed.zip
It installs a fixed fsck_msdos ...
NOTE: This should be included in Alpha3.6, but until then ...
Posted it here as this section gets the most views. If needed tom will move it to the rightful section.
There has been a lot of disappointing posts all over the forum with people complaining about bugs, while not providing any kind of information for the developers aside from "X doesn't work" or "I get random reboots".
Well, without the proper knowledge, how are we going to fix it? We don't know what kernel you may be running, what version number you're on, or any information that the system spits out to let you know there's an error. So, I decided to start this thread, to hopefully teach newbies how to give us (developers) proper knowledge when complaining about issues.
This thread will have 3 sections, Logcat (App / system debug log.), Dmesg (active kernel output) and last_ksmg (Typically if you get a random reboot or something of that sort {this is the same as dmesg except it gets the info from the last shutdown [like a kernel panic]})
Section 1: Logcat This log should almost always be included just because it provides more info than just saying something doesn't work. It will essentially tell you which apps are crashing and why and it also gives output of what they're doing. (Your system is running through apps, the dialer, wireless radio's, etc are all ran through apps.) so, if something is general, like a system force close, please just include a logcat.
How to get a logcat: Well, this is REALLY simple, all you need to do is just get adb up and running (google how to do that, I don't feel like writing a 'how to use adb' tutorial for everyone's phone.) and then type
Code:
adb logcat
then you just right click, select, and paste to the thread. It's really that simple!
For more info, check out my logcat guide here.
Section 2: Dmesg
This is getting into issues such as wifi not working, sleep of death, etc. Basically, things that make us go "OH F***" when we use our devices. Note: You will need adb access for this to work, same as logcat. What this will do is get us live kernel output so we can know things like "What driver is the kernel loading {or not loading for that matter}" and similar things. This is linux, so kernel output is important if a hardware aspect isn't working right. How to get a dmesg: This is simple as well, no matter what operating system you're on (mac, windows, linux) just type
Code:
adb shell dmesg > dmesg.txt
and then it will have written the output to a .txt file in your current directory. Either paste the contents to the thread, or attach it to your post. You can also get the dmesg by using terminal emulator. Instead though, you dont type adb shell, you need to also include it to somewhere you will be able to save it. Like /sdcard so, the command goes
Code:
dmesg > /sdcard/dmesg.txt
Just get it off your sdcard and get the contents to the developer!
Section 3: last_kmsg Ok, the last thing is last_kmsg. When android kernels crash, they write the log to last_kmsg so then you can find out what's going on. This is usually for issues such as random reboots and other various kernel panic symptoms. A kernel panic happens when the kernel tries to do something it can't. It doesn't mean wrong permissions, it could just have errored out on something and died which can cause a few things. Anyway, developers REALLY need this if debugging a kernel because it gives us a viable way to see WHAT it's trying to do instead of trying to guess what it is trying to do How to get a last_kmsg: This is super simple and the same on all phones no matter what, what you need is adb up and running (or terminal emulator) and either in adb shell, or terminal emulator just type
Code:
cat /proc/last_kmsg > /sdcard/last_kmsg.txt
or you can do
Code:
adb shell cat /proc/last_kmsg > kmsg.txt
and that will write it to your current working directory from cmd.
Hopefully, this way we developers can have our lives be a little bit easier and you can learn more about android.
Taken from here. All due credits to him. I just edited a little part.
___________XDA Premium__________
Don't be a noob. Be a newbie..!!
Details here.
____________________________________
Nice.
i will add this in my developer 101 thread in next update...thanx
Xenon X said:
i will add this in my developer 101 thread in next update...thanx
Click to expand...
Click to collapse
Sure.
___________XDA Premium__________
Don't be a noob. Be a newbie..!!
Details here.
____________________________________
Nice tutorial :good:
Nice guide:good:
download error
when i press download rom.it doesn't download
it shows this error report when i trying to download rom
"Unable to resolve domain name
Please make sure:
- You are connected to the Internet.
- Your DNS server settings are correct.
Error code 105 (net::ERR_NAME_NOT_RESOLVED)"
please help me
Our developers are hard workers and when one of us finds a problem with a ROM or kernel it is difficult to troubleshoot without some type of log. Since the developers spend a lot of their free time creating things for us to make our phone more enjoyable the least we could do is provide something useful to them to assist in the development of their creations.
Most of you here already know how to get logs, but for those who don't or are rusty at it here are links with useful information and apps to assist in obtaining a log. Also, .torrented provided the basic commands if you're okay using adb.
So let's give back to our developers by giving them logs which are vital for development.
All-in-one logger for use in Windows
http://forum.xda-developers.com/showthread.php?t=1944776
Another logcat tool for use in Windows
http://forum.xda-developers.com/showthread.php?p=28193613#post28193613
Lumberjack- apk for obtaining logs while in android
https://play.google.com/store/apps/details?id=net.solarnz.apps.lumberjack
Universal how to get and read logcat
http://forum.xda-developers.com/showthread.php?t=2274119
There are three types of logs that are used most often: logcat, dmesg, and last_kmsg. Here is an explanation of what they are and what they're useful for
Indirect said:
Alright guys, I was on an irc channel when I considered posting this since it's rather important. There has been a lot of disappointing posts all over the forum with people complaining about bugs, while not providing any kind of information for the developers aside from "X doesn't work" or "I get random reboots".
Well, without the proper knowledge, how are we going to fix it? We don't know what kernel you may be running, what version number you're on, or any information that the system spits out to let you know there's an error. So, I decided to start this thread, to hopefully teach newbies how to give us (developers) proper knowledge when complaining about issues.
This thread will have 3 sections, Logcat (App / system debug log.), Dmesg (active kernel output) and last_ksmg (Typically if you get a random reboot or something of that sort {this is the same as dmesg except it gets the info from the last shutdown [like a kernel panic]})
Section 1: Logcat
This log should almost always be included just because it provides more info than just saying something doesn't work. It will essentially tell you which apps are crashing and why and it also gives output of what they're doing. (Your system is running through apps, the dialer, wireless radio's, etc are all ran through apps.) so, if something is general, like a system force close, please just include a logcat.
How to get a logcat:
Well, this is REALLY simple, all you need to do is just get adb up and running (google how to do that, I don't feel like writing a 'how to use adb' tutorial for everyone's phone.) and then type
Code:
adb logcat
then you just right click, select, and paste to the thread. It's really that simple!
Section 2: Dmesg
This is getting into issues such as wifi not working, sleep of death, etc. Basically, things that make us go "OH F***" when we use our devices. Note: You will need adb access for this to work, same as logcat.
What this will do is get us live kernel output so we can know things like "What driver is the kernel loading {or not loading for that matter}" and similar things. This is linux, so kernel output is important if a hardware aspect isn't working right.
How to get a dmesg:
This is simple as well, no matter what operating system you're on (mac, windows, linux) just type
Code:
adb shell dmesg > dmesg.txt
and then it will have written the output to a .txt file in your current directory. Either paste the contents to the thread, or attach it to your post.
You can also get the dmesg by using terminal emulator. Instead though, you dont type adb shell, you need to also include it to somewhere you will be able to save it. Like /sdcard so, the command goes
Code:
dmesg > /sdcard/dmesg.txt
Just get it off your sdcard and get the contents to the developer!
Section 3: last_kmsg
Ok, the last thing is last_kmsg. When android kernels crash, they right to last_kmsg so then you can find out what's going on. This is usually for issues such as random reboots and other various kernel panic symptoms. A kernel panic happens when the kernel tries to do something it can't. It doesn't mean wrong permissions, it could just have errored out on something and died which can cause a few things. Anyway, developers REALLY need this if debugging a kernel because it gives us a viable way to see WHAT it's trying to do instead of trying to guess what it is trying to do
How to get a last_kmsg:
This is super simple and the same on all phones no matter what, what you need is adb up and running (or terminal emulator) and either in adb shell, or terminal emulator just type
Code:
cat /proc/last_kmsg > /sdcard/last_kmsg.txt
or you can do
Code:
adb shell cat /proc/last_kmsg > kmsg.txt
and that will write it to your current working directory from cmd.
Hopefully, this way we developers can have our lives be a little bit easier and you can learn more about android.
I'm glad to have written this and devs, feel free to link to this guide as a "bug reporting FAQ"
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?p=23036410
@orangechoochoo, any urge to update the title and the content to provide information about getting dmesg output and last_kmsg?
Once your android device is plugged into your machine, enable Android Debugging in the Developer Options! (this has to be enabled)
If you do not have ADB installed go find a tutorial and install it! (this is a must)
Very simple command, what this does is it will start ADB and output the text into a text file called logcat.txt, once you are done re-creating the error/FC/whatever take that file and upload the contents to a paste site such as https://www.pastebin.com
It's free and you do not need to sign up to create a paste!
logcat via ADB!
Nix:
Code:
[email protected]:~$ adb logcat > logcat.txt
Windows:
Code:
C:\android-tools> adb logcat > logcat.txt
last_kmsg via ADB!
Nix:
Code:
[email protected]:~$ adb pull /proc/last_kmsg
Windows:
Code:
C:\android-tools> adb pull /proc/last_kmsg
dmesg via ADB!
Nix:
Code:
[email protected]:~$ adb shell dmesg > dmesg.txt
Windows:
Code:
C:\android-tools> adb shell dmesg > dmesg.txt
crpalmer said:
@orangechoochoo, any urge to update the title and the content to provide information about getting dmesg output and last_kmsg?
Click to expand...
Click to collapse
I just finished adding more stuff, let me know if you want me to put anything else that will be helpful. The All in One tool looks useful if someone is stuck in the boot animation, and Lumberjack looks useful for obtaining logs while booted in android.
Thanks for the quick links, I'm sure it will help alot of users out. MY question is whether devs want us to filter anyting out, its not too hard to select faults and errors and filter useless info.
This should be pinned.. for sure!
jake.corey.jacobs said:
MY question is whether devs want us to filter anyting out, its not too hard to select faults and errors and filter useless info.
Click to expand...
Click to collapse
That would be nice to know, last night I provided Pio a long a$$ logcat so I feel bad for giving him that extra homework
The ROM was stuck in the boot animation and logcat was spitting out line after line after line so I hit ctlr C to stop it.
Nice guide...
Hello again
maybe the thread title is a bit disguising but i try my best to explain what i mean
it's not specific to a terminal or any device, but more of a general question as i'm actually looking for some documentation and examples to get started.
What i would like to do is to create a really basic system (kernel + initramFS) that i can download to a device when in fastboot and boot from them.
my final objective is to have an "in memory" image that would simply drop into a shell once booted... then i'd build up onto it and add things that i might need and customize..
but my primary objective is to understand (possibly by examples) how to get started...
having a base to start from would be also nice, so well.. maybe there are some open source projects which i can dissect and look into and eventually fork/customize for my needs.
any suggestion is really welcome.
thanks in advance.