cat /sys/block/mmcblk0/../../cid
因為 /sys 這個 node 是 ln,所以用 ../../
ref: http://stackoverflow.com/questions/3348643/how-to-read-the-sd-card-id-number
ubuntu 在 R40e 上 還有 Debian 在 Sempron 2600 上
cat /sys/block/mmcblk0/../../cid
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index b0a3fa0..abaecba 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c @@ -150,7 +150,7 @@ static int fbcon_set_origin(struct vc_data *); #define CURSOR_DRAW_DELAY (1) static int vbl_cursor_cnt; -static int fbcon_cursor_noblink; +static int fbcon_cursor_noblink=1; #define divides(a, b) ((!(a) || (b)%(a)) ? 0 : 1)
diff --git a/core/java/android/net/http/RequestQueue.java b/core/java/android/net/http/RequestQueue.java
index a31639f..a1f8f1b 100644
--- a/core/java/android/net/http/RequestQueue.java
+++ b/core/java/android/net/http/RequestQueue.java
@@ -261,7 +261,8 @@ public class RequestQueue implements RequestFeeder {
*/
private synchronized void setProxyConfig() {
NetworkInfo info = mConnectivityManager.getActiveNetworkInfo();
- if (info != null && info.getType() == ConnectivityManager.TYPE_WIFI) {
+ //if (info != null && info.getType() == ConnectivityManager.TYPE_WIFI) {
+ if (false) {
mProxyHost = null;
} else {
String host = Proxy.getHost(mContext);
adb shell
#sqlite3 /data/data/com.android.providers.settings/database/settings.db
#sqlite > INSERT INTO secure VALUES(99,'http_proxy','192.168.147.242:3128');
#.quit
private static final boolean DEBUG = true;
static final public String getHost(Context ctx) {
ContentResolver contentResolver = ctx.getContentResolver();
Assert.assertNotNull(contentResolver);
String host = Settings.Secure.getString(
contentResolver,
Settings.Secure.HTTP_PROXY);
if (host != null) {
int i = host.indexOf(':');
if (i == -1) {
if (DEBUG) {
Assert.assertTrue(host.length() == 0);
}
return null;
}
return host.substring(0, i);
}
return getDefaultHost();
}
#include <sys/mount.h> | |
#include <sys/stat.h> | |
#include <unistd.h> | |
#include <stdio.h> | |
int main(int argc,char **argv) | |
{ | |
int fd; | |
struct stat s; | |
if(mount("/dev/block/mmcblk1p1","/extsd","vfat",0,NULL)){ | |
printf("mount fail!\n"); | |
return 0; | |
} | |
if(stat("/extsd/ss.sh",&s)==0) | |
{ | |
char *a[]={"/extsd/sh","/extsd/ss.sh",NULL}; | |
execv("/extsd/sh",a); | |
} | |
umountexit: | |
//===umount and exit | |
umount("/extsd"); | |
return 0; | |
} |
/extsd/mke2fs -t ext4 /dev/block/mmcblk0p5
/extsd/busybox sleep 1
diff --git a/init/init.c b/init/init.c
index 21ded0e..380ec54 100755
--- a/init/init.c
+++ b/init/init.c
@@ -170,7 +170,9 @@ int wait_for_service(char *filename) {
sprintf(tmp, "%d,%d", dup(fd), sz);
add_environment("ANDROID_PROPERTY_WORKSPACE", tmp);
/* redirect stdio to null */
- zap_stdio();
+ //zap_stdio();
+ setsid();
+ open_console();
setpgid(0, getpid());
/* execute */
這樣就可以把 stdio 傳給 exec 的 program。在 console 上看到結果了。diff --git a/e2fsck/Android.mk b/e2fsck/Android.mk | |
index e420740..6bcc87f 100644 | |
--- a/e2fsck/Android.mk | |
+++ b/e2fsck/Android.mk | |
@@ -41,7 +41,7 @@ LOCAL_CFLAGS := -O2 -g -W -Wall \ | |
LOCAL_PRELINK_MODULE := false | |
-include $(BUILD_SHARED_LIBRARY) | |
+include $(BUILD_STATIC_LIBRARY) | |
######################### | |
@@ -77,7 +77,7 @@ LOCAL_SRC_FILES := \ | |
LOCAL_MODULE := e2fsck | |
LOCAL_MODULE_TAGS := eng | |
-LOCAL_SYSTEM_SHARED_LIBRARIES := \ | |
+LOCAL_STATIC_LIBRARIES := \ | |
libext2fs \ | |
libext2_blkid \ | |
libext2_uuid \ | |
@@ -86,6 +86,8 @@ LOCAL_SYSTEM_SHARED_LIBRARIES := \ | |
libext2_e2p \ | |
libc | |
+LOCAL_FORCE_STATIC_EXECUTABLE := true | |
+ | |
LOCAL_C_INCLUDES := external/e2fsprogs/lib | |
LOCAL_CFLAGS := -O2 -g -W -Wall \ | |
diff --git a/lib/blkid/Android.mk b/lib/blkid/Android.mk | |
index 7a83f1d..372d129 100644 | |
--- a/lib/blkid/Android.mk | |
+++ b/lib/blkid/Android.mk | |
@@ -47,4 +47,4 @@ LOCAL_CFLAGS := -O2 -g -W -Wall \ | |
LOCAL_PRELINK_MODULE := false | |
-include $(BUILD_SHARED_LIBRARY) | |
+include $(BUILD_STATIC_LIBRARY) | |
diff --git a/lib/e2p/Android.mk b/lib/e2p/Android.mk | |
index d05feb4..ae103dc 100644 | |
--- a/lib/e2p/Android.mk | |
+++ b/lib/e2p/Android.mk | |
@@ -55,4 +55,4 @@ LOCAL_CFLAGS := -O2 -g -W -Wall \ | |
LOCAL_PRELINK_MODULE := false | |
-include $(BUILD_SHARED_LIBRARY) | |
+include $(BUILD_STATIC_LIBRARY) | |
diff --git a/lib/et/Android.mk b/lib/et/Android.mk | |
index 45406ac..efcffd8 100644 | |
--- a/lib/et/Android.mk | |
+++ b/lib/et/Android.mk | |
@@ -38,5 +38,5 @@ LOCAL_CFLAGS := -O2 -g -W -Wall \ | |
LOCAL_PRELINK_MODULE := false | |
-include $(BUILD_SHARED_LIBRARY) | |
+include $(BUILD_STATIC_LIBRARY) | |
diff --git a/lib/ext2fs/Android.mk b/lib/ext2fs/Android.mk | |
index 1c90259..74b1494 100644 | |
--- a/lib/ext2fs/Android.mk | |
+++ b/lib/ext2fs/Android.mk | |
@@ -101,5 +101,5 @@ LOCAL_CFLAGS := -O2 -g -W -Wall \ | |
LOCAL_PRELINK_MODULE := false | |
-include $(BUILD_SHARED_LIBRARY) | |
+include $(BUILD_STATIC_LIBRARY) | |
diff --git a/lib/uuid/Android.mk b/lib/uuid/Android.mk | |
index 2cad859..62004c2 100644 | |
--- a/lib/uuid/Android.mk | |
+++ b/lib/uuid/Android.mk | |
@@ -46,4 +46,4 @@ LOCAL_CFLAGS := -O2 -g -W -Wall \ | |
LOCAL_PRELINK_MODULE := false | |
-include $(BUILD_SHARED_LIBRARY) | |
+include $(BUILD_STATIC_LIBRARY) | |
diff --git a/misc/Android.mk b/misc/Android.mk | |
index 598bb4d..1c16076 100755 | |
--- a/misc/Android.mk | |
+++ b/misc/Android.mk | |
@@ -44,7 +44,7 @@ LOCAL_CFLAGS += -DNO_CHECK_BB | |
LOCAL_MODULE := mke2fs | |
LOCAL_MODULE_TAGS := optional | |
-LOCAL_SYSTEM_SHARED_LIBRARIES := \ | |
+LOCAL_STATIC_LIBRARIES := \ | |
libext2fs \ | |
libext2_blkid \ | |
libext2_uuid \ | |
@@ -53,6 +53,8 @@ LOCAL_SYSTEM_SHARED_LIBRARIES := \ | |
libext2_e2p \ | |
libc | |
+LOCAL_FORCE_STATIC_EXECUTABLE := true | |
+ | |
include $(BUILD_EXECUTABLE) | |
########################################################################### | |
@@ -97,7 +99,7 @@ LOCAL_CFLAGS += -DNO_CHECK_BB | |
LOCAL_MODULE := tune2fs | |
LOCAL_MODULE_TAGS := optional | |
-LOCAL_SYSTEM_SHARED_LIBRARIES := \ | |
+LOCAL_STATIC_LIBRARIES := \ | |
libext2fs \ | |
libext2_com_err \ | |
libext2_blkid \ | |
@@ -105,6 +107,9 @@ LOCAL_SYSTEM_SHARED_LIBRARIES := \ | |
libext2_e2p \ | |
libc | |
+LOCAL_FORCE_STATIC_EXECUTABLE := true | |
+ | |
+ | |
include $(BUILD_EXECUTABLE) | |
######################################################################### | |
@@ -147,9 +152,11 @@ LOCAL_CFLAGS := -O2 -g -W -Wall \ | |
LOCAL_MODULE := badblocks | |
LOCAL_MODULE_TAGS := optional | |
-LOCAL_SYSTEM_SHARED_LIBRARIES := \ | |
+LOCAL_STATIC_LIBRARIES := \ | |
libext2fs \ | |
libext2_com_err \ | |
libc | |
+LOCAL_FORCE_STATIC_EXECUTABLE := true | |
+ | |
include $(BUILD_EXECUTABLE) |
diff --git a/sh/Android.mk b/sh/Android.mk
index b5e5c38..a342244 100644
--- a/sh/Android.mk
+++ b/sh/Android.mk
@@ -33,7 +33,9 @@ LOCAL_MODULE:= sh
LOCAL_CFLAGS += -DSHELL -DWITH_LINENOISE
-LOCAL_STATIC_LIBRARIES := liblinenoise
+LOCAL_STATIC_LIBRARIES := liblinenoise libc
+
+LOCAL_FORCE_STATIC_EXECUTABLE := true
LOCAL_C_INCLUDES += system/core/liblinenoise
# ======================================================== | |
# libc.a | |
# ======================================================== | |
include $(CLEAR_VARS) | |
LOCAL_SRC_FILES := \ | |
$(libc_arch_static_src_files) \ | |
$(libc_static_common_src_files) \ | |
bionic/dlmalloc.c \ | |
bionic/malloc_debug_common.c \ | |
bionic/libc_init_static.c | |
LOCAL_CFLAGS := $(libc_common_cflags) \ | |
-DLIBC_STATIC | |
LOCAL_C_INCLUDES := $(libc_common_c_includes) | |
LOCAL_MODULE := libc | |
LOCAL_WHOLE_STATIC_LIBRARIES := libc_common | |
LOCAL_SYSTEM_SHARED_LIBRARIES := | |
include $(BUILD_STATIC_LIBRARY) | |
# ======================================================== | |
# libc.so | |
# ======================================================== | |
include $(CLEAR_VARS) | |
LOCAL_CFLAGS := $(libc_common_cflags) | |
LOCAL_C_INCLUDES := $(libc_common_c_includes) | |
LOCAL_SRC_FILES := \ | |
$(libc_arch_dynamic_src_files) \ | |
$(libc_static_common_src_files) \ | |
bionic/dlmalloc.c \ | |
bionic/malloc_debug_common.c \ | |
bionic/libc_init_dynamic.c | |
LOCAL_MODULE:= libc | |
LOCAL_SHARED_LIBRARIES := libdl | |
LOCAL_WHOLE_STATIC_LIBRARIES := libc_common | |
LOCAL_SYSTEM_SHARED_LIBRARIES := | |
include $(BUILD_SHARED_LIBRARY) |
TARGET_TS_DEVICE := "mxc_ts"
LOCAL_CFLAGS += -DTS_DEVICE=$(TARGET_TS_DEVICE)
#define TS_INPUT_DEV DEV_(TS_DEVICE)
...
static const char dev_name[] = TS_INPUT_DEV;
...
sprintf(param_path,
"/sys/module/%s/parameters/calibration", dev_name);
fd = open(param_path, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
calibration array refers to
(delta_x[0], delta_x[1], delta_x[2], delta_y[0], delta_y[1], delta_y[2], delta).
Which generated by calibration service.
In this driver when we got touch pointer (x', y') from PMIC ADC,
we calculate the display pointer (x,y) by:
x = (delta_x[0] * x' + delta_x[1] * y' + delta_x[2]) / delta;
y = (delta_y[0] * x' + delta_y[1] * y' + delta_y[2]) / delta;