compcache - working on emulator - G1 Android Development

I've seen a few people trying compcache and failing horribly, but it seems to work for me.
Build instructions, still raw, not tested on actual device only on emulator (left my phone at work...). I've only tested for a few minutes, but I've seen none of the "horrible crashing the second I swapon" I've seen reported elsewhere.
NOTE THAT /data IS A DUMB PLACE TO PUT KERNEL MODULES, but it's on the emulator for me so I couldn't care less, and that location was rw to begin with
Code:
cd ~/compcache
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- KERNEL_BUILD_PATH=/home/neuron/android-kernel/new/goldfish
emulator -avd CupcakeVM01 -kernel arch/arm/boot/zImage show-kernel -shell
#In compcache directory:
adb push sub-projects/allocators/xvmalloc-kmod/xvmalloc.ko /data
adb push ramzswap.ko /data
#In kernel directory:
adb push lib/lzo/lzo_compress.ko /data
adb push lib/lzo/lzo_decompress.ko /data
#Download and push busybox:
http://benno.id.au/blog/2007/11/14/android-busybox
adb push busybox /data
adb shell
insmod xvmalloc.ko
insmod lzo_decompress.ko
insmod lzo_compress.ko
insmod ramzswap.ko
chmod 744 /data/busybox
cat /proc/devices
- mknod with same block device id
/data/busybox mknod /dev/ramzswap0 b 254 0
#missing priority, wont be needed unless you have swapper too
/data/busybox swapon /dev/ramzswap0
# cat /proc/swaps
Filename Type Size Used Priority
/dev/ramzswap0 partition 23540 204 -1
# cat /proc/ramzswap
DiskSize: 23544 kB
NumReads: 12
NumWrites: 42
FailedReads: 0
FailedWrites: 0
InvalidIO: 0
PagesDiscard: 0
ZeroPages: 3
GoodCompress: 97 %
NoCompress: 2 %
PagesStored: 39
PagesUsed: 8
OrigDataSize: 156 kB
ComprDataSize: 28 kB
MemUsedTotal: 32 kB
I just built this (with some tips from cyanogen) for the compcache author, so he could have a way of reproducing the problem locally to solve it, but I cant seem to find any problem .
I've tested opening a ton of apps, switching between em, and suspending the phone.
Tested on :
cupcake 1.5 emulator
kernel goldfish 2.6.27
latest compcache (not svn)
armv5 compiler

Very basic quick copy&paste info on kernel choice:
Code:
mkdir ~/android-kernel
cd ~/android-kernel
wget http://www.codesourcery.com/sgpp/lite/arm/portal/package3696/public/arm-none-linux-gnueabi/arm-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 -O arm-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
tar xjf arm-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
export PATH=~/android-kernel/arm-2008q3/bin:$PATH
> >> git clone git://android.git.kernel.org/kernel/common kernel-common
> >> cd kernel-common
> >> git branch goldfish origin/android-goldfish-2.6.27
> >> git checkout goldfish
make goldfish_defconfig ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- menuconfig
- enable loadable modules + lzo
make zImage ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
make modules ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-

Well thats a big WTF. I can 100% confirm that it does not work on a regular G1, on neither the 2.6.27 nor the 2.6.29 kernel. Guess the compcache author needs to get himself a G1

Could be an issue with one of the kernel modules that isn't on the emulator I suppose.
On a bright note I can throw in that GoodCompress stays fairly high when swapping between normal android apps, so when we do get it working it's gonna be good
//edit, cyanogen can you send me your kernel .config and any custom patches? And what kernel tree/compiler are you on?
It could be compiler related.

nurre said:
Could be an issue with one of the kernel modules that isn't on the emulator I suppose.
On a bright note I can throw in that GoodCompress stays fairly high when swapping between normal android apps, so when we do get it working it's gonna be good
//edit, cyanogen can you send me your kernel .config and any custom patches? And what kernel tree/compiler are you on?
It could be compiler related.
Click to expand...
Click to collapse
I use the CodeSourcery toolchain to compile kernels. Right now I'm using the android-msm-2.6.29 branch from Android GIT (with all the new camera stuff reverted because it's broken). The only patches I have applied are the Synaptics multitouch patch and the mtd6 enabler patch. I'm attaching the config from my running device.

Thanks, if I dont toy with this tonight I will do tomorrow
On a side note, doing free -m on a 94mb memory device and seeing 120mb used and free memory available is nice

this would be a revolutionary hack for our devices if we can get this to work, I may go ahead and try compiling it when im free today

I would love to see this working. An additional 20megs or so of free RAM would make a huge difference.

defconoi said:
this would be a revolutionary hack for our devices if we can get this to work, I may go ahead and try compiling it when im free today
Click to expand...
Click to collapse
The question is when not if
//edit, hell if we cant get it to work for long enough I'll start a donate poll for "buy the compcache developer a rooted G1"

http://code.google.com/p/compcache/issues/detail?id=33
reported upstream, now waiting for more info (until I get impatient and start trying myself )

Someone using cyan 3.5 try this if your feeling adventurous. This is sortof a todo list for myself of **** to try. First commands did work for me however, no reboots.
insmod xvmalloc.ko
insmod ramzswap.ko disksize_kb=100
/data/busybox free
cat /proc/swaps
cat /proc/ramzswap
All reports ok, catting ramzswap actually shows GoodCompress 84%, so it is in use.
Things worth testing:
- higher disksize_kb
- if higher disksize_kb fails, try freeing memory before inserting the module and enabling swap (can use a combination of ps and kill to find the memory hoggers).
- echo 100 > /proc/sys/vm/swappiness
//edit, to be specific I'm running cyan 3.5.1 without squashfs.

ok so I couldn't leave this alone, it works with higher swap size as well, but I got a crash after torturing it for a while. Gonna look into it more tomorrow.
Code:
<4>[ 316.945526] send sigkill to 568 (app_process), adj 14, size 4436
<4>[ 324.601165] select 612 (app_process), adj 15, size 4411, to kill
<4>[ 324.601196] send sigkill to 612 (app_process), adj 15, size 4411
<6>[ 346.488891] binder: release 134:323 transaction 6478 in, still active
<6>[ 346.489135] binder: send failed reply for transaction 6478 to 194:505
<6>[ 346.744750] binder: 194 invalid dec strong, ref 1079 desc 17 s 0 w 1
<6>[ 346.754028] binder: 423 invalid dec strong, ref 8585 desc 17 s 0 w 1
<6>[ 346.760559] binder: 585 invalid dec strong, ref 9347 desc 17 s 0 w 1
<6>[ 348.089965] request_suspend_state: wakeup (0->0) at 341189074786 (2009-06-28 19:54:03.283935557 UTC)
<3>[ 348.092315] init: untracked pid 371 exited
<3>[ 348.093719] init: untracked pid 383 exited
<3>[ 348.094207] init: untracked pid 390 exited
<3>[ 348.094635] init: untracked pid 414 exited
<3>[ 348.133636] init: untracked pid 190 exited
<3>[ 348.133911] init: untracked pid 273 exited
<3>[ 348.134277] init: untracked pid 621 exited
<3>[ 348.140106] init: untracked pid 266 exited
<3>[ 348.140563] init: untracked pid 352 exited
<3>[ 348.160003] init: untracked pid 194 exited
<3>[ 348.160461] init: untracked pid 423 exited
<3>[ 348.160705] init: untracked pid 585 exited
<6>[ 381.844940] request_suspend_state: wakeup (0->0) at 374944049146 (2009-06-28 19:54:37.038909917 UTC)
<6>[ 384.697967] binder: release 112:127 transaction 10775 in, still active
<6>[ 384.698333] binder: send failed reply for transaction 10775 to 645:653
<6>[ 385.784729] htc-acoustic: open
<6>[ 385.845764] htc-acoustic: mmap
<6>[ 385.846740] htc-acoustic: ioctl
<6>[ 385.846954] htc-acoustic: ioctl: ACOUSTIC_ARM11_DONE called 678.
<6>[ 385.849548] htc-acoustic: ioctl: ONCRPC_ACOUSTIC_INIT_PROC success.
<6>[ 385.849792] htc-acoustic: release
<6>[ 385.890563] snd_set_device 1 1 1
<6>[ 385.901885] snd_set_volume 0 0 5
<6>[ 385.903289] snd_set_volume 1 0 5
<6>[ 385.912017] snd_set_volume 3 0 5
<6>[ 385.913360] snd_set_volume 2 0 5
<6>[ 386.833923] snd_set_volume 256 0 5

