1

I try to start Android on device via NFS and TFTP. Everything goes good until Android system starts booting. Something happens with network parameters and connection falls and boot freezes

[   60.881134] nfs: server 128.247.77.158 not responding, still trying 

I've decided to try add parameter to mount command such as bg, intr and hard. Is it possible to configure this parameters before system boot? Or should I modify flags in kernel code (somewhere here)?

  • Does your Android device know how to get to 128.247.77.158? – roaima Jun 14 '16 at 16:27
  • @roaima, yes it does. First of all my device downloads u-boot via TFTP from host. Then mounts rootfs and starts to boot Android. Host has the same address 128.247.77.158 all the time. Wired that there is only one log about connection loose. System do nothing after that. – Dropper Jun 15 '16 at 7:08
0

I have found the solution of my problem. When Android starts it makes flush of all rules. The code that does this work I found in file system/netd/RouteController.cpp function int flushRules(). When I have blocked execution of code of this function I haven't seen message about NFS connection loose anymore.

// Returns 0 on success or negative errno on failure.
WARN_UNUSED_RESULT int flushRules() {
    return 0;//TODO workaround of NFS parameters reset 

    for (size_t i = 0; i < ARRAY_SIZE(IP_VERSIONS); ++i) {
        const char* argv[] = {
            IP_PATH,
            IP_VERSIONS[i],
            "rule",
            "flush",
        };
        if (android_fork_execvp(ARRAY_SIZE(argv), const_cast<char**>(argv), NULL, false, false)) {
            ALOGE("failed to flush rules");
            return -EREMOTEIO;
        }
    }
    return 0;
} 

And now Android system boots with NFS as expected.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.