kernel_config_fragment 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. # Changes to this file are automatically trigger kernel reconfigures
  2. # even without using the linux-reconfigure target.
  3. CONFIG_MODULE_SRCVERSION_ALL=y
  4. # GDB debugging.
  5. CONFIG_DEBUG_FS=y
  6. CONFIG_DEBUG_INFO=y
  7. CONFIG_DEBUG_KERNEL=y
  8. CONFIG_GDB_SCRIPTS=y
  9. # Allow kernel to understand -initrd
  10. CONFIG_BLK_DEV_INITRD=y
  11. # Non-static variables show up on /proc/kallsyms
  12. # https://stackoverflow.com/questions/20196636/does-kallsyms-have-all-the-symbol-of-kernel-functions/44614878#44614878
  13. CONFIG_KALLSYMS_ALL=y
  14. # zcat /proc/config.gz
  15. CONFIG_IKCONFIG=y
  16. CONFIG_IKCONFIG_PROC=y
  17. # TODO make example.
  18. # This seems to allow userspace to create arbitrary configuration trees,
  19. # which kernel modules can then read and interpret.
  20. CONFIG_CONFIGFS_FS=y
  21. # KGDB
  22. CONFIG_CONSOLE_POLL=y
  23. CONFIG_KDB_CONTINUE_CATASTROPHIC=0
  24. CONFIG_KDB_DEFAULT_ENABLE=0x1
  25. CONFIG_KDB_KEYBOARD=y
  26. CONFIG_KGDB=y
  27. CONFIG_KGDB_KDB=y
  28. CONFIG_KGDB_LOW_LEVEL_TRAP=y
  29. CONFIG_KGDB_SERIAL_CONSOLE=y
  30. CONFIG_KGDB_TESTS=y
  31. CONFIG_KGDB_TESTS_ON_BOOT=n
  32. CONFIG_MAGIC_SYSRQ=y
  33. CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x1
  34. CONFIG_SERIAL_KGDB_NMI=n
  35. # Module.symvers in kernel tree and modules tree contains CRC of signatures.
  36. # TODO: I think the CRC are stored in the built kernel and module, and checked
  37. # at insmod, but bgrep did not find it in kernel image.
  38. # Does not show in /proc/kallyms either.
  39. CONFIG_MODVERSIONS=y
  40. # ftrace
  41. CONFIG_DYNAMIC_FTRACE=y
  42. CONFIG_FTRACE=y
  43. CONFIG_FTRACE_SYSCALLS=y
  44. CONFIG_FUNCTION_GRAPH_TRACER=y
  45. CONFIG_FUNCTION_PROFILER=y
  46. CONFIG_FUNCTION_TRACER=y
  47. CONFIG_HWLAT_TRACER=y
  48. CONFIG_IRQSOFF_TRACER=y
  49. CONFIG_SCHED_TRACER=y
  50. CONFIG_STACK_TRACER=y
  51. CONFIG_TRACER_SNAPSHOT=y
  52. ## Networking
  53. # Will everything blow up?
  54. # https://superuser.com/questions/684005/how-does-one-permanently-disable-gnu-linux-networking/1255015#1255015
  55. #CONFIG_NET=n
  56. # If given, we can use QEMU 2.9.0 default x86 networking without any -net or -netdev options,
  57. # since E1000 is the default networking device as mentioned at:
  58. # https://en.wikibooks.org/w/index.php?title=QEMU/Networking&oldid=3268753
  59. CONFIG_E1000=y
  60. ## x86
  61. # https://stackoverflow.com/questions/20069620/print-kernels-page-table-entries
  62. # cat /sys/kernel/debug/kernel_page_tables
  63. CONFIG_X86_PTDUMP=y
  64. ## ARM
  65. # LEDs:
  66. #
  67. # cd /sys/class/leds/versatile:0
  68. # cat max_brightness
  69. # echo 255 >brightness
  70. #
  71. # https://raspberrypi.stackexchange.com/questions/697/how-do-i-control-the-system-leds-using-my-software
  72. #
  73. # Relevant QEMU files:
  74. #
  75. # - hw/arm/versatilepb.c
  76. # - hw/misc/arm_sysctl.c
  77. #
  78. # Relevant kernel files:
  79. #
  80. # - arch/arm/boot/dts/versatile-pb.dts
  81. # - drivers/leds/led-class.c
  82. # - drivers/leds/leds-sysctl.c
  83. #
  84. # Try hacking QEMU's `hw/misc/arm_sysctl.c` with a printf:
  85. #
  86. # static void arm_sysctl_write(void *opaque, hwaddr offset,
  87. # uint64_t val, unsigned size)
  88. # {
  89. # arm_sysctl_state *s = (arm_sysctl_state *)opaque;
  90. #
  91. # switch (offset) {
  92. # case 0x08: /* LED */
  93. # printf("LED val = %llx\n", (unsigned long long)val);
  94. #
  95. # to obeserve when the callback is made. But beware that one of the LEDs
  96. # has a heartbeat trigger by default (specified on dts), so it will produce a lot of output.
  97. CONFIG_LEDS_CLASS=y
  98. CONFIG_LEDS_CLASS_FLASH=y
  99. CONFIG_LEDS_SYSCON=y
  100. CONFIG_LEDS_TRIGGERS=y
  101. CONFIG_LEDS_TRIGGER_BACKLIGHT=y
  102. CONFIG_LEDS_TRIGGER_CPU=y
  103. CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
  104. CONFIG_LEDS_TRIGGER_GPIO=y
  105. CONFIG_LEDS_TRIGGER_HEARTBEAT=y
  106. CONFIG_LEDS_TRIGGER_ONESHOT=y
  107. CONFIG_LEDS_TRIGGER_TIMER=y
  108. CONFIG_NEW_LEDS=y
  109. # GPIO.
  110. CONFIG_ARM_AMBA=y
  111. CONFIG_GPIOLIB=y
  112. CONFIG_GPIO_SYSFS=y
  113. CONFIG_GPIO_PL061=y
  114. # In target:
  115. #
  116. # modprobe dummy-irq irq=34
  117. # insmod /platform_device.ko
  118. #
  119. # Outcome:
  120. #
  121. # lkmc_platform_device_write offset=0 value=12345678 size=4
  122. # dummy-irq: interrupt occurred on IRQ 34
  123. #
  124. # When the device generates an IRQ, the dummy module also snoops it.
  125. #
  126. # The IRQ number 34 was found by via dmesg on a previous "insmod /platform_device.ko".
  127. CONFIG_DUMMY_IRQ=m
  128. ## aarch64
  129. # For some reason not selected by default as it was for arm, and pci modules fail to build.
  130. # Not that we have PCI working on ARM anyways.
  131. CONFIG_PCI=y
  132. # Like CONFIG_X86_PTDUMP for ARM.
  133. CONFIG_ARM64_PTDUMP=y
  134. ## UIO
  135. # Userspace drivers: allow you to handle IRQs and do memory IO from userland through a /dev file.
  136. #
  137. # Superseded by the more featureful VFIO.
  138. #
  139. # Documentation/DocBook/uio-howto.tmpl contains actual userland examples
  140. # for the generic examples under drivers/uio
  141. #
  142. # UIO interface in a nutshell:
  143. #
  144. # - blocking read / poll: waits until interrupts
  145. # - write: call irqcontrol callback. Default: 0 or 1 to enable / disable interrupts.
  146. # - mmap: access device memory
  147. # All other UIO depend on this module.
  148. CONFIG_UIO=m
  149. # Generic platform devices.
  150. # https://yurovsky.github.io/2014/10/10/linux-uio-gpio-interrupt/
  151. CONFIG_UIO_DMEM_GENIRQ=m
  152. CONFIG_UIO_PDRV_GENIRQ=m
  153. # https://github.com/rumpkernel/wiki/wiki/Howto:-Accessing-PCI-devices-from-userspace
  154. # /sys/class/uio/
  155. # /sys/class/uio/uio0
  156. CONFIG_UIO_PCI_GENERIC=m