mail archive of the rauc mailing list
 help / color / mirror / Atom feed
* [RAUC] open_slot_device() fails on slot type boot-mbr-switch
@ 2020-12-01 17:42 Martin Hollingsworth
  0 siblings, 0 replies; only message in thread
From: Martin Hollingsworth @ 2020-12-01 17:42 UTC (permalink / raw)
  To: rauc

Hello Community,
When updating a bootloader slot of type boot-mbr-switch the function g_open() in open_slot_device() from update_handler.c fails:

>  90% Copying image to bootloader.0 failed.
> [...]
> LastError: Installation error: Failed updating slot bootloader.0: Opening output device /dev/mmcblk0 failed: Device or resource busy

In my opinion this is due to the O_EXCL flag in g_open(), because for type boot-mbr-switch the code tries to open the full device (/dev/mmcblk0) instead of an inactive partition (/dev/mmcblk0p1). I assume the device is busy because at leat the rootfs partition of the currently running system is mounted. For an associated system.conf see the documentation example 7.6.2.

I suggest that the O_EXCL flag should not be used on slot type boot-mbr-switch, because in this case it is legitimate to open a busy device for writing (compared to a "normal" slot update). Some testing confirms the functionality.

Is this a bug or am I missing something here? What is your opinion on this? If confirmed a bug I have a simple patch prepared.

Thanks and Regards,
Martin Hollingsworth

_______________________________________________
RAUC mailing list

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-12-01 17:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-01 17:42 [RAUC] open_slot_device() fails on slot type boot-mbr-switch Martin Hollingsworth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox