X-Git-Url: https://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=discover%2Fdevice-handler.c;h=0783181147edab9f0f8c6b7de9fa2ea35c516cb8;hp=28889144c8f0285c3f90b0e5dd4dc4650c6f0a6f;hb=f1dad9c1eb7cdc583a56734e9d46a1ce5bb755d5;hpb=784163c0779638e8d47bf68a65f4382f8e26ce3f diff --git a/discover/device-handler.c b/discover/device-handler.c index 2888914..0783181 100644 --- a/discover/device-handler.c +++ b/discover/device-handler.c @@ -201,11 +201,18 @@ static int mount_device(struct discover_context *ctx) argv[4] = "ro"; argv[5] = NULL; - if (pb_run_cmd(argv, 1)) - argv[3] = NULL; /* try without ro */ + if (pb_run_cmd(argv, 1)) { - if (pb_run_cmd(argv, 1)) - goto out_rmdir; + /* Retry mount without ro option. */ + + argv[0] = MOUNT_BIN; + argv[1] = ctx->device_path; + argv[2] = ctx->mount_path; + argv[3] = NULL; + + if (pb_run_cmd(argv, 1)) + goto out_rmdir; + } setup_device_links(ctx); return 0;