Doesn't seem to work for me. Running cyan 3.5.1 nosquash
Do you need to include these modules?
lzo_decompress.ko
lzo_compress.ko
Code:
# lsmod
lsmod
ramzswap 9648 0 - Live 0xbf007000
xvmalloc 5192 1 ramzswap, Live 0xbf000000
# busybox free
busybox free
total used free shared buffers
Mem: 97848 96272 1576 0 260
Swap: 0 0 0
Total: 97848 96272 1576
# cat /proc/swaps
cat /proc/swaps
Filename Type Size Used Priority
# cat /proc/ramzswap
cat /proc/ramzswap
DiskSize: 100 kB
NumReads: 0
NumWrites: 0
FailedReads: 0
FailedWrites: 0
InvalidIO: 0
PagesDiscard: 0
ZeroPages: 0
GoodCompress: 0 %
NoCompress: 0 %
PagesStored: 0
PagesUsed: 0
OrigDataSize: 0 kB
ComprDataSize: 0 kB
MemUsedTotal: 0 kB
#
nurre said:
Someone using cyan 3.5 try this if your feeling adventurous. This is sortof a todo list for myself of **** to try. First commands did work for me however, no reboots.
insmod xvmalloc.ko
insmod ramzswap.ko disksize_kb=100
/data/busybox free
cat /proc/swaps
cat /proc/ramzswap
All reports ok, catting ramzswap actually shows GoodCompress 84%, so it is in use.
Things worth testing:
- higher disksize_kb
- if higher disksize_kb fails, try freeing memory before inserting the module and enabling swap (can use a combination of ps and kill to find the memory hoggers).
- echo 100 > /proc/sys/vm/swappiness
//edit, to be specific I'm running cyan 3.5.1 without squashfs.
Click to expand...
Click to collapse

slightly carried away there and forgot you actually need the swapon instructions as well:
Code:
cat /proc/devices
- mknod with same block device id
busybox mknod /dev/ramzswap0 b 253 0
sync; sync
busybox swapon /dev/ramzswap0
adb logcat info of the device failing would save me some time debugging this

Got it working. I tried with a 16meg ramzswap and it worked for a while then I get crashing apps left and right and finally the phone reboots.
I'm not sure if its related to compcache or not because I experienced the same issue using a regular swapfile on the ext2/3 partition. It took a while for it to crash though. With compcache I can get it to crash in about 10min.
If I used a swap partition, I didn't see any crashes.
Dave
nurre said:
slightly carried away there and forgot you actually need the swapon instructions as well:
Code:
cat /proc/devices
- mknod with same block device id
busybox mknod /dev/ramzswap0 b 253 0
sync; sync
busybox swapon /dev/ramzswap0
adb logcat info of the device failing would save me some time debugging this
Click to expand...
Click to collapse

nurre said:
slightly carried away there and forgot you actually need the swapon instructions as well:
Code:
cat /proc/devices
- mknod with same block device id
busybox mknod /dev/ramzswap0 b 253 0
sync; sync
busybox swapon /dev/ramzswap0
adb logcat info of the device failing would save me some time debugging this
Click to expand...
Click to collapse
Attached you'll find a logcat of 3.5.2 cm build with compcache and apps crashing, hope this helps.

The author has a posted a new version, and it works on android!
I've been testing it and it works. Go try it out.
http://code.google.com/p/compcache/issues/detail?id=33
http://compcache.googlecode.com/issues/attachment?aid=-8516568331917785992&name=arm_test1.tbz2
these modules are compiled for cyanogen's .29 kernel.
copy xvmalloc.ko and ramzswap.ko to /system/sd
Add these lines to your userinit.sh
make sure to disable the sdcard swap..
insmod /system/sd/xvmalloc.ko;
insmod /system/sd/ramzswap.ko;
busybox mknod /dev/ramzswap0 b 253 0;
echo 60 > /proc/sys/vm/swappiness;
swapon /dev/ramzswap0;

What exactly is compcache?

Testing. So far so good! Using cyan 3.6.4.1...

persiansown said:
What exactly is compcache?
Click to expand...
Click to collapse
It uses part of your RAM as a swapfile by using compression, which effectively increases the size of you RAM.
The thinking is that compressing/decompressing from RAM is still faster than swapping to a flash device.
I'm eager to try this out on jachero, but the kernel is slightly different than cyanogen's so these modules don't work. daproy or somebody else has to recompile these modules for that kernel.
But its working pretty well on cy's image. The browser will stay in memory if I load up other apps, and I can't really see a big degradation in performance.

Related

wlan.ko trouble in self built kernel

Hi,
I'm struggling with a strange problem with wlan.ko module while building my own kernel. I've googled and read all possible tutorials
and set up different build systems and built different kernel versions (2.6.27 and 2.6.29) using msm_defconfig
and the config grabbed from my working kernel. Everything builds fine and I'm able
to boot my HTC Dream with fastboot. The only problem I'm facing is with the wlan.ko module that freezes as soon as i try to insmod it.
insmod hangs and never returns and lsmod shows:
wlan 587292 1 - Loading 0xbf000000
but there is nothing suspicious in dmesg
<6>[ 127.020904] mmc0: new SDIO card at address 0001
<6>[ 127.028503] TIWLAN: Found SDIO controller (vendor 0x104c, device 0x9066)
<6>[ 127.030456] tiwlan0 (): not using net_device_ops yet
<6>[ 127.034942] TIWLAN: Driver initialized (rc 0)
nor in logcat output. At this point it is impossible to rmmod the module.
rmmod: delete_module 'wlan' failed (errno 16)
I've double checked that magicversion of kernel and wlan module match.
I've recompiled everything with different toolchains, compilers and clean sources but i'm getting always the same problem.
Now i'm running out of ideas and as other people seem to be able to build their kernels I suspect I'm overlooking something
obvious or doing something very stupid. Any hint or advice is welcome.
Thanks in advance,
farmatito.
Did you rebuild the module and set KERNEL_DIR properly? It's in system/wlan/ti/sta_dk_4_0_4_32.
Yes, think so. Latest attempts I did with checked out snapshots of android-msm-2.6.27 and 2.6.29, using this script and everything built fine:
#!/bin/sh
d=../arm-eabi-4.2.1/bin
make ARCH=arm CROSS_COMPILE=$d/arm-eabi- msm_defconfig
#make ARCH=arm CROSS_COMPILE=$d/arm-eabi- oldconfig
#make ARCH=arm CROSS_COMPILE=$d/arm-eabi- oldconfig
make ARCH=arm CROSS_COMPILE=$d/arm-eabi- EXTRAVERSION=
make ARCH=arm CROSS_COMPILE=$d/arm-eabi- EXTRAVERSION= modules
mkdir -p modules.tmp
make ARCH=arm CROSS_COMPILE=$d/arm-eabi- EXTRAVERSION= INSTALL_MOD_PATH=modules.tmp modules_install
cd ../sta_dk_4_0_4_32
make ARCH=arm CROSS_COMPILE=$d/arm-eabi- DEBUG=n EXTRAVERSION= KERNEL_DIR=../msm clean
make ARCH=arm CROSS_COMPILE=$d/arm-eabi- DEBUG=n EXTRAVERSION= KERNEL_DIR=../msm
The dir tree im using is:
ls -la htc-g1-kernel/
drwxr-xr-x 9 tito tito 4096 2009-05-30 21:33 .
drwx------ 23 tito tito 4096 2009-05-30 21:30 ..
drwxr-xr-x 9 tito tito 4096 2009-04-26 21:29 arm-eabi-4.2.1
drwxr-xr-x 24 tito tito 4096 2009-05-30 22:30 msm
drwxr-xr-x 8 tito tito 4096 2009-05-30 21:37 sta_dk_4_0_4_32
Previously I used a git tree set up as described on the android web site and managed with the repo tool, but same results.

