I am trying to get a Android Things Image to boot on the Compute Module 3.
I have gone through several trial and error to try and get a working image. Currently I sit in the Kernel after getting through the DTB problem I was originally facing.
I use dd to flash the image through RPIBOOT, I validate the pi fully works with Raspian.
This is what I see in the serial console:
MMC: mmc#7e300000: 0
reading uboot.env
In: serial
Out: serial
Err: serial
Net: Net Initialization Skipped
No ethernet found.
ANDROID: Attempting slot b, tries remaining 6
ANDROID: Booting slot: b
Failed to mount ext2 filesystem...
** Unrecognized filesystem type **
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
ANDROID: reboot reason: "(none)"
** Invalid Android Image header **
Android boot failed, error -1.
resetting ...
U-�MMC: mmc#7e300000: 0
reading uboot.env
In: serial
Out: serial
Err: serial
Net: Net Initialization Skipped
No ethernet found.
ANDROID: Attempting slot a, tries remaining 5
ANDROID: Booting slot: a
72 bytes read in 31 ms (2 KiB/s)
ANDROID: reboot reason: "(none)"
Booting kernel at 0x1000000 with fdt at 2efe8600...
## Booting Android Image at 0x01000000 ...
Kernel load addr 0x01000800 size 8385 KiB
Kernel command line: buildvariant=userdebug
RAM disk load addr 0x11000000 size 4947 KiB
## Flattened Device Tree blob at 2efe8600
Booting using the fdt blob at 0x2efe8600
XIP Kernel Image ... OK
Loading Ramdisk to 2cb2b000, end 2cfffb11 ... OK
reserving fdt memory region: addr=0 size=1000
reserving fdt memory region: addr=2efe8600 size=ba00
Loading Device Tree to 2dff1000, end 2dfff9ff ... OK
Starting kernel ...
Note The file system can't be mounted:
ANDROID: Attempting slot b, tries remaining 6
ANDROID: Booting slot: b
Failed to mount ext2 filesystem...
It will sit there forever. I have a feeling it is still something is wrongs with the Device Tree Blob that got me here. I also know the image is okay because I can boot it on a PI 3 B
I have tried both a CM3L and CM.
Both do the same thing and respond the same to the changes so I'm fairly confident that it is not a eMMC vs SD issue.
Does anyone have any thoughts on how I could debug this? Or even better a resource I can utilize to find the Android Things Kernel code for PI?
Related
I am working on a "GNU/Linux on Android" type of project that is based on Mikael Q. Kuisma's work here .
I built a tool that downloads a toolchain, compiles the kernel, archives the custom ramdisk, and finally bundles them into a boot image.
Expected result:
Kernel boots.
Ramdisk gets loaded and /init is executed using /sbin/busybox.
Actual result:
Kernel does boot.
The kernel never seems to reach /init, and hangs without panicking.
I've tried adding calls to /sbin/busybox poweroff in the /init script to see if it was actually reaching execution, nothing changed.
I identified a few points that seemed problematic, one being this:
[ 3.880314] Warning: unable to open an initial console.
[ 3.880429] Waiting for root device ... # Might be the problem.
[ 4.882304] lct will vote for sdp current
[ 4.882437] pmi632_charger: smblib_update_usb_type: lct v02 battery charge APSD=SDP PD=0
[ 4.889933] msm-dwc3 7000000.ssusb: DWC3 exited from low power mode
[ 5.520181] of_batterydata_get_best_profile: light_4000mAh found
[ 8.760236] cfg_timer_func enter
[ 8.760267] cfg_work_routine enter
# Nothing appears after this point...
I have included the source code for my build tool with the kernel log buffer in this git repository. You can find the defconfig I used for the kernel build here.
Any help would be appreciated. :)
I'm getting the below error while making system.img
there are all files like boot.img, vendor.img but not system img
Allocating group tables: done
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
set_selinux_xattr: No such file or directory searching for label
"/bt_firmware" e2fsdroid: No such file or directory while configuring
the file system loaded 3450 fs_config entries
Out of space? Out of inodes? The tree size of
/home/prashi_kadasi/arrow10/out/soong/.temp/tmpP2XFd3 is 1272721408
bytes (1213 MB), with reserved space of 0 bytes (0 MB). The max image
size for filesystem files is 4294967296 bytes (4096 MB), out of a
total partition size of 4294967296 bytes (4096 MB). 01:24:45 ninja
failed with: exit status 1
failed to build some targets (01:02 (mm:ss))
Check that you include this
/bt_firmware(/.*)? u:object_r:bt_firmware_file:s0
in your file_contexts and this
type bt_firmware_file, file_type;
in your file.te (and that you have your sepolicy included)
I know the solution to this was given for the most part, but I see this asked quite a lot and I figure this a good place to give a little background.
So the answer is usually given in some form of "add the offending label to file_contexts and and make sure its labeled", apart from that, rebuilding file_contexts and sepolicy/sepolicy.recovery and starting a new build fixes it.
The issue stems fro selabel_lookup failing, and in my experience this is usually due to additions to device trees and or changes that weren't accounted for before file_contexts.bin is created by the build system. You can learn a lot more about the issue from this now obscure commit
I am trying to find memory leaks and corruptions in my native code, which is part of a sample java app. Since the procedure for using malloc debug has been updated from Nougat onwards (ref: Malloc Debug for Android N), I have followed the steps in that page to set the options of my interest.
Fortunately, I was able to get the mem corruption detection work (by use of guard option) for a simple buffer overflow in my native code. But, whatever option I use, I couldn't get the leaks detected.
I tried these options:
adb shell setprop libc.debug.malloc.options backtrace
adb shell setprop libc.debug.malloc.options leak_track
I also tried a combination of both options. I didnt see any mallocs or leaks present in my code being captured in logcat. In fact, for most devices I see that device is stuck in bootup when 'backtrace' option is set.
However, what I see is in the logs, is apparently false-positives for leaks in lot of other system programs:
12-16 13:05:51.908 8396 8396 E malloc_debug: +++ chmod leaked block of size 152 at 0x7f7de4b0e0 (leak 1 of 19)
...
12-16 13:05:52.156 8423 8423 E malloc_debug: +++ chown leaked block of size 152 at 0x7f8384b0e0 (leak 1 of 26)
...
12-16 13:05:56.533 8845 8845 E malloc_debug: +++ getprop leaked block of size 152 at 0x7fb684b0e0 (leak 1 of 17)
...
12-16 13:07:24.036 12393 12393 E malloc_debug: +++ /system/bin/dex2oat leaked block of size 131072 at 0xeb22c010 (leak 1 of 2452)
...
12-16 13:07:49.192 13734 13734 E malloc_debug: +++ logcat leaked block of size 5176 at 0x7f8dc5f020 (leak 1 of 21)
So, I have two questions in this context:
Does my apk need to be in a specific location for backtrace/leak_track to work? Was it ever tested for apks before, at least on N?
Do I need to set any other option for leak detection to work?
It looks like Malloc debug on Nougat is not explored much, so I didnt see any results on Google for any known issues or restrictions.
More details on my setup:
- Android Nougat 7.0
- 64 bit chipset
- Java sample app, with native code as shared lib
My Android project gets built fine on a Windows dev machine with lots of RAM. But in a simple Docker container (FROM ubuntu:xenial + Android SDK) gradle build (./gradlew assembleTrunkDebug) fails on 58% while executing the task:
transformClassesWithPreJackPackagedLibrariesForTrunkDebug
Even with --stacktrace --debug the most I get from the error is:
Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)
There are several strange thing that I have noticed:
It doesn't matter what memory arguments I'm passing to the docker container instantiation. It always shows me the same memory stats.
Tasks: 2 total, 1 running, 1 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.0 us, 0.0 sy, 0.0 ni,100.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 1019776 total, 860604 free, 88840 used, 70332 buff/cache
KiB Swap: 1168688 total, 853640 free, 315048 used. 824484 avail Mem
I'm usually doing something like:
docker run -it --volume=/Users/MyUser/code/localDebugRepo:/localDebugRepo --workdir="/localDebugRepo" --memory="2048m" --memory-swap="2048m" 66b48030ee34 /bin/bash
But I have also tried to pass less memory and the same memory-swap or more total memory, but it always shows me Mem: 1019776 and Swap: 1168688.
I also noticed in the task manager that VBoxHeadless.exe uses only 41MB of RAM. While the misfortunate task is running (which takes a long time before crashing), the RAM usage doesn't change, but the Disk transfer is huge and only consumes more and more (since it's on SSD drive).
Android suggests the new build tool Jack and Jill used for the latest sdks has to be allowed to use at least 1536m memory. But the Docker image should run with max of 2048m and having in mind that I wasn't able to shrink the swap, I have the feeling something goes wrong there.
So any thoughts what might have caused this consistent error?
I am testing Relatek Wi-Fi Driver in Android LOllipop. The driver is registered as
usbcore: registered new interface driver rtl8192du
And the lsmod shows the output as
8192du 488167 0 - Live 0x00000000
The driver is inserted successfully . And the netcfg output shows that the wlan0 interface is down.
I tried to make the interface active as ifconfig wlan0 up and suddenly the kernel crashes and reboots after 5 seconds.
What are the reasons for the ifconfig to fail especially to crash the kernel?.....Any help would be appreciated
The kernel crash log is provided below
e[<8031bcf4>] (vsnprintf+0x38/0x424) from [<8004b534>] (kthread_create_on_node+0x98/0xdc)
[<8004b534>] (kthread_create_on_node+0x98/0xdc) from [<7f03d05c>] (rtw_start_drv_threads+0x20/0x5c [8192du])
[<80647c24>] (__dev_open+0xa0/0xfc) from [<80647e58>] (__dev_change_flags+0x8c/0x128)
[<80647e58>] (__dev_change_flags+0x8c/0x128) from [<80647f60>] (dev_change_flags+0x10/0x48)
[<80647f60>] (dev_change_flags+0x10/0x48) from [<806d16ac>] (devinet_ioctl+0x780/0x828)
[<806d16ac>] (devinet_ioctl+0x780/0x828) from [<806323c8>] (sock_ioctl+0x68/0x28c)
[<806323c8>] (sock_ioctl+0x68/0x28c) from [<800f09e8>] (do_vfs_ioctl+0x80/0x5bc)
[<800f09e8>] (do_vfs_ioctl+0x80/0x5bc) from [<800f0f94>] (SyS_ioctl+0x70/0x78)
[<800f0f94>] (SyS_ioctl+0x70/0x78) from [<8000e0c0>] (ret_fast_syscall+0x0/0x30)
Code: ba0000ee e59da014 e3a0b020 e59d1018 (e5d23000)
---[ end trace ffb896cf8181c101 ]---
Kernel panic - not syncing: Fatal exception
So many reasons..... but...
1) post backtrace (kernel backtrace) for more information
2) suspect ioctl which is connect to ifconfig - bring up the wlan (if it's not ioctl, then something else like proc, netlink or whatever to communicate kernel)
3) the vap (wlan) enable code itself
I think that we may need crash backtrace and we can understand it better....