kernel_config_fragment 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. # Changes to this file are automatically trigger kernel reconfigures
  2. # even without using the linux-reconfigure target.
  3. CONFIG_DEBUG_FS=y
  4. CONFIG_DEBUG_INFO=y
  5. CONFIG_DEBUG_KERNEL=y
  6. CONFIG_GDB_SCRIPTS=y
  7. # Non-static variables show up on /proc/kallsyms
  8. # https://stackoverflow.com/questions/20196636/does-kallsyms-have-all-the-symbol-of-kernel-functions/44614878#44614878
  9. CONFIG_KALLSYMS_ALL=y
  10. # zcat /proc/config.gz
  11. CONFIG_IKCONFIG=y
  12. CONFIG_IKCONFIG_PROC=y
  13. # TODO make example.
  14. # This seems to allow userspace to create arbitrary configuration trees,
  15. # which kernel modules can then read and interpret.
  16. CONFIG_CONFIGFS_FS=y
  17. # KGDB
  18. CONFIG_CONSOLE_POLL=y
  19. CONFIG_KDB_CONTINUE_CATASTROPHIC=0
  20. CONFIG_KDB_DEFAULT_ENABLE=0x1
  21. CONFIG_KDB_KEYBOARD=y
  22. CONFIG_KGDB=y
  23. CONFIG_KGDB_KDB=y
  24. CONFIG_KGDB_LOW_LEVEL_TRAP=y
  25. CONFIG_KGDB_SERIAL_CONSOLE=y
  26. CONFIG_KGDB_TESTS=y
  27. CONFIG_KGDB_TESTS_ON_BOOT=n
  28. CONFIG_MAGIC_SYSRQ=y
  29. CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x1
  30. CONFIG_SERIAL_KGDB_NMI=n
  31. # Module.symvers in kernel tree and modules tree contains CRC of signatures.
  32. # TODO: I think the CRC are stored in the built kernel and module, and checked
  33. # at insmod, but bgrep did not find it in kernel image.
  34. # Does not show in /proc/kallyms either.
  35. CONFIG_MODVERSIONS=y
  36. # ftrace
  37. CONFIG_DYNAMIC_FTRACE=y
  38. CONFIG_FTRACE=y
  39. CONFIG_FTRACE_SYSCALLS=y
  40. CONFIG_FUNCTION_GRAPH_TRACER=y
  41. CONFIG_FUNCTION_PROFILER=y
  42. CONFIG_FUNCTION_TRACER=y
  43. CONFIG_HWLAT_TRACER=y
  44. CONFIG_IRQSOFF_TRACER=y
  45. CONFIG_SCHED_TRACER=y
  46. CONFIG_STACK_TRACER=y
  47. CONFIG_TRACER_SNAPSHOT=y
  48. ## x86
  49. # https://stackoverflow.com/questions/20069620/print-kernels-page-table-entries
  50. # cat /sys/kernel/debug/kernel_page_tables
  51. CONFIG_X86_PTDUMP=y
  52. ## ARM
  53. # LEDs:
  54. #
  55. # cd /sys/class/leds/versatile:0
  56. # cat max_brightness
  57. # echo 255 >brightness
  58. #
  59. # https://raspberrypi.stackexchange.com/questions/697/how-do-i-control-the-system-leds-using-my-software
  60. #
  61. # Relevant QEMU files:
  62. #
  63. # - hw/arm/versatilepb.c
  64. # - hw/misc/arm_sysctl.c
  65. #
  66. # Relevant kernel files:
  67. #
  68. # - arch/arm/boot/dts/versatile-pb.dts
  69. # - drivers/leds/led-class.c
  70. # - drivers/leds/leds-sysctl.c
  71. #
  72. # Try hacking QEMU's `hw/misc/arm_sysctl.c` with a printf:
  73. #
  74. # static void arm_sysctl_write(void *opaque, hwaddr offset,
  75. # uint64_t val, unsigned size)
  76. # {
  77. # arm_sysctl_state *s = (arm_sysctl_state *)opaque;
  78. #
  79. # switch (offset) {
  80. # case 0x08: /* LED */
  81. # printf("LED val = %llx\n", (unsigned long long)val);
  82. #
  83. # to obeserve when the callback is made. But beware that one of the LEDs
  84. # has a heartbeat trigger by default (specified on dts), so it will produce a lot of output.
  85. CONFIG_LEDS_CLASS=y
  86. CONFIG_LEDS_CLASS_FLASH=y
  87. CONFIG_LEDS_SYSCON=y
  88. CONFIG_LEDS_TRIGGERS=y
  89. CONFIG_LEDS_TRIGGER_BACKLIGHT=y
  90. CONFIG_LEDS_TRIGGER_CPU=y
  91. CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
  92. CONFIG_LEDS_TRIGGER_GPIO=y
  93. CONFIG_LEDS_TRIGGER_HEARTBEAT=y
  94. CONFIG_LEDS_TRIGGER_ONESHOT=y
  95. CONFIG_LEDS_TRIGGER_TIMER=y
  96. CONFIG_NEW_LEDS=y
  97. # GPIO.
  98. CONFIG_ARM_AMBA=y
  99. CONFIG_GPIOLIB=y
  100. CONFIG_GPIO_SYSFS=y
  101. CONFIG_GPIO_PL061=y
  102. # In target:
  103. #
  104. # modprobe dummy-irq irq=34
  105. # insmod /platform_device.ko
  106. #
  107. # Outcome:
  108. #
  109. # lkmc_platform_device_write offset=0 value=12345678 size=4
  110. # dummy-irq: interrupt occurred on IRQ 34
  111. #
  112. # When the device generates an IRQ, the dummy module also snoops it.
  113. #
  114. # The IRQ number 34 was found by via dmesg on a previous "insmod /platform_device.ko".
  115. CONFIG_DUMMY_IRQ=m
  116. ## aarch64
  117. # For some reason not selected by default as it was for arm, and pci modules fail to build.
  118. # Not that we have PCI working on ARM anyways.
  119. CONFIG_PCI=y
  120. # Like CONFIG_X86_PTDUMP for ARM.
  121. CONFIG_ARM64_PTDUMP=y