Bug 12911 - usb_modeswitch installation race condition
Summary: usb_modeswitch installation race condition
Status: RESOLVED FIXED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: 2020.02.2
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-16 16:40 UTC by Joonas Harjumäki
Modified: 2020-09-04 14:59 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joonas Harjumäki 2020-05-16 16:40:10 UTC
In usb_modeswitch Makefile dispatcher-script, dispatcher-dynlink and dispatcher-statlink are .PHONY targets. The result is that sources are compiled also when install targets are called. USB_MODESWITCH_INSTALL_TARGET_CMDS calls $(MAKE) which is a call to parallel make eg. make -j9. So the install phase can install empty usb_modeswitch binary (happened once) if the compiler have just cleared the binary and install command installs it before compiler writes the binary. USB_MODESWITCH_INSTALL_TARGET_CMDS should call $(MAKE1).
Comment 1 Fabrice Fontaine 2020-05-17 09:06:27 UTC
Hi,

Thanks for your bug report and for pointing out a potential solution. You can find a patch fixing this issue here:
https://patchwork.ozlabs.org/project/buildroot/patch/20200517090528.1724124-1-fontaine.fabrice@gmail.com/

However, instead of disabling parallel install, I updated the install target to avoid rebuilding usb_modeswitch_dispatcher during the install step.

Can you confirm that this solution is also acceptable and fix your issue?

Best Regards,

Fabrice
Comment 2 Joonas Harjumäki 2020-05-18 04:25:16 UTC
Thanks, it works too!
Comment 3 Joonas Harjumäki 2020-06-01 10:21:33 UTC
Why the patched has not yet been merged to master?