Mounting in Gentoo Linux with A2SD partitions

I am running cyanogen's rom with a fat32 partition and ext3 partition. When i run fdisk on the device /dev/sdb, i get this as a result and it looks ok:
Code:
# fdisk /dev/sdb
Command (m for help): p
Disk /dev/sdb: 8067 MB, 8067743744 bytes
249 heads, 62 sectors/track, 1020 cylinders
Units = cylinders of 15438 * 512 = 7904256 bytes
Disk identifier: 0x000eadb7
Device Boot Start End Blocks Id System
/dev/sdb1 1 941 7263548 c W95 FAT32 (LBA)
/dev/sdb2 942 1005 487398 83 Linux
Partition 2 does not end on cylinder boundary.
however, I cant mount my partitions reliably. Sometimes when I plug it in, I get the fat32 partition as /dev/android, and sometimes I get the ext3 partition. but under both circumstances, i NEVER see /dev/sdb1 or /dev/sdb2.
Code:
# ls /dev | grep sd
lrwxrwxrwx 1 root root 4 2009-07-20 15:55 root -> sda3
brw-rw---- 1 root disk 8, 0 2009-07-20 15:55 sda
brw-rw---- 1 root disk 8, 1 2009-07-20 15:55 sda1
brw-rw---- 1 root disk 8, 2 2009-07-20 15:55 sda2
brw-rw---- 1 root disk 8, 3 2009-07-20 15:55 sda3
brw-rw---- 1 root disk 8, 16 2009-07-21 20:43 sdb
however, my dmesg reports this:
Code:
78640.618666] sd 30:0:0:0: [sdb] 15757312 512-byte hardware sectors: (8.06 GB/7.51 GiB)
[78640.620661] sd 30:0:0:0: [sdb] Write Protect is off
[78640.620664] sd 30:0:0:0: [sdb] Mode Sense: 03 00 00 00
[78640.620667] sd 30:0:0:0: [sdb] Assuming drive cache: write through
[78640.624658] sd 30:0:0:0: [sdb] 15757312 512-byte hardware sectors: (8.06 GB/7.51 GiB)
[78640.626659] sd 30:0:0:0: [sdb] Write Protect is off
[78640.626662] sd 30:0:0:0: [sdb] Mode Sense: 03 00 00 00
[78640.626665] sd 30:0:0:0: [sdb] Assuming drive cache: write through
[78640.626669] sdb: sdb1 sdb2
[78640.633034] usb 1-2:1.0: uevent
[78640.633122] usb 1-2: uevent
[78640.899187] usb 1-2:1.0: uevent
[78640.899276] usb 1-2: uevent
[78641.054596] VFS: Can't find ext3 filesystem on dev sdb1.
it takes a bunch of tries of unplugging the usb and plugging it back in until it finally somehow mounts my fat32 partition under /media/disk. Is this some configuration issue? Before I partitioned my sdcard, it was fine mounting just a fat32 partition as the entire card, no problems.
check you hald
/etc/init.d/hald restart
do you have support for udev in you kernel ?
Check this steps and tell us it worked
yes HAL is running and has been running the entire time:
Code:
# rc-update show
alsasound | boot
bootmisc | boot
checkfs | boot
checkroot | boot
clock | boot
consolefont | boot
cupsd | default
dbus | default
hald | default
hostname | boot
keymaps | boot
lm_sensors | default
local | default nonetwork
localmount | boot
modules | boot
net.eth0 | default
net.lo | boot
numlock | default
rdate | default
rmnologin | boot
sshd | default
syslog-ng | default
urandom | boot
xdm | default
Code:
$ ps aux | grep hal
103 3544 0.0 0.0 26956 4032 ? Ss Jul24 0:01 /usr/sbin/hald --use-syslog --verbose=no
root 3545 0.0 0.0 15624 1176 ? S Jul24 0:00 hald-runner
root 3548 0.0 0.0 17748 1124 ? S Jul24 0:00 hald-addon-input: Listening on /dev/input/event1 /dev/input/event0 /dev/input/event3
103 3553 0.0 0.0 16608 968 ? S Jul24 0:00 hald-addon-acpi: listening on acpi kernel interface /proc/acpi/event
root 3558 0.0 0.0 17748 1128 ? S Jul24 0:08 hald-addon-storage: polling /dev/sr0 (every 2 sec)
john5788 4596 0.0 0.0 130688 3120 ? Sl Jul24 0:00 /usr/libexec/gvfs-hal-volume-monitor
root 11452 0.0 0.0 17748 1124 ? S Jul24 0:01 hald-addon-storage: polling /dev/sdb (every 2 sec)
john5788 13851 0.0 0.0 84792 864 pts/1 R+ 10:10 0:00 grep --colour=auto hal
restarting does not help anything.
udevd --version ??
since version 140 those stupids rules messed up with removable devices.
Since I'm lazy I built my kernel with genkernel and it took care of everything about udev.
Code:
# udevd --version
141
so its a rule in udev that is screwin this up?
i'm not using genkernel, I rolled my own kernel out, have been doing it this way for years.
Code:
# uname -a
Linux john5788 2.6.29-gentoo-r5 #1 SMP Fri May 29 16:56:58 PDT 2009 x86_64 Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz GenuineIntel GNU/Linux
John5788 said:
Code:
# udevd --version
141
so its a rule in udev that is screwin this up?
i'm not using genkernel, I rolled my own kernel out, have been doing it this way for years.
Code:
# uname -a
Linux john5788 2.6.29-gentoo-r5 #1 SMP Fri May 29 16:56:58 PDT 2009 x86_64 Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz GenuineIntel GNU/Linux
Click to expand...
Click to collapse
Yeah i think ...
what's the output of dmesg |grep EXT3-fs ?
the output has a bunch of instances last night when i was plugging and unplugging the device. like i said, sometimes it recognized my fat32 partition, sometimes ext3.
Code:
# dmesg | grep EXT3-fs
[ 9016.479321] EXT3-fs warning: mounting unchecked fs, running e2fsck is recommended
[ 9016.481783] EXT3-fs: mounted filesystem with ordered data mode.
[ 9111.770944] EXT3-fs error (device sdb2): ext3_put_super: Couldn't clean up the journal
[ 9134.532699] EXT3-fs warning: mounting unchecked fs, running e2fsck is recommended
[ 9134.534632] EXT3-fs: recovery complete.
[ 9134.536841] EXT3-fs: mounted filesystem with ordered data mode.
[ 9166.843481] EXT3-fs warning: mounting unchecked fs, running e2fsck is recommended
[ 9166.849252] EXT3-fs: mounted filesystem with ordered data mode.
[ 9184.778649] EXT3-fs error (device sdb2): ext3_put_super: Couldn't clean up the journal
[ 9243.636550] EXT3-fs warning: mounting unchecked fs, running e2fsck is recommended
[ 9243.638973] EXT3-fs: recovery complete.
[ 9243.638976] EXT3-fs: mounted filesystem with ordered data mode.
[ 9305.343298] EXT3-fs warning: mounting unchecked fs, running e2fsck is recommended
[ 9305.345249] EXT3-fs: mounted filesystem with ordered data mode.
[ 9328.776678] EXT3-fs error (device sdb2): ext3_put_super: Couldn't clean up the journal
[15048.450805] EXT3-fs: recovery complete.
[15048.452800] EXT3-fs: mounted filesystem with ordered data mode.
[15055.778655] EXT3-fs error (device sdb2): ext3_put_super: Couldn't clean up the journal
ok it seems one of partitions is broken i've looked around the web
try to :
e2fsck -p your /home partitions and
fsck.vfat -p /dev/sdb1 and e2fsck -p /dev/sdb2
I don't use any kind of automation, not even hal, but I have the same issue, without corruption though.
However, I have found that using cfdisk on /dev/sdb makes /dev/sdb{1,2} appear magically, and I can mount them correctly.
That's not really elegant, but it works for me.
I use adb push most of the time anyways, that way I don't have to unmount the SD from the phone and everything is smooth.
Zappletoo said:
I don't use any kind of automation, not even hal, but I have the same issue, without corruption though.
However, I have found that using cfdisk on /dev/sdb makes /dev/sdb{1,2} appear magically, and I can mount them correctly.
That's not really elegant, but it works for me.
I use adb push most of the time anyways, that way I don't have to unmount the SD from the phone and everything is smooth.
Click to expand...
Click to collapse
tht's strange cfdisk should not help mounting the devices but if it work it's worthing give it a try.
it has to be something with hal and rules :
emerge -pv hal dbus
etc-update
should get rid of that problem
PS : Zappletoo what linux distribution are you using ??
Gentoo.
But I don't use HAL, I don't see any good reason to. I'll try to activate it to see if it makes a difference, but I doubt it.
I'm not sure why cfdisk helps, maybe it simply updates the partition table somewhere.
Update : starting hald makes it work. Using partprobe works as well.. So I guess I was right about the partition table part.
what do you mean use cfdisk on it?
did you just select mount from the phone, then run cfdisk /dev/sdb, then immediately quit?
no no run cfdisk on your computer
Edit: yes I misread. That's what he did.
If things goes well your 2 partitions should appear
John5788 said:
what do you mean use cfdisk on it?
did you just select mount from the phone, then run cfdisk /dev/sdb, then immediately quit?
Click to expand...
Click to collapse
Yes, on the computer.
Apparently it does the same as partprobe, which is available in the sys-apps/parted package.
Hald does everything automatically though, but it's bloated.
Never had a problem with gentoo. No Hal...udev 1.41...custom kernel. Somewhere else on this forum however someone pointed out the phone doesn't show up properly in linux without first probing it. i.e. 'fdisk -l /dev/sda'. This has worked for me whenever I choose to mount it (which is almost never cuz i love adb).

