[Nexus 5 Original Android Development] UnknownzD:
blu_spark, I have got a problem over your kernel for the Android M official release.

Basically I have done the dirty-flashing with the system.img as I don't want to fix the integrity check with the modified /system partition.

But what I have found is that your kernel did not properly filled in all the options required for the vold service.

According to the AOSP source for Android 6.0 r1 release, the main.cpp of the vold system will check the neccessary parameter as shown below (https://android.googlesource.com/platform/system/vold/+/android-6.0.0_r1/main.cpp).

static void parse_args(int argc, char** argv) {
static struct option opts[] = {
{"blkid_context", required_argument, 0, 'b' },
{"blkid_untrusted_context", required_argument, 0, 'B' },
{"fsck_context", required_argument, 0, 'f' },
{"fsck_untrusted_context", required_argument, 0, 'F' },
};
int c;
while ((c = getopt_long(argc, argv, "", opts, nullptr)) != -1) {
switch (c) {
case 'b': android::vold::sBlkidContext = optarg; break;
case 'B': android::vold::sBlkidUntrustedContext = optarg; break;
case 'f': android::vold::sFsckContext = optarg; break;
case 'F': android::vold::sFsckUntrustedContext = optarg; break;
}
}
CHECK(android::vold::sBlkidContext != nullptr);
CHECK(android::vold::sBlkidUntrustedContext != nullptr);
CHECK(android::vold::sFsckContext != nullptr);
CHECK(android::vold::sFsckUntrustedContext != nullptr);
}

However, the init.rc from your kernel did not provide any parameters to the vold at all, which looks like this.

service vold /system/bin/vold
class core
socket vold stream 0660 root mount
ioprio be 2

So when I have booted up the device, I have got a message in the logcat like this.

10-06 08:52:35.023 3844 3844 I vold : Vold 3.0 (the awakening) firing up
10-06 08:52:35.024 3844 3844 V vold : Detected support for: ext4 f2fs vfat
10-06 08:52:35.024 3844 3844 F vold : system/vold/main.cpp:161] Check failed: android::vold::sBlkidContext != nullptr
10-06 08:52:35.024 3844 3844 F libc : Fatal signal 6 (SIGABRT), code -6 in tid 3844 (vold)
10-06 08:52:35.127 206 206 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
10-06 08:52:35.127 206 206 F DEBUG : Build fingerprint: 'google/hammerhead/hammerhead:6.0/MRA58K/2256973:user/release-keys'
10-06 08:52:35.127 206 206 F DEBUG : Revision: '11'
10-06 08:52:35.128 206 206 F DEBUG : ABI: 'arm'
10-06 08:52:35.128 206 206 F DEBUG : pid: 3844, tid: 3844, name: vold >>> /system/bin/vold <<<
10-06 08:52:35.129 206 206 F DEBUG : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
10-06 08:52:35.151 206 206 F DEBUG : Abort message: 'system/vold/main.cpp:161] Check failed: android::vold::sBlkidContext != nullptr '
10-06 08:52:35.152 206 206 F DEBUG : r0 00000000 r1 00000f04 r2 00000006 r3 b6f45b7c
10-06 08:52:35.152 206 206 F DEBUG : r4 b6f45b84 r5 b6f45b34 r6 00000002 r7 0000010c
10-06 08:52:35.152 206 206 F DEBUG : r8 00000000 r9 b6f9e18c sl b6f9e190 fp bea4da84
10-06 08:52:35.152 206 206 F DEBUG : ip 00000006 sp bea4d968 lr b6cb2ae9 pc b6cb3b80 cpsr 40070010
10-06 08:52:35.159 206 206 F DEBUG :
10-06 08:52:35.159 206 206 F DEBUG : backtrace:
10-06 08:52:35.160 206 206 F DEBUG : #00 pc 00040b80 /system/lib/libc.so (tgkill+12)
10-06 08:52:35.160 206 206 F DEBUG : #01 pc 0003fae5 /system/lib/libc.so (pthread_kill+32)
10-06 08:52:35.160 206 206 F DEBUG : #02 pc 0001c30f /system/lib/libc.so (raise+10)
10-06 08:52:35.160 206 206 F DEBUG : #03 pc 000194c1 /system/lib/libc.so (__libc_android_abort+34)
10-06 08:52:35.160 206 206 F DEBUG : #04 pc 000174ac /system/lib/libc.so (abort+4)
10-06 08:52:35.160 206 206 F DEBUG : #05 pc 00004fb1 /system/lib/libbase.so (android::base::LogMessage::~LogMessage()+428)
10-06 08:52:35.160 206 206 F DEBUG : #06 pc 0000783d /system/bin/vold (main+1904)
10-06 08:52:35.160 206 206 F DEBUG : #07 pc 00017359 /system/lib/libc.so (__libc_init+44)
10-06 08:52:35.160 206 206 F DEBUG : #08 pc 00006ff4 /system/bin/vold
10-06 08:52:35.199 206 206 F DEBUG :
10-06 08:52:35.199 206 206 F DEBUG : Tombstone written to: /data/tombstones/tombstone_03

So would you mind to fix this please? I have cherry-picked a fix from other kernel source and rebuilt the kernel image, and the problem is immediately gone, but I have no idea whether those uids are right or not at this moment.

Cherry picked from https://github.com/zhuowei/unnamedL/blob/master/boot-overlay/init.rc

service vold /system/bin/vold --blkid_context=u:r:blkid:s0 --blkid_untrusted_context=u:r:blkid_untrusted:s0 --fsck_context=u:r:fsck:s0 --fsck_untrusted_context=u:r:fsck_untrusted:s0
class core
socket vold stream 0660 root mount
ioprio be 2

Anyway, those arguments seems to be necessary for android M release, so could you help us to fix the problem by modifying the init.rc file please?