X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=discover%2Fdevice-handler.c;h=6e03ef3fa159136b6015983a0054411cb7f126c8;hp=c72390b438d7222540b467619d6f2865117eb503;hb=52b9db95764fcdee9195113d7df225634a19c9f4;hpb=fbb2f7a20e5ac7b6d9f578fdb3538fad4310c472 diff --git a/discover/device-handler.c b/discover/device-handler.c index c72390b..6e03ef3 100644 --- a/discover/device-handler.c +++ b/discover/device-handler.c @@ -201,8 +201,18 @@ static int mount_device(struct discover_context *ctx) argv[4] = "ro"; argv[5] = NULL; - if (pb_run_cmd(argv)) - goto out_rmdir; + if (pb_run_cmd(argv, 1, 0)) { + + /* 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, 0)) + goto out_rmdir; + } setup_device_links(ctx); return 0; @@ -284,11 +294,7 @@ static int handle_add_udev_event(struct device_handler *handler, ctx->id = talloc_strdup(ctx, event->device); devname = event_get_param(ctx->event, "DEVNAME"); - if (!devname) { - pb_log("no devname for %s?\n", event->device); - return 0; - } - + assert(devname); ctx->device_path = talloc_strdup(ctx, devname); rc = mount_device(ctx);