discover: kexec harder
authorJeremy Kerr <jk@ozlabs.org>
Wed, 1 May 2013 08:53:20 +0000 (16:53 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Mon, 6 May 2013 01:02:12 +0000 (09:02 +0800)
`kexec -e` will just call shutdown, which we've already tried, so it's
likely to fail. Add a further fallback to force a kexec with -e -f
options.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
discover/boot.c

index d054d5d51c24733203fbc0706e0b06c527c8a06a..29aefa916a8e149b973c69baccbb52b6a6bef799 100644 (file)
@@ -94,6 +94,21 @@ static int kexec_reboot(int dry_run)
        if (result)
                pb_log("%s: failed: (%d)\n", __func__, result);
 
        if (result)
                pb_log("%s: failed: (%d)\n", __func__, result);
 
+       /* okay, kexec -e -f */
+       if (result) {
+               p = argv;
+               *p++ = pb_system_apps.kexec;    /* 1 */
+               *p++ = "-e";                    /* 2 */
+               *p++ = "-f";                    /* 3 */
+               *p++ = NULL;                    /* 4 */
+
+               result = pb_run_cmd(argv, 1, 0);
+       }
+
+       if (result)
+               pb_log("%s: failed: (%d)\n", __func__, result);
+
+
        return result;
 }
 
        return result;
 }