OSDN Git Service

add persistent mode support
authorChih-Wei Huang <cwhuang@linux.org.tw>
Thu, 12 Aug 2010 06:18:01 +0000 (14:18 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Thu, 12 Aug 2010 06:18:01 +0000 (14:18 +0800)
In this mode, the first Linux partition is mounted as /data,
and the first fat partition is mounted as /mnt/sdcard.

AndroidBoard.mk
vm_info
vold.fstab [new file with mode: 0644]

index 05936ea..831624a 100644 (file)
@@ -4,4 +4,6 @@ TARGET_INITRD_SCRIPTS := $(LOCAL_PATH)/vm_info
 TARGET_PREBUILT_APPS := $(subst $(LOCAL_PATH)/,,$(wildcard $(LOCAL_PATH)/app/*))
 TARGET_KERNEL_CONFIG := $(LOCAL_PATH)/vm_defconfig
 
+PRODUCT_COPY_FILES += $(LOCAL_PATH)/vold.fstab:system/etc/vold.fstab
+
 include $(GENERIC_X86_ANDROID_MK)
diff --git a/vm_info b/vm_info
index 1886821..119c292 100644 (file)
--- a/vm_info
+++ b/vm_info
@@ -11,6 +11,9 @@ detect_hardware()
                        ;;
        esac
 
+       # try to find the first Linux partition
+       [ -z "$DATA" ] && DATA=`fdisk -l /dev/sd? | grep ^/dev | grep '83.*Linux' | head -1 | awk '{ print $1 }'`
+
        # return error to use auto-detect
        return 1
 }
diff --git a/vold.fstab b/vold.fstab
new file mode 100644 (file)
index 0000000..05067fc
--- /dev/null
@@ -0,0 +1 @@
+dev_mount sdcard /mnt/sdcard auto /devices/pci0000:00/0000:00:01.1/host0/target0:0:0/0:0:0:0/block/sda