- android source 由 kernel.org 改 googlesource
- git: 改 https:
repo init -u https://android.googlesource.com/platform/manifest.git -b ginerbread
repo sync
要是 sync 的時候出現 ../platform/bionic is not a valid git host 之類的,是 repo 太舊。
請重新抓一份下來:
ubuntu 在 R40e 上 還有 Debian 在 Sempron 2600 上
repo init -u https://android.googlesource.com/platform/manifest.git -b ginerbread
repo sync
repo forall -c 'git checkout gingerbread'
但是有一些 project 是額外 clone 的,所以沒有 gingerbread 這個branch。* gingerbread | not in: RTK bootable/bootloader/uboot-imx device/fsl external/alsa-lib external/alsa-utils external/linux-atheros-wifi external/linux-firmware-imx external/linux-lib external/mtd-utils external/qemu external/systemtap external/wpa_supplicant_ath hardware/alsa_sound hardware/mx5x kernel_imx sdk system/dispd system/wlan/atheros
fatal: bad object 99ca2c610588d9f690d8738d965837607641153f
Error! Base version commit 99ca2c610588d9f690d8738d965837607641153f doesn't exist in git /home/charles-chang/demo10.2/cts. Stop
ref: http://androidxref.com/source/history/cts/ cd cts
git remote add aosp https://android.googlesource.com/platform/cts
git fetch aosp
checkout aosp 的 gingerbread
git checkout aosp/gingerbread
繼續作 c_patch,出現:
Warning: The following NEW gits exist already in your work tree and will be removed firstly.
external/linux-lib
external/linux-firmware-imx
external/linux-atheros-wifi
external/wpa_supplicant_ath
system/wlan/atheros
hardware/mx5x
external/systemtap
system/dispd
device/fsl
Continue? [yes/no]
回答 yes 後他會繼續...* imx_r10.3 | not in:
device/fsl
external/linux-atheros-wifi
external/linux-firmware-imx
external/linux-lib
external/systemtap
external/wpa_supplicant_ath
hardware/mx5x
system/dispd
find . -type d -name '*.git'
./kernel_imx.git
./device/fsl.git
./platform/bootable/recovery.git
./platform/bootable/bootloader/uboot-imx.git
./platform/development.git
./platform/packages/apps/Browser.git
./platform/packages/apps/Music.git
./platform/packages/providers/MediaProvider.git
./platform/libcore.git
./platform/hardware/alsa_sound.git
./platform/hardware/mx5x.git
./platform/external/linux-lib.git
./platform/frameworks/base.git
./platform/system/core.git
./platform/build.git
[28365.656849] usb 2-1.1.4.2: new high speed USB device using ehci_hcd and address 27
[28365.767190] usb 2-1.1.4.2: New USB device found, idVendor=12d1, idProduct=1446
[28365.767198] usb 2-1.1.4.2: New USB device strings: Mfr=3, Product=2, SerialNumber=0
[28365.767202] usb 2-1.1.4.2: Product: HUAWEI Mobile
[28365.767207] usb 2-1.1.4.2: Manufacturer: HUAWEI Technology
[28365.767413] usb 2-1.1.4.2: configuration #1 chosen from 1 choice
[28365.769240] scsi27 : SCSI emulation for USB Mass Storage devices
[28365.769394] usb-storage: device found at 27
[28365.769398] usb-storage: waiting for device to settle before scanning
[28365.769574] scsi28 : SCSI emulation for USB Mass Storage devices
[28365.769824] usb-storage: device found at 27
[28365.769828] usb-storage: waiting for device to settle before scanning
[28366.721210] usb 2-1.1.4.2: USB disconnect, address 27
[28370.522478] usb 2-1.1.4.2: new high speed USB device using ehci_hcd and address 28
[28370.633030] usb 2-1.1.4.2: New USB device found, idVendor=12d1, idProduct=1436
[28370.633036] usb 2-1.1.4.2: New USB device strings: Mfr=4, Product=3, SerialNumber=0
[28370.633040] usb 2-1.1.4.2: Product: HUAWEI Mobile
[28370.633043] usb 2-1.1.4.2: Manufacturer: HUAWEI Technology
[28370.633208] usb 2-1.1.4.2: configuration #1 chosen from 1 choice
[28370.637030] scsi34 : SCSI emulation for USB Mass Storage devices
[28370.637157] usb-storage: device found at 28
[28370.637161] usb-storage: waiting for device to settle before scanning
[28370.637658] scsi35 : SCSI emulation for USB Mass Storage devices
[28370.637854] usb-storage: device found at 28
[28370.637857] usb-storage: waiting for device to settle before scanning
[28370.750490] usbcore: registered new interface driver usbserial
[28370.750563] USB Serial support registered for generic
[28370.750687] usbcore: registered new interface driver usbserial_generic
[28370.750689] usbserial: USB Serial Driver core
[28370.806183] USB Serial support registered for GSM modem (1-port)
[28370.806410] option 2-1.1.4.2:1.0: GSM modem (1-port) converter detected
[28370.806599] usb 2-1.1.4.2: GSM modem (1-port) converter now attached to ttyUSB0
[28370.806673] option 2-1.1.4.2:1.3: GSM modem (1-port) converter detected
[28370.807393] usb 2-1.1.4.2: GSM modem (1-port) converter now attached to ttyUSB1
[28370.807424] option 2-1.1.4.2:1.4: GSM modem (1-port) converter detected
[28370.807539] usb 2-1.1.4.2: GSM modem (1-port) converter now attached to ttyUSB2
[28370.807591] usbcore: registered new interface driver option
[28370.807596] option: v0.7.2:USB Driver for GSM modems
public static final String ACTION_SHUTDOWN
Since:
API Level 4 Broadcast Action:
Device is shutting down. This is broadcast when the device is being shut down
(completely turned off, not sleeping). Once the broadcast is complete, the final
shutdown will proceed and all unsaved data lost.
Apps will not normally need to handle this, since the foreground activity will
be paused as well. This is a protected intent that can only be sent by the system.
Constant Value: "android.intent.action.ACTION_SHUTDOWN"
This would appear to be it?
I just Googled your command and it was on the Standard Broadcast Actions list. :
Android ststem recovery < 2e >follow instruction,reboot system。
sp = _TEXT_BASE - #CONFIG_SYS_MALLOC_LEN - #CONFIG_SYS_GBL_DATA_SIZE - 12
__bss_start -- __bss_end 的區域都填 0
/* Actual Virtual Size Attributes Function */
/* Base Base MB cached? buffered? access permissions */
/* xxx00000 xxx00000 */
X_ARM_MMU_SECTION(0x000, 0x200, 0x1,
ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* ROM */
X_ARM_MMU_SECTION(0x1FF, 0x1FF, 0x001,
ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* IRAM */
X_ARM_MMU_SECTION(0x300, 0x300, 0x100,
ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* GPU */
X_ARM_MMU_SECTION(0x400, 0x400, 0x200,
ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* IPUv3D */
X_ARM_MMU_SECTION(0x600, 0x600, 0x300,
ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* periperals */
X_ARM_MMU_SECTION(0x900, 0x000, 0x1FF,
ARM_CACHEABLE, ARM_BUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* SDRAM */
X_ARM_MMU_SECTION(0x900, 0x900, 0x200,
ARM_CACHEABLE, ARM_BUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* SDRAM */
X_ARM_MMU_SECTION(0x900, 0xE00, 0x200,
ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* SDRAM 0:128M*/
X_ARM_MMU_SECTION(0xB80, 0xB80, 0x10,
ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* CS1 EIM control*/
X_ARM_MMU_SECTION(0xCC0, 0xCC0, 0x040,
ARM_UNCACHEABLE, ARM_UNBUFFERABLE,
ARM_ACCESS_PERM_RW_RW); /* CS4/5/NAND Flash buffer */
#define X_ARM_MMU_SECTION(abase, vbase, size, cache, buff, access) \
{ \
int i; int j = abase; int k = vbase; \
for (i = size; i > 0 ; i--, j++, k++) \
ARM_MMU_SECTION(ttb_base, j, k, cache, buff, access); \
}
union ARM_MMU_FIRST_LEVEL_DESCRIPTOR {
unsigned long word;
struct ARM_MMU_FIRST_LEVEL_FAULT fault;
struct ARM_MMU_FIRST_LEVEL_PAGE_TABLE page_table;
struct ARM_MMU_FIRST_LEVEL_SECTION section;
struct ARM_MMU_FIRST_LEVEL_RESERVED reserved;
};
是 UNION. for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
if ((*init_fnc_ptr)() != 0) {
hang ();
}
}
init_fnc_t *init_sequence[] = {
#if defined(CONFIG_ARCH_CPU_INIT)
arch_cpu_init, /* basic arch cpu dependent setup */
#endif
board_init, /* basic board dependent setup */
#if defined(CONFIG_USE_IRQ)
interrupt_init, /* set up exceptions */
#endif
timer_init, /* initialize timer */
env_init, /* initialize environment */
init_baudrate, /* initialze baudrate settings */
serial_init, /* serial communications setup */
console_init_f, /* stage 1 init of console */
display_banner, /* say that we are here */
#if defined(CONFIG_DISPLAY_CPUINFO)
print_cpuinfo, /* display cpu info (and speed) */
#endif
#if defined(CONFIG_DISPLAY_BOARDINFO)
checkboard, /* display board info */
#endif
#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
init_func_i2c,
#endif
dram_init, /* configure available RAM banks */
#if defined(CONFIG_CMD_PCI) || defined (CONFIG_PCI)
arm_pci_init,
#endif
display_dram_config,
NULL,
};
之後就是一個一個個別 hardware function 的 init... (?為什摩不在 init_sequence[] 裡作?)
void setup_recovery_env(void)
{
char *env, *boot_args, *boot_cmd;
int bootdev = get_boot_device();
boot_cmd = supported_reco_envs[bootdev].cmd;
boot_args = supported_reco_envs[bootdev].args;
if (boot_cmd == NULL) {
printf("Unsupported bootup device for recovery\n");
return;
}
printf("setup env for recovery..\n");
env = getenv("bootargs_android_recovery");
/* Set env to recovery mode */
/* Only set recovery env when these env not exist, give user a
* chance to change their recovery env */
if (!env)
setenv("bootargs_android_recovery", boot_args);
env = getenv("bootcmd_android_recovery");
if (!env)
setenv("bootcmd_android_recovery", boot_cmd);
setenv("bootcmd", "run bootcmd_android_recovery");
}
Enable=SourceL
service bluetooth restart
之後就可以用 blueman (Debian 需要aptitude額外安裝),Bluetooth Manager的 device 作 search,Device : Capture : 手機名稱(PulseAudio Mixer)
pactl list | grep Name:
可以看到兩個 entry:
Name: bluez_source.5C_B5_24_XX_XX_XX
Name: bluez_card.5C_B5_24_XX_XX_XX
這個就是手機連線後,新增加的 sound card 裝置。 Name: alsa_output.pci-0000_02_00.1.hdmi-stereo
Name: alsa_output.pci-0000_00_1b.0.analog-stereo
Name: alsa_output.pci-0000_02_00.1.hdmi-stereo.monitor
Name: alsa_output.pci-0000_00_1b.0.analog-stereo.monitor
Name: alsa_input.pci-0000_00_1b.0.analog-stereo
Name: bluez_source.5C_B5_24_XX_XX_XX
Name: alsa_card.pci-0000_02_00.1
Name: alsa_card.pci-0000_00_1b.0
Name: bluez_card.5C_B5_24_XX_XX_XX
所以 load loopback module 的 command 是:
pactl load-module module-loopback source=bluez_source.5C_B5_24_XX_XX_XX sink=alsa_output.pci-0000_00_1b.0.analog-stereo
pactl unload-module 20
先用 hcitool scan 掃一下 附近 device 的 Address
用 l2ping XX:XX:XX:XX:XX:XX
就像網路的 ping 一樣,會回報回應時間。
Usage:
l2test [options] [bdaddr]
Modes:
-r listen and receive
-w listen and send
-d listen and dump incoming data
-x listen, then send, then dump incoming data
-t listen, then send and receive at the same time
-q connect, then send and receive at the same time
-s connect and send
-u connect and receive
-n connect and be silent
-y connect, then send, then dump incoming data
-c connect, disconnect, connect, ...
-m multiple connects
-p trigger dedicated bonding
-z information request
Options:
[-b bytes] [-i device] [-P psm]
[-I imtu] [-O omtu]
[-L seconds] enable SO_LINGER
[-W seconds] enable deferred setup
[-B filename] use data packets from file
[-N num] send num frames (default = infinite)
[-C num] send num frames before delay (default = 1)
[-D milliseconds] delay after sending num frames (default = 0)
[-X mode] select retransmission/flow-control mode
[-F fcs] use CRC16 check (default = 1)
[-Q num] Max Transmit value (default = 3)
[-Z size] Transmission Window size (default = 63)
[-R] reliable mode
[-G] use connectionless channel (datagram)
[-U] use sock stream
[-A] request authentication
[-E] request encryption
[-S] secure connection
[-M] become master
[-T] enable timestamps
實際使用:
l2test -I 2000 -r
l2test -O 2000 -s XX:XX:XX:XX:XX:XX
00:19:0E:A0:2F:44 2be
用 nb 連 A2DP 的 Sink,播放聲音給他。pcm.bluetooth {
type bluetooth
device 00:19:0E:A0:2F:44
}
pcm.!default {
type plug
slave.pcm "bluetooth"
}
那個 device 的 MAC 就是 A2DP speaker 的 MAC。