diff options
-rw-r--r-- | Android.mk | 2 | ||||
-rwxr-xr-x | init.herring.rc | 14 | ||||
-rw-r--r-- | setup_fs.c | 12 |
3 files changed, 19 insertions, 9 deletions
@@ -20,7 +20,7 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := setup_fs.c LOCAL_MODULE := setup_fs LOCAL_MODULE_TAGS := optional -#LOCAL_SHARED_LIBRARIES += libext4_utils libz +LOCAL_SHARED_LIBRARIES += libcutils include $(BUILD_EXECUTABLE) endif diff --git a/init.herring.rc b/init.herring.rc index a6a83a5..78c433e 100755 --- a/init.herring.rc +++ b/init.herring.rc @@ -6,16 +6,15 @@ on boot setprop ro.radio.noril yes setprop ro.bt.bdaddr_path "/efs/bluetooth/bt_addr" + setprop ro.crypto.keyfile.userdata /efs/userdata_footer + setprop ro.crypto.internal_sd_partition "true" + # fake some battery state setprop status.battery.state Slow setprop status.battery.level 5 setprop status.battery.level_raw 50 setprop status.battery.level_scale 9 -# wi-fi - mkdir /data/misc/wifi/sockets 0770 wifi wifi - mkdir /data/misc/dhcp 0770 dhcp dhcp - # phone setprop ro.telephony.call_ring.multiple 0 @@ -62,6 +61,13 @@ on fs # Permissions for System Server and daemons. chown system system /sys/class/backlight/s5p_bl/brightness +on post-fs-data +# wi-fi + mkdir /data/misc/wifi/sockets 0770 wifi wifi + mkdir /data/misc/dhcp 0770 dhcp dhcp + + setprop vold.post_fs_data_done 1 + service gpsd /system/vendor/bin/gpsd -c /vendor/etc/gps.xml class main socket gps seqpacket 0660 gps system @@ -4,6 +4,8 @@ #include <unistd.h> #include <sys/reboot.h> #include <sys/wait.h> +#include <cutils/android_reboot.h> +#include <cutils/partition_utils.h> const char *mkfs = "/system/bin/make_ext4fs"; @@ -33,6 +35,11 @@ int setup_fs(const char *blockdev) } sprintf(buf,"/dev/block/%s", blockdev); + if (!partition_wiped(buf)) { + fprintf(stderr,"device %s not wiped, probably encrypted, not wiping\n", blockdev); + return 0; + } + fprintf(stderr,"+++\n"); child = fork(); @@ -64,11 +71,8 @@ int main(int argc, char **argv) } if (need_reboot) { - sync(); - sync(); - sync(); fprintf(stderr,"REBOOT!\n"); - reboot(RB_AUTOBOOT); + android_reboot(ANDROID_RB_RESTART, 0, 0); exit(-1); } return 0; |