[Q] Phone reboots due to undervolt. Where is error log message ?

Hi,
My Ray sometimes reboots due to what I suspect is an undervolt error situation (cpu/ram).
Is there any log file that I can look into after rebooting, in order to understand what was the cause of the reboot ?
Tks
---------------------------------------------------------------
Xperia Ray
Smart Xperia SX.03.1.B.2.495
VDS Kernel 2.6.32.9 Dec 1 2012
Boost My Xperia 2.0.1 : Multitasking Mode
Sandisk 32GB Class 10 UHS-1
If your kernel support "Ram console" there should be a file named "/proc/last_kmsg" which holds the last kernel log.
Otherwise you can do an "adb logcat" on your PC but that is inconvenient if you can't reproduce manually the problem.
muczy said:
If your kernel support "Ram console" there should be a file named "/proc/last_kmsg" which holds the last kernel log.
Otherwise you can do an "adb logcat" on your PC but that is inconvenient if you can't reproduce manually the problem.
Click to expand...
Click to collapse
Thanks muczy. Will check that.
Will need to investigate further, since these messages seem to be related with a modem module (similar reboot on an Xperia S).
Anyone got similar situation ?
------------- /proc_lastamsslog (snipet) ---------------
ERR crash log report. Version 3.
Error in file mdspasync.c, line 2486
Time of crash (m-d-y h:m:s): 04-16-2013 13:30:04
Uptime (h:m:s): 97:52:24
Build ID: M7630A-ABBQMAZM-2.0.3028DT
REX_TCB ptr: 0x067a1614
tcb.task_name: IST0
Coredump ARCH type is: ERR_ARCH_ARM
Register values from coredump:
ARM_SVC_R0 : 0x00000090
...
Dog Report Information (dog_state_table)
[idx] Task Name Pri Timeout Count Is_Blocked
[ 0] fmrds 0 60 59 0
[ 1] bt_ftm 0 60 59 0
[ 2] time_ipc 0 60 59 0
[ 3] ds_sig 0 60 59 0
[ 4] loc_middlew 0 60 59 0
[ 5] snd 0 4 4 0
[ 6]
------------------------------------------------------------------
----------- /proc/last_kmsg (snipet) ------------------
...
[36005.036865] msmrtc_tod_proc_result: 04/16/2013 13:29:29 (01)
[36005.050659] msmrtc_tod_proc_result: 04/16/2013 13:29:29 (01)
[36005.050781] pm_op(): platform_pm_suspend+0x0/0x54 returns -16
[36005.050842] PM: Device alarm failed to suspend: error -16
[36005.050872] PM: Some devices failed to suspend
[36005.053375] Restarting tasks ... done.
[36005.074340] suspend: exit suspend, ret = -16 (2013-04-16 13:29:29.187896746 UTC)
[36005.074401] active wake lock alarm_rtc, time left 198
[36005.074432] suspend: abort suspend
[36005.887847] suspend: enter suspend
[36005.887878] PM: Syncing filesystems ... done.
[36005.967803] Freezing user space processes ...
[36005.973999] AKM8975 AKECS_GetOpenStatus returned (0)
[36005.982086] (elapsed 0.01 seconds) done.
[36005.982116] Freezing remaining freezable tasks ... (elapsed 0.00 seconds) done.
[36005.983398] Suspending console(s) (use no_console_suspend to debug)
------------------------------------------------------------------
Well, this mdspasync.c seems to be hard to find...
Looked in the androidxref dot com for both Android and Kernel sources, but had no luck.
If someone knows what is this for (seems to be related with modem), that would be great.

