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

Reply via email to