mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-28 23:43:42 +02:00
Provide some hints for the user in case /dev/mem mmap fails
Resolves #121 Corresponding to flashrom svn r385 and coreboot v2 svn r3889. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
This commit is contained in:
parent
37179b807c
commit
72c9668b95
@ -139,6 +139,13 @@ struct flashchip *probe_flash(struct flashchip *first_flash, int force)
|
|||||||
fd_mem, (off_t) base);
|
fd_mem, (off_t) base);
|
||||||
if (bios == MAP_FAILED) {
|
if (bios == MAP_FAILED) {
|
||||||
perror("Can't mmap memory using " MEM_DEV);
|
perror("Can't mmap memory using " MEM_DEV);
|
||||||
|
if (EINVAL == errno) {
|
||||||
|
fprintf(stderr, "In Linux this error can be caused by the CONFIG_NONPROMISC_DEVMEM (<2.6.27),\n");
|
||||||
|
fprintf(stderr, "CONFIG_STRICT_DEVMEM (>=2.6.27) and CONFIG_X86_PAT kernel options.\n");
|
||||||
|
fprintf(stderr, "Please check if either is enabled in your kernel before reporting a failure.\n");
|
||||||
|
fprintf(stderr, "You can override CONFIG_X86_PAT at boot with the nopat kernel parameter but\n");
|
||||||
|
fprintf(stderr, "disabling the other option unfortunately requires a kernel recompile. Sorry!\n");
|
||||||
|
}
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
flash->virtual_memory = bios;
|
flash->virtual_memory = bios;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user