自动挂载SD
由於新的filesystem源碼使用vold作為SD卡自動掛載程式,而舊的使用mountd程式來掛載。下面介紹如何使用mountd來掛載SD卡。
1.對system/core/rootdir/init.rc檔做如下修改。把vold程式遮罩,打開mountd
#service vold /system/bin/vold
# socket vold stream 0660 root mount
service mountd /system/bin/mountd
socket mountd stream 0660 root mount
2.在system/core/rootdir/Android.mk添加mountd.conf配置檔.
copy_from := \
etc/mountd.conf \
etc/dbus.conf \
etc/init.goldfish.sh \
etc/hosts
3. 打開mountd的編譯選項,對system\core\mountd\Android.mk檔做如下修改
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
AutoMount.c \
ProcessKiller.c \
Server.c \
mountd.c \
ASEC.c \
logwrapper.c
LOCAL_MODULE:= mountd
LOCAL_C_INCLUDES := $(KERNEL_HEADERS)
LOCAL_CFLAGS := -DCREATE_MOUNT_POINTS=0
LOCAL_SHARED_LIBRARIES := libcutils
include $(BUILD_EXECUTABLE)