[Q] Random restarts

My sensation keeps restarting randomly.
I've tried:
- Reflashing firmware 3.33, 3.32
- Other roms: Miui v4, cm10, cm9, Darksense, ARDHD, stock, gingerbread cm7.
- New battery
- Battery card trick
Sometimes it turns off completely and I can't turn it back on without pulling the battery out and putting it back in.
Moon2 said:
My sensation keeps restarting randomly.
I've tried:
- Reflashing firmware 3.33, 3.32
- Other roms: Miui v4, cm10, cm9, Darksense, ARDHD, stock, gingerbread cm7.
- New battery
- Battery card trick
Sometimes it turns off completely and I can't turn it back on without pulling the battery out and putting it back in.
Click to expand...
Click to collapse
I need more information, so I ask you do these things.
OK. First:
Code:
adb shell
dmesg > /sdcard/DMESG.txt
Attach the DMESG.txt file from your SDCard.
Code:
adb logcat > Logcat.txt
Wait for phone to randomly restart (sorry) and attach the logcat file.
Secondly:
Current HBOOT version? Kernel if flashing manually?
DennisBold said:
I need more information, so I ask you do these things.
OK. First:
Code:
adb shell
dmesg > /sdcard/DMESG.txt
Attach the DMESG.txt file from your SDCard.
Code:
adb logcat > Logcat.txt
Wait for phone to randomly restart (sorry) and attach the logcat file.
Secondly:
Current HBOOT version? Kernel if flashing manually?
Click to expand...
Click to collapse
I'd previously logged the logcat twice before it restarted and also have a last_kmsg of when it happened. It doesn't seem to reboot when I'm in recovery.
HBoot: 1.29.0000, S-off
Kernel: Stock, faux, sebastian (happens on all of them)
I'm having the same problem with my sensation with alternative battery!!! Please help!!!
It just happened again and I've got another logcat, I'll try and do the dmesg now.
I've tried letting the phone sleep without wifi/3g, taking sd card out, formatting it.
Moon2 said:
I'd previously logged the logcat twice before it restarted and also have a last_kmsg of when it happened. It doesn't seem to reboot when I'm in recovery.
HBoot: 1.29.0000, S-off
Kernel: Stock, faux, sebastian (happens on all of them)
Click to expand...
Click to collapse
I thought the pyramid had Adreno 220?
Code:
D/libEGL ( 1113): loaded /system/lib/egl/libGLESv2_adreno200.so
What ROM do you currently have installed?
DennisBold said:
I thought the pyramid had Adreno 220?
Code:
D/libEGL ( 1113): loaded /system/lib/egl/libGLESv2_adreno200.so
What ROM do you currently have installed?
Click to expand...
Click to collapse
Miui v4
I've seen that library used on different phones with adreno on them, I don't think the 200 has a bearing on the type found on the phone.
Moon2 said:
Miui v4
Click to expand...
Click to collapse
Is your GPS enabled, and does this happen when your GPS is disabled?
Moon2 said:
Miui v4
I've seen that library used on different phones with adreno on them, I don't think the 200 has a bearing on the type found on the phone.
Click to expand...
Click to collapse
Never really looked at that, well, the only thing I can connect it with is GPS.
DennisBold said:
Is your GPS enabled, and does this happen when your GPS is disabled?
Click to expand...
Click to collapse
I've tried it with wifi, 3g, bluetooth, gps, auto-sync all turned off and it still happens.
Moon2 said:
I've tried it with wifi, 3g, bluetooth, gps, auto-sync all turned off and it still happens.
Click to expand...
Click to collapse
(From First Logcat)
Code:
D/GpsLocationProvider( 241): [handleMessage] message :7
D/GpsLocationProvider( 241): [handleMessage] UPDATE_LOCATION
D/GpsLocationProvider( 241): handleUpdateLocation
D/lib_locapi( 241): loc_eng_inject_location, accuracy = 48.0
(Second Logcat)
Code:
D/GpsLocationProvider( 242): [handleMessage] message :7
D/GpsLocationProvider( 242): [handleMessage] UPDATE_LOCATION
D/GpsLocationProvider( 242): handleUpdateLocation
D/lib_locapi( 242): loc_eng_inject_location, accuracy = 52.0
Logcat ends a minute not long after that.
On a side note, do you have AdFree installed?
DennisBold said:
(From First Logcat)
Code:
D/GpsLocationProvider( 241): [handleMessage] message :7
D/GpsLocationProvider( 241): [handleMessage] UPDATE_LOCATION
D/GpsLocationProvider( 241): handleUpdateLocation
D/lib_locapi( 241): loc_eng_inject_location, accuracy = 48.0
(Second Logcat)
Code:
D/GpsLocationProvider( 242): [handleMessage] message :7
D/GpsLocationProvider( 242): [handleMessage] UPDATE_LOCATION
D/GpsLocationProvider( 242): handleUpdateLocation
D/lib_locapi( 242): loc_eng_inject_location, accuracy = 52.0
Logcat ends a minute not long after that.
On a side note, do you have AdFree installed?
Click to expand...
Click to collapse
No, I've tried all of the roms with & without adding any apps.
Moon2 said:
No, I've tried all of the roms with & without adding any apps.
Click to expand...
Click to collapse
There's not exactly any errors other than this on dmesg.
Code:
<3>[ 475.735900] init: cannot execve('/system/bin/DxDrmServerIpc'): Permission denied
That isn't really a problem. Neither are these:
Code:
E/MobileDataStateTracker( 242): Error mapping networkType 23 to apnType.
Code:
D/MobileDataStateTracker( 242): internet: mMobileDataState=DISCONNECTED mTeardownRequested=false got [AnyDataCSC] : type=internet state=DISCONNECTED reason=dataDetached apn=null roaming=false unavailable=true NetworkType=0 NetworkTypeName=UNKNOWN entitleError=0 apnCarrier=null
I've just installed cm9 and run the logcat to just before it rebooted.
Moon2 said:
I've just installed cm9 and run the logcat to just before it rebooted.
Click to expand...
Click to collapse
Run Fix Permissions in recovery.
Also, send me another DMESG. Not during/while the phone is crashing.
DennisBold said:
Run Fix Permissions in recovery.
Also, send me another DMESG. Not during/while the phone is crashing.
Click to expand...
Click to collapse
It seems to reboot more frequently on a non-sense rom like cm9/10 than sense based roms like Miui or arhd and I don't think its rebooted or shutdown yet if it's been plugged in to charger/computer.
Moon2 said:
It seems to reboot more frequently on a non-sense rom like cm9/10 than sense based roms like Miui or arhd and I don't think its rebooted or shutdown yet if it's been plugged in to charger/computer.
Click to expand...
Click to collapse
Thanks.
Can you try:
Code:
adb shell
dmesg | grep mmc
And copy and paste the results?
You should see:
Code:
[email protected]:/ # dmesg | grep mmc
dmesg | grep mmc
[email protected]:/ #
---------- Post added at 08:04 PM ---------- Previous post was at 07:33 PM ----------
Could you run?
Code:
cat /sys/class/block/mmcblk0/device/name
Code:
[email protected]:/ $ dmesg | grep mmc
dmesg | grep mmc
1|[email protected]:/ $ cat /sys/class/block/mmcblk0/device/name
cat /sys/class/block/mmcblk0/device/name
MLL00M
Moon2 said:
Code:
[email protected]:/ $ dmesg | grep mmc
dmesg | grep mmc
1|[email protected]:/ $ cat /sys/class/block/mmcblk0/device/name
cat /sys/class/block/mmcblk0/device/name
MLL00M
Click to expand...
Click to collapse
Flash an RUU (preferably Gingerbread) and see if it makes any difference?
Run this from stock and see if you still have errors
Code:
adb shell
dmesg | grep mmc
logcat | grep mmc
DennisBold said:
Flash an RUU (preferably Gingerbread) and see if it makes any difference?
Run this from stock and see if you still have errors
Code:
adb shell
dmesg | grep mmc
logcat | grep mmc
Click to expand...
Click to collapse
Code:
dmesg | grep mmc
Code:
<5>[ 0.000000] Kernel command line: poweron_status=1 board_pyramid.disable_ua
rt3=0 diag.enabled=0 board_pyramid.debug_uart=0 userdata_sel=0 androidboot.emmc=
true androidboot.pagesize=2048 androidboot.baseband=10.14.9035.01_M androidboo
t.cid=11111111 androidboot.batt_poweron=good_battery androidboot.carrier=ALL and
roidboot.mid=PG5813000 androidboot.keycaps=qwerty androidboot.dq=FAIL androidboo
t.mode=normal androidboot.serialno=SH191V463715 androidboot.bootloader=1.17.1111
zygote_oneshot=off msm_watchdog.enable=1 console=ttyHSL0 androidboot.hardware=p
yramid no_console_suspend=1
<6>[ 0.335052] pyramid: pyramid_init_mmc
<6>[ 0.907806] Create /proc/emmc OK.
<3>[ 2.389921] mmc0: No card detect facilities available
<6>[ 2.390287] mmc0: Qualcomm MSM SDCC at 0x0000000012400000 irq 136,0 dma 18
<6>[ 2.390379] mmc0: Platform slot type: MMC
<6>[ 2.390562] mmc0: 8 bit data mode enabled
<6>[ 2.390654] mmc0: 4 bit data mode disabled
<6>[ 2.390745] mmc0: polling status mode disabled
<6>[ 2.390928] mmc0: MMC clock 400000 -> 48000000 Hz, PCLK 0 Hz
<6>[ 2.391020] mmc0: Slot eject status = 0
<6>[ 2.391203] mmc0: Power save feature enable = 1
<6>[ 2.391294] mmc0: DM non-cached buffer at ff007000, dma_addr 0x5751b000
<6>[ 2.391386] mmc0: DM cmd busaddr 0x5751b000, cmdptr busaddr 0x5751b300
<6>[ 2.391966] mmc1: Qualcomm MSM SDCC at 0x0000000012180000 irq 134,654 dma
20
<6>[ 2.392149] mmc1: Platform slot type: SD
<6>[ 2.392240] mmc1: 8 bit data mode disabled
<6>[ 2.392332] mmc1: 4 bit data mode enabled
<6>[ 2.392515] mmc1: polling status mode disabled
<6>[ 2.392607] mmc1: MMC clock 144000 -> 48000000 Hz, PCLK 0 Hz
<6>[ 2.392790] mmc1: Slot eject status = 0
<6>[ 2.392881] mmc1: Power save feature enable = 1
<6>[ 2.392973] mmc1: DM non-cached buffer at ff008000, dma_addr 0x5751c000
<6>[ 2.393156] mmc1: DM cmd busaddr 0x5751c000, cmdptr busaddr 0x5751c300
<6>[ 2.393644] mmc2: Qualcomm MSM SDCC at 0x00000000121c0000 irq 133,0 dma 21
<6>[ 2.393736] mmc2: Platform slot type: N/A
<6>[ 2.393919] mmc2: 8 bit data mode disabled
<6>[ 2.394010] mmc2: 4 bit data mode enabled
<6>[ 2.394102] mmc2: polling status mode disabled
<6>[ 2.394285] mmc2: MMC clock 400000 -> 48000000 Hz, PCLK 0 Hz
<6>[ 2.394377] mmc2: Slot eject status = 1
<6>[ 2.394468] mmc2: Power save feature enable = 1
<6>[ 2.394651] mmc2: DM non-cached buffer at ff009000, dma_addr 0x5751d000
<6>[ 2.394743] mmc2: DM cmd busaddr 0x5751d000, cmdptr busaddr 0x5751d300
<6>[ 2.513761] mmc0: new high speed MMC card at address 0001
<6>[ 2.526975] mmcblk0: mmc0:0001 MLL00M 2.25 GiB
<6>[ 2.527555] mmcblk0: p1 p2 p3 p4 < p5 p6
<6>[ 2.568296] EXT4-fs (mmcblk0p22): INFO: recovery required on readonly file
system
<6>[ 2.568662] EXT4-fs (mmcblk0p22): write access will be enabled during reco
very
<4>[ 2.666654] mmc1: high speed mode max_dtr = 50000000
<4>[ 2.667081] mmc1: host does not support reading read-only switch. assuming
write-enable.
<6>[ 2.667264] mmc1: new high speed SD card at address 1234
<6>[ 2.667753] mmcblk1: mmc1:1234 SA02G 1.83 GiB
<6>[ 2.668149] mmcblk1: p1
<6>[ 2.697813] EXT4-fs (mmcblk0p22): recovery complete
<6>[ 2.705625] EXT4-fs (mmcblk0p22): mounted filesystem with ordered data mod
e. Opts: (null)
<7>[ 3.291562] EXT4-fs (mmcblk0p23): ext4_orphan_cleanup: deleting unreferenc
ed inode 22945
<7>[ 3.292050] EXT4-fs (mmcblk0p23): ext4_orphan_cleanup: deleting unreferenc
ed inode 22946
<6>[ 3.292416] EXT4-fs (mmcblk0p23): 2 orphan inodes deleted
<6>[ 3.292691] EXT4-fs (mmcblk0p23): recovery complete
<6>[ 3.334836] EXT4-fs (mmcblk0p23): mounted filesystem with ordered data mod
e. Opts: nodelalloc
<6>[ 3.389493] EXT4-fs (mmcblk0p24): recovery complete
<6>[ 3.397031] EXT4-fs (mmcblk0p24): mounted filesystem with ordered data mod
e. Opts: nodelalloc
<6>[ 3.516964] EXT4-fs (mmcblk0p27): recovery complete
<6>[ 3.521115] EXT4-fs (mmcblk0p27): mounted filesystem with writeback data m
ode. Opts: nodelalloc
<6>[ 20.862468] mmc2: Slot status change detected (0 -> 1)
<7>[ 20.915202] mmc2: queuing CIS tuple 0x91 length 3
<6>[ 20.915446] mmc2: new high speed SDIO card at address 0001
Code:
logcat | grep mmc
I've left it running for a few mins but nothings showing up.
Its still not showing anything, but I'm attaching a logcat on stock gb upto the point it restarted.

