kmodloader: load_modprobe: abort after 2 attempts
The loop in load_modprobe causes dmesg to be flooded with errors when a
module fails to load; e.g.:
- gpio-nct5104d: Unsupported device 0xffff (246 times on x86 in Qemu)
- jitterentropy: Initialization failed with host not compliant with
requirements: 2 (229 times on brcm2708/bcm2708)
On brcm2708/bcm2708 this also causes vmalloc allocation failures with
kernel 4.14 when running headless. If kmod-drm-vc4 and
kmod-video-bcm2835 are included in the image, they will be loaded before
brcmfmac, and brcmfmac will fail to load:
kmodloader: vmalloc: allocation failure: 249856 bytes,
mode:0x14000c0(GFP_KERNEL), nodemask=(null)
Break the loop after 2 failed attempts to fix these issues.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>