hwaccess_x86_io: Improve IO permission error messages

- Display the BSD hints only when compiled for a specific BSD
- On Linux check the user's uid to see if flashrom run with
  root privileges
- Add a note about the dmesg check if the flashrom run as
  root and have no IO privilege

TEST=Run flashrom with internal programmed on a
Secure boot enabled machine. You should not get the
privilege level error, but rather a suggestion about
the security policies.

Change-Id: I6a6f60a5f0ac8f2b51c74661f7dad30571819680
Signed-off-by: Miklós Márton <martonmiklosqdev@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/62878
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
1 file changed
tree: 437f01ac41535afebc1dcda8196d5791bee86823
  1. .github/
  2. bindings/
  3. doc/
  4. Documentation/
  5. include/
  6. Makefile.d/
  7. meson_cross/
  8. platform/
  9. scripts/
  10. subprojects/
  11. tests/
  12. util/
  13. .gitattributes
  14. .gitignore
  15. 82802ab.c
  16. amd_imc.c
  17. asm106x.c
  18. at45db.c
  19. atahpt.c
  20. atapromise.c
  21. atavia.c
  22. bitbang_spi.c
  23. board_enable.c
  24. buspirate_spi.c
  25. cbtable.c
  26. ch341a_spi.c
  27. ch347_spi.c
  28. chipset_enable.c
  29. cli_classic.c
  30. cli_common.c
  31. cli_getopt.c
  32. cli_output.c
  33. COPYING
  34. custom_baud.c
  35. custom_baud_darwin.c
  36. custom_baud_linux.c
  37. dediprog.c
  38. developerbox_spi.c
  39. digilent_spi.c
  40. dirtyjtag_spi.c
  41. dmi.c
  42. Doxyfile
  43. drkaiser.c
  44. dummyflasher.c
  45. edi.c
  46. en29lv640b.c
  47. erasure_layout.c
  48. flashchips.c
  49. flashrom.c
  50. fmap.c
  51. ft2232_spi.c
  52. gfxnvidia.c
  53. helpers.c
  54. helpers_fileio.c
  55. hwaccess_physmap.c
  56. hwaccess_x86_io.c
  57. hwaccess_x86_msr.c
  58. i2c_helper_linux.c
  59. ich_descriptors.c
  60. ichspi.c
  61. internal.c
  62. internal_par.c
  63. it8212.c
  64. it87spi.c
  65. jedec.c
  66. jlink_spi.c
  67. known_boards.c
  68. layout.c
  69. libflashrom.c
  70. libflashrom.map
  71. linux_mtd.c
  72. linux_spi.c
  73. MAINTAINERS
  74. Makefile
  75. Makefile.include
  76. mcp6x_spi.c
  77. mediatek_i2c_spi.c
  78. meson.build
  79. meson_options.txt
  80. mstarddc_spi.c
  81. ni845x_spi.c
  82. nic3com.c
  83. nicintel.c
  84. nicintel_eeprom.c
  85. nicintel_spi.c
  86. nicnatsemi.c
  87. nicrealtek.c
  88. ogp_spi.c
  89. opaque.c
  90. parade_lspcon.c
  91. parallel.c
  92. pcidev.c
  93. pickit2_spi.c
  94. pony_spi.c
  95. print.c
  96. print_wiki.c
  97. printlock.c
  98. processor_enable.c
  99. programmer.c
  100. programmer_table.c
  101. raiden_debug_spi.c
  102. rayer_spi.c
  103. README.rst
  104. realtek_mst_i2c_spi.c
  105. s25f.c
  106. satamv.c
  107. satasii.c
  108. sb600spi.c
  109. serial.c
  110. serprog.c
  111. sfdp.c
  112. spi.c
  113. spi25.c
  114. spi25_statusreg.c
  115. spi95.c
  116. sst28sf040.c
  117. sst49lfxxxc.c
  118. sst_fwhub.c
  119. stlinkv3_spi.c
  120. stm50.c
  121. superio.c
  122. test_build.sh
  123. udelay.c
  124. usb_device.c
  125. usbblaster_spi.c
  126. usbdev.c
  127. VERSION
  128. w29ee011.c
  129. w39.c
  130. wbsio_spi.c
  131. writeprotect.c
  132. writeprotect_ranges.c