Test custom (zip) ROM on Android Emulator

Hi all,
As the title says, the question is how to test a custom rom (the zip file that you should flash on your device) on an Android emulator. I opened this thread because also if this is a common problem with several threads about it (also here on xda), there isn't a real answer, i.e. a working method. I think I'm close to the solution, but it still doesn't work. So, I decided to share here my knowledge with the hope that someone can help me. This method is only for Linux.
Initial setup
Download and open Android Studio. Go to Tools -> Android -> AVD Manager. Create a new device with the same specs of your device. This means that you should choose the same screen size/resolution and the right cpu architecture. Android Studio suggests to install x86 images, because the emulation is faster. Nowadays, the most common architecture on smartphones is armeabi-v7a, so choose this one. I'll use as example a device with Android 4.2 (armeabi-v7a).
Replace system.img
If you go into ~/Android/Sdk/system-images folder, you'll find the folders related to the images that you've installed previously (in the initial setup). In my case I have ~/Android/Sdk/system-images/android-17/google_apis/armeabi-v7a/ which contains system.img. The system.img is the system partition. It's an ext4 filesystem image that you can mount in a folder (i.e. it's a way to "extract" its content):
Code:
$ mkdir system
# mount -o loop system.img system
Now you can edit its content, e.g. replacing some files. When you've done, you can unmount the image with the following command:
Code:
# umount /absolute/path/to/the/system.img
Our goal is to replace the system.img file with the system.img of our custom rom. Unzip the custom rom. If you go into its folder, you'll see the system folder that we need to transform into system.img.
First of all, we should rename the original system.img file (the stock android image):
Code:
$ cd ~/Android/Sdk/system-images/android-17/google_apis/armeabi-v7a
$ mv system.img original_system.img
Now we'll create a new ext4 filesystem (with the same number of blocks) where we'll put the content of the system folder of our custom rom.
Code:
$ dd if=/dev/null of=system.img bs=1M seek=550
$ mkfs.ext4 -F system.img
$ mkdir custom_system
# mount -o loop system.img custom_system
# cp -r /path/to/our/custom/rom/system/* custom_system/
# chmod 755 -R custom_system/
# umount /absolute/path/to/system.img
Note that we are using seek=550, because if the original system.img has 140800 blocks with a total size of 576.7 MB, we need to allocate the same amount of space. In fact, also our (custom) system.img will have a size of 576.7 MB with the same number of blocks. The last command (umount) isn't mandatory, you can proceed keeping mounted the image.
Start the emulator
At this point we should execute the emulator hoping that our system.img is ok.
Run the emulator following this command (I've a 64 bit system):
Code:
$ LD_LIBRARY_PATH=~/Android/Sdk/tools/emulator/lib64 ~/Android/Sdk/tools/emulator/emulator64-arm -show-kernel -avd Name_of_your_avd
I defined LD_LIBRARY_PATH because otherwise it can't find the libraries for the gpu emulation, an alternative solution is to use -gpu off to disable gpu emulation. The -show-kernel parameter is useful to see if there is some problem while the device is booting, instead of -debug-all that is useful to see all the stuff related to the emulator itself and not to the operating system (Android).
-----------------
Small Off-Topic:
Note that on my Linux system to start the emulator for an x86 image I should use:
Code:
LD_PRELOAD="/usr/lib/libstdc++.so.6" ./emulator -avd Avd_Name
--------------
In my case, it seems there is some problem during the boot (black screen all the time). The kernel messages are:
Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0
Initializing cgroup subsys cpu
Linux version 3.4.67-01422-gd3ffcc7-dirty ([email protected]) (gcc version 4.8 (GCC) ) #1 PREEMPT Tue Sep 16 19:34:06 CEST 2014
CPU: ARMv7 Processor [410fc080] revision 0 (ARMv7), cr=10c53c7d
CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Machine: Goldfish
Truncating RAM at 00000000-3fffffff to -2f7fffff (vmalloc region overlap).
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 193040
Kernel command line: qemu=1 androidboot.hardware=goldfish console=ttyS0 android.qemud=1 android.checkjni=1 qemu.gles=0
PID hash table entries: 4096 (order: 2, 16384 bytes)
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 760MB = 760MB total
Memory: 748640k/748640k available, 29600k reserved, 0K highmem
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
vmalloc : 0xf0000000 - 0xff000000 ( 240 MB)
lowmem : 0xc0000000 - 0xef800000 ( 760 MB)
.text : 0xc0008000 - 0xc0450618 (4386 kB)
.init : 0xc0451000 - 0xc0476000 ( 148 kB)
.data : 0xc0476000 - 0xc04af9c8 ( 231 kB)
.bss : 0xc04afa08 - 0xc05f9cb0 (1321 kB)
NR_IRQS:256
sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 4294967286ms
Console: colour dummy device 80x30
Calibrating delay loop... 410.41 BogoMIPS (lpj=2052096)
pid_max: default: 32768 minimum: 301
Security Framework initialized
SELinux: Initializing.
Mount-cache hash table entries: 512
Initializing cgroup subsys debug
Initializing cgroup subsys cpuacct
Initializing cgroup subsys freezer
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0x3628b0 - 0x362908
NET: Registered protocol family 16
bio: create slab <bio-0> at 0
Switching to clocksource goldfish_timer
NET: Registered protocol family 2
IP route cache hash table entries: 32768 (order: 5, 131072 bytes)
TCP established hash table entries: 131072 (order: 8, 1048576 bytes)
TCP bind hash table entries: 65536 (order: 6, 262144 bytes)
TCP: Hash tables configured (established 131072 bind 65536)
TCP: reno registered
UDP hash table entries: 512 (order: 1, 8192 bytes)
UDP-Lite hash table entries: 512 (order: 1, 8192 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
Trying to unpack rootfs image as initramfs...
Freeing initrd memory: 176K
goldfish_new_pdev goldfish_interrupt_controller at ff000000 irq -1
goldfish_new_pdev goldfish_device_bus at ff001000 irq 1
goldfish_new_pdev goldfish_timer at ff003000 irq 3
goldfish_new_pdev goldfish_rtc at ff010000 irq 10
goldfish_new_pdev goldfish_tty at ff002000 irq 4
goldfish_new_pdev goldfish_tty at ff011000 irq 11
goldfish_new_pdev smc91x at ff012000 irq 12
goldfish_new_pdev goldfish_fb at ff013000 irq 13
goldfish_new_pdev goldfish_audio at ff004000 irq 14
goldfish_new_pdev goldfish_mmc at ff005000 irq 15
goldfish_new_pdev goldfish-battery at ff014000 irq 16
goldfish_new_pdev goldfish_events at ff015000 irq 17
goldfish_new_pdev goldfish_nand at ff016000 irq -1
goldfish_new_pdev qemu_pipe at ff017000 irq 18
goldfish_pdev_worker registered goldfish_interrupt_controller
goldfish_pdev_worker registered goldfish_device_bus
goldfish_pdev_worker registered goldfish_timer
goldfish_pdev_worker registered goldfish_rtc
goldfish_pdev_worker registered goldfish_tty
goldfish_pdev_worker registered goldfish_tty
goldfish_pdev_worker registered smc91x
goldfish_pdev_worker registered goldfish_fb
goldfish_pdev_worker registered goldfish_audio
goldfish_pdev_worker registered goldfish_mmc
goldfish_pdev_worker registered goldfish-battery
goldfish_pdev_worker registered goldfish_events
goldfish_pdev_worker registered goldfish_nand
goldfish_pdev_worker registered qemu_pipe
audit: initializing netlink socket (disabled)
type=2000 audit(0.240:1): initialized
Installing knfsd (copyright (C) 1996 [email protected]).
fuse init (API version 7.18)
msgmni has been set to 1462
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
console [ttyS0] enabled
brd: module loaded
loop: module loaded
nbd: registered device at major 43
goldfish_audio_probe
goldfish nand dev0: size 22600000, page 512, extra 0, erase 0
goldfish nand dev1: size 80000000, page 512, extra 0, erase 0
goldfish nand dev2: size 4200000, page 512, extra 0, erase 0
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky <[email protected]>
smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre <[email protected]>
eth0: SMC91C11xFD (rev 1) at fe012000 IRQ 12 [nowait]
eth0: Ethernet addr: 52:54:00:12:34:56
mousedev: PS/2 mouse device common for all mice
*** events probe ***
events_probe() addr=0xfe015000 irq=17
events_probe() keymap=qwerty2
input: qwerty2 as /devices/virtual/input/input0
goldfish_rtc goldfish_rtc: rtc core: registered goldfish_rtc as rtc0
device-mapper: uevent: version 1.0.3
device-mapper: ioctl: 4.22.0-ioctl (2011-10-19) initialised: [email protected]
ashmem: initialized
logger: created 256K log 'log_main'
logger: created 256K log 'log_events'
logger: created 256K log 'log_radio'
logger: created 256K log 'log_system'
Netfilter messages via NETLINK v0.30.
nf_conntrack version 0.5.0 (11700 buckets, 46800 max)
ctnetlink v0.93: registering with nfnetlink.
NF_TPROXY: Transparent proxy support initialized, version 4.1.0
NF_TPROXY: Copyright (c) 2006-2007 BalaBit IT Ltd.
xt_time: kernel timezone is -0000
ip_tables: (C) 2000-2006 Netfilter Core Team
arp_tables: (C) 2002 David S. Miller
TCP: cubic registered
NET: Registered protocol family 10
ip6_tables: (C) 2000-2006 Netfilter Core Team
IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
NET: Registered protocol family 15
8021q: 802.1Q VLAN Support v1.8
VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 0
mmc0: new SD card at address e118
goldfish_rtc goldfish_rtc: setting system clock to 2017-04-11 07:32:53 UTC (1491895973)
Freeing init memory: 148K
mmcblk0: mmc0:e118 SU02G 100 MiB
mmcblk0:
init (1): /proc/1/oom_adj is deprecated, please use /proc/1/oom_score_adj instead.
init: cannot open '/initlogo.rle'
yaffs: dev is 32505856 name is "mtdblock0" rw
yaffs: passed flags ""
yaffs: dev is 32505857 name is "mtdblock1" rw
yaffs: passed flags ""
yaffs: dev is 32505858 name is "mtdblock2" rw
yaffs: passed flags ""
fs_mgr: Warning: unknown flag voldmanaged=sdcard:auto
fs_mgr: Warning: unknown flag noemulatedsd
EXT4-fs (mtdblock0): mounted filesystem with ordered data mode. Opts: barrier=1
EXT4-fs (mtdblock1): recovery complete
EXT4-fs (mtdblock1): mounted filesystem with ordered data mode. Opts: nomblk_io_submit,errors=remount-ro
fs_mgr: Running /system/bin/e2fsck on /dev/block/mtdblock1
fs_mgr: Cannot run fs_mgr binary /system/bin/e2fsck
EXT4-fs (mtdblock1): mounted filesystem with ordered data mode. Opts: barrier=1,nomblk_io_submit
EXT4-fs (mtdblock2): recovery complete
EXT4-fs (mtdblock2): mounted filesystem with ordered data mode. Opts: nomblk_io_submit,errors=remount-ro
fs_mgr: Running /system/bin/e2fsck on /dev/block/mtdblock2
fs_mgr: Cannot run fs_mgr binary /system/bin/e2fsck
EXT4-fs (mtdblock2): mounted filesystem with ordered data mode. Opts: (null)
fs_mgr: Cannot mount filesystem on /devices/platform/goldfish_mmc.0* at auto
init: fs_mgr_mount_all returned an error
fs_mgr: Cannot mount filesystem on /dev/block/mtdblock2 at /cache
init: fs_mgr_mount_all returned an error
fs_mgr: Cannot mount filesystem on /dev/block/mtdblock1 at /data
init: fs_mgr_mount_all returned an error
init: cannot find '/system/bin/qemu-props', disabling 'qemu-props'
init: cannot find '/system/etc/install-recovery.sh', disabling 'flash_recovery'
init: cannot find '/system/bin/qemud', disabling 'qemud'
init: cannot execve('/system/etc/init.goldfish.sh'): No such file or directory
init: cannot find '/system/bin/sh', disabling 'console'
init: untracked pid 63 exited
warning: `rild' uses 32-bit capabilities (legacy support in use)
init: untracked pid 56 exited
init: untracked pid 99 exited
init: untracked pid 149 exited
...continue with endless processes termination...
Click to expand...
Click to collapse
I created the system.img from a custom rom for huawei u9508 based on Android 4.2.2. I hope this post could be useful.
Nrin said:
Hi all,
As the title says, the question is how to test a custom rom (the zip file that you should flash on your device) on an Android emulator. I opened this thread because also if this is a common problem with several threads about it (also here on xda), there isn't a real answer, i.e. a working method. I think I'm close to the solution, but it still doesn't work. So, I decided to share here my knowledge with the hope that someone can help me. This method is only for Linux.
Initial setup
Download and open Android Studio. Go to Tools -> Android -> AVD Manager. Create a new device with the same specs of your device. This means that you should choose the same screen size/resolution and the right cpu architecture. Android Studio suggests to install x86 images, because the emulation is faster. Nowadays, the most common architecture on smartphones is armeabi-v7a, so choose this one. I'll use as example a device with Android 4.2 (armeabi-v7a).
Replace system.img
If you go into ~/Android/Sdk/system-images folder, you'll find the folders related to the images that you've installed previously (in the initial setup). In my case I have ~/Android/Sdk/system-images/android-17/google_apis/armeabi-v7a/ which contains system.img. The system.img is the system partition. It's an ext4 filesystem image that you can mount in a folder (i.e. it's a way to "extract" its content):
Now you can edit its content, e.g. replacing some files. When you've done, you can unmount the image with the following command:
Our goal is to replace the system.img file with the system.img of our custom rom. Unzip the custom rom. If you go into its folder, you'll see the system folder that we need to transform into system.img.
First of all, we should rename the original system.img file (the stock android image):
Now we'll create a new ext4 filesystem (with the same number of blocks) where we'll put the content of the system folder of our custom rom.
Note that we are using seek=550, because if the original system.img has 140800 blocks with a total size of 576.7 MB, we need to allocate the same amount of space. In fact, also our (custom) system.img will have a size of 576.7 MB with the same number of blocks. The last command (umount) isn't mandatory, you can proceed keeping mounted the image.
Start the emulator
At this point we should execute the emulator hoping that our system.img is ok.
Run the emulator following this command (I've a 64 bit system):
I defined LD_LIBRARY_PATH because otherwise it can't find the libraries for the gpu emulation, an alternative solution is to use -gpu off to disable gpu emulation. The -show-kernel parameter is useful to see if there is some problem while the device is booting, instead of -debug-all that is useful to see all the stuff related to the emulator itself and not to the operating system (Android).
-----------------
Small Off-Topic:
Note that on my Linux system to start the emulator for an x86 image I should use:
--------------
In my case, it seems there is some problem during the boot (black screen all the time). The kernel messages are:
I created the system.img from a custom rom for huawei u9508 based on Android 4.2.2. I hope this post could be useful.
Click to expand...
Click to collapse
kernel is not work for your system.img

Categories

Resources