1 page.title=Kernel Configuration 2 @jd:body 3 4 <!-- 5 Copyright 2015 The Android Open Source Project 6 7 Licensed under the Apache License, Version 2.0 (the "License"); 8 you may not use this file except in compliance with the License. 9 You may obtain a copy of the License at 10 11 http://www.apache.org/licenses/LICENSE-2.0 12 13 Unless required by applicable law or agreed to in writing, software 14 distributed under the License is distributed on an "AS IS" BASIS, 15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 See the License for the specific language governing permissions and 17 limitations under the License. 18 --> 19 <div id="qv-wrapper"> 20 <div id="qv"> 21 <h2>In this document</h2> 22 <ol id="auto-toc"> 23 </ol> 24 </div> 25 </div> 26 27 <p>The kernel configuration settings in this document are meant to be used as a 28 base for an Android kernel configuration. All devices should have the options 29 in android-base configuration enabled. While not mandatory, the options in 30 android-recommended configuration enable advanced Android 31 features.</p> 32 33 <p> 34 Generating kernel config: Assuming you already have a minimalist defconfig for your device, a possible 35 way to enable these options would be:</p> 36 37 <pre>ARCH=<arch> scripts/kconfig/merge_config.sh <path_to>/<device>_defconfig android/configs/android-base.cfg 38 android/configs/android-recommended.cfg</pre> 39 <p> 40 This will generate a .config that can then be used to save a new defconfig or 41 compile a new kernel with Android features enabled. 42 </p> 43 <h3 id="base"> 44 Base Configuration 45 </h3> 46 <pre> 47 CONFIG_EXPERIMENTAL=y 48 CONFIG_SYSVIPC=y 49 CONFIG_CGROUPS=y 50 CONFIG_CGROUP_DEBUG=y 51 CONFIG_CGROUP_FREEZER=y 52 CONFIG_CGROUP_CPUACCT=y 53 CONFIG_RESOURCE_COUNTERS=y 54 CONFIG_CGROUP_SCHED=y 55 CONFIG_RT_GROUP_SCHED=y 56 CONFIG_BLK_DEV_INITRD=y 57 CONFIG_EMBEDDED=y 58 CONFIG_NO_HZ=y 59 CONFIG_HIGH_RES_TIMERS=y 60 CONFIG_PREEMPT=y 61 CONFIG_PM_AUTOSLEEP=y 62 CONFIG_PM_WAKELOCKS=y 63 CONFIG_BLK_DEV_DM=y 64 CONFIG_DM_CRYPT=y 65 CONFIG_NET=y 66 CONFIG_PACKET=y 67 CONFIG_UNIX=y 68 CONFIG_XFRM_USER=y 69 CONFIG_NET_KEY=y 70 CONFIG_INET=y 71 CONFIG_IP_ADVANCED_ROUTER=y 72 CONFIG_IP_MULTIPLE_TABLES=y 73 CONFIG_INET_ESP=y 74 # CONFIG_INET_LRO is not set 75 CONFIG_IPV6_PRIVACY=y 76 CONFIG_IPV6_ROUTER_PREF=y 77 CONFIG_IPV6_OPTIMISTIC_DAD=y 78 CONFIG_INET6_AH=y 79 CONFIG_INET6_ESP=y 80 CONFIG_INET6_IPCOMP=y 81 CONFIG_IPV6_MIP6=y 82 CONFIG_IPV6_MULTIPLE_TABLES=y 83 CONFIG_NETFILTER=y 84 CONFIG_NF_CONNTRACK=y 85 CONFIG_NF_CONNTRACK_EVENTS=y 86 CONFIG_NF_CT_PROTO_DCCP=y 87 CONFIG_NF_CT_PROTO_SCTP=y 88 CONFIG_NF_CT_PROTO_UDPLITE=y 89 CONFIG_NF_CONNTRACK_AMANDA=y 90 CONFIG_NF_CONNTRACK_FTP=y 91 CONFIG_NF_CONNTRACK_H323=y 92 CONFIG_NF_CONNTRACK_IRC=y 93 CONFIG_NF_CONNTRACK_NETBIOS_NS=y 94 CONFIG_NF_CONNTRACK_PPTP=y 95 CONFIG_NF_CONNTRACK_SANE=y 96 CONFIG_NF_CONNTRACK_TFTP=y 97 CONFIG_NF_CT_NETLINK=y 98 CONFIG_NETFILTER_TPROXY=y 99 CONFIG_NETFILTER_XT_TARGET_CLASSIFY=y 100 CONFIG_NETFILTER_XT_TARGET_CONNMARK=y 101 CONFIG_NETFILTER_XT_TARGET_MARK=y 102 CONFIG_NETFILTER_XT_TARGET_NFLOG=y 103 CONFIG_NETFILTER_XT_TARGET_NFQUEUE=y 104 CONFIG_NETFILTER_XT_TARGET_TPROXY=y 105 CONFIG_NETFILTER_XT_TARGET_TRACE=y 106 CONFIG_NETFILTER_XT_MATCH_COMMENT=y 107 CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=y 108 CONFIG_NETFILTER_XT_MATCH_CONNMARK=y 109 CONFIG_NETFILTER_XT_MATCH_CONNTRACK=y 110 CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=y 111 CONFIG_NETFILTER_XT_MATCH_HELPER=y 112 CONFIG_NETFILTER_XT_MATCH_IPRANGE=y 113 CONFIG_NETFILTER_XT_MATCH_LENGTH=y 114 CONFIG_NETFILTER_XT_MATCH_LIMIT=y 115 CONFIG_NETFILTER_XT_MATCH_MAC=y 116 CONFIG_NETFILTER_XT_MATCH_MARK=y 117 CONFIG_NETFILTER_XT_MATCH_POLICY=y 118 CONFIG_NETFILTER_XT_MATCH_PKTTYPE=y 119 CONFIG_NETFILTER_XT_MATCH_QTAGUID=y 120 CONFIG_NETFILTER_XT_MATCH_QUOTA=y 121 CONFIG_NETFILTER_XT_MATCH_QUOTA2=y 122 CONFIG_NETFILTER_XT_MATCH_QUOTA2_LOG=y 123 CONFIG_NETFILTER_XT_MATCH_SOCKET=y 124 CONFIG_NETFILTER_XT_MATCH_STATE=y 125 CONFIG_NETFILTER_XT_MATCH_STATISTIC=y 126 CONFIG_NETFILTER_XT_MATCH_STRING=y 127 CONFIG_NETFILTER_XT_MATCH_TIME=y 128 CONFIG_NETFILTER_XT_MATCH_U32=y 129 CONFIG_NF_CONNTRACK_IPV4=y 130 CONFIG_IP_NF_IPTABLES=y 131 CONFIG_IP_NF_MATCH_AH=y 132 CONFIG_IP_NF_MATCH_ECN=y 133 CONFIG_IP_NF_MATCH_TTL=y 134 CONFIG_IP_NF_FILTER=y 135 CONFIG_IP_NF_TARGET_REJECT=y 136 CONFIG_IP_NF_TARGET_REJECT_SKERR=y 137 CONFIG_NF_NAT=y 138 CONFIG_IP_NF_TARGET_MASQUERADE=y 139 CONFIG_IP_NF_TARGET_NETMAP=y 140 CONFIG_IP_NF_TARGET_REDIRECT=y 141 CONFIG_IP_NF_MANGLE=y 142 CONFIG_IP_NF_RAW=y 143 CONFIG_IP_NF_ARPTABLES=y 144 CONFIG_IP_NF_ARPFILTER=y 145 CONFIG_IP_NF_ARP_MANGLE=y 146 CONFIG_NF_CONNTRACK_IPV6=y 147 CONFIG_IP6_NF_IPTABLES=y 148 CONFIG_IP6_NF_FILTER=y 149 CONFIG_IP6_NF_TARGET_REJECT=y 150 CONFIG_IP6_NF_TARGET_REJECT_SKERR=y 151 CONFIG_IP6_NF_MANGLE=y 152 CONFIG_IP6_NF_RAW=y 153 CONFIG_NET_SCHED=y 154 CONFIG_NET_SCH_HTB=y 155 CONFIG_NET_CLS_U32=y 156 CONFIG_NET_EMATCH=y 157 CONFIG_NET_EMATCH_U32=y 158 CONFIG_NET_CLS_ACT=y 159 CONFIG_NETDEVICES=y 160 CONFIG_TUN=y 161 CONFIG_PPP=y 162 CONFIG_PPP_BSDCOMP=y 163 CONFIG_PPP_DEFLATE=y 164 CONFIG_PPP_MPPE=y 165 CONFIG_PPPOLAC=y 166 CONFIG_PPPOPNS=y 167 CONFIG_FB=y 168 CONFIG_SYNC=y 169 CONFIG_USB_GADGET=y 170 CONFIG_USB_G_ANDROID=y 171 CONFIG_USB_OTG_WAKELOCK=y 172 CONFIG_SWITCH=y 173 CONFIG_RTC_CLASS=y 174 CONFIG_STAGING=y 175 CONFIG_ANDROID=y 176 CONFIG_ANDROID_BINDER_IPC=y 177 CONFIG_ASHMEM=y 178 CONFIG_ANDROID_LOGGER=y 179 CONFIG_ANDROID_LOW_MEMORY_KILLER=y 180 CONFIG_ANDROID_INTF_ALARM_DEV=y 181 </pre> 182 183 <h3 id="recommended">Recommended Configuration</h3> 184 185 <pre> 186 CONFIG_PANIC_TIMEOUT=5 187 CONFIG_KALLSYMS_ALL=y 188 CONFIG_PERF_EVENTS=y 189 CONFIG_COMPACTION=y 190 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set 191 CONFIG_PM_WAKELOCKS_LIMIT=0 192 # CONFIG_PM_WAKELOCKS_GC is not set 193 CONFIG_PM_RUNTIME=y 194 CONFIG_PM_DEBUG=y 195 CONFIG_SUSPEND_TIME=y 196 CONFIG_BLK_DEV_LOOP=y 197 CONFIG_BLK_DEV_RAM=y 198 CONFIG_BLK_DEV_RAM_SIZE=8192 199 CONFIG_UID_STAT=y 200 CONFIG_MD=y 201 CONFIG_DM_UEVENT=y 202 CONFIG_INPUT_EVDEV=y 203 CONFIG_INPUT_KEYRESET=y 204 # CONFIG_INPUT_MOUSE is not set 205 CONFIG_INPUT_JOYSTICK=y 206 CONFIG_JOYSTICK_XPAD=y 207 CONFIG_JOYSTICK_XPAD_FF=y 208 CONFIG_JOYSTICK_XPAD_LEDS=y 209 CONFIG_INPUT_TABLET=y 210 CONFIG_TABLET_USB_ACECAD=y 211 CONFIG_TABLET_USB_AIPTEK=y 212 CONFIG_TABLET_USB_GTCO=y 213 CONFIG_TABLET_USB_HANWANG=y 214 CONFIG_TABLET_USB_KBTAB=y 215 CONFIG_TABLET_USB_WACOM=y 216 CONFIG_INPUT_MISC=y 217 CONFIG_INPUT_KEYCHORD=y 218 CONFIG_INPUT_UINPUT=y 219 CONFIG_INPUT_GPIO=y 220 # CONFIG_VT is not set 221 # CONFIG_LEGACY_PTYS is not set 222 CONFIG_POWER_SUPPLY=y 223 CONFIG_BATTERY_ANDROID=y 224 CONFIG_MEDIA_SUPPORT=y 225 CONFIG_BACKLIGHT_LCD_SUPPORT=y 226 CONFIG_SOUND=y 227 CONFIG_SND=y 228 CONFIG_UHID=y 229 CONFIG_USB_HIDDEV=y 230 CONFIG_HID_A4TECH=y 231 CONFIG_HID_ACRUX=y 232 CONFIG_HID_ACRUX_FF=y 233 CONFIG_HID_APPLE=y 234 CONFIG_HID_BELKIN=y 235 CONFIG_HID_CHERRY=y 236 CONFIG_HID_CHICONY=y 237 CONFIG_HID_PRODIKEYS=y 238 CONFIG_HID_CYPRESS=y 239 CONFIG_HID_DRAGONRISE=y 240 CONFIG_DRAGONRISE_FF=y 241 CONFIG_HID_EMS_FF=y 242 CONFIG_HID_ELECOM=y 243 CONFIG_HID_EZKEY=y 244 CONFIG_HID_HOLTEK=y 245 CONFIG_HID_KEYTOUCH=y 246 CONFIG_HID_KYE=y 247 CONFIG_HID_UCLOGIC=y 248 CONFIG_HID_WALTOP=y 249 CONFIG_HID_GYRATION=y 250 CONFIG_HID_TWINHAN=y 251 CONFIG_HID_KENSINGTON=y 252 CONFIG_HID_LCPOWER=y 253 CONFIG_HID_LOGITECH=y 254 CONFIG_LOGITECH_FF=y 255 CONFIG_LOGIRUMBLEPAD2_FF=y 256 CONFIG_LOGIG940_FF=y 257 CONFIG_HID_MAGICMOUSE=y 258 CONFIG_HID_MICROSOFT=y 259 CONFIG_HID_MONTEREY=y 260 CONFIG_HID_MULTITOUCH=y 261 CONFIG_HID_NTRIG=y 262 CONFIG_HID_ORTEK=y 263 CONFIG_HID_PANTHERLORD=y 264 CONFIG_PANTHERLORD_FF=y 265 CONFIG_HID_PETALYNX=y 266 CONFIG_HID_PICOLCD=y 267 CONFIG_HID_PRIMAX=y 268 CONFIG_HID_ROCCAT=y 269 CONFIG_HID_SAITEK=y 270 CONFIG_HID_SAMSUNG=y 271 CONFIG_HID_SONY=y 272 CONFIG_HID_SPEEDLINK=y 273 CONFIG_HID_SUNPLUS=y 274 CONFIG_HID_GREENASIA=y 275 CONFIG_GREENASIA_FF=y 276 CONFIG_HID_SMARTJOYPLUS=y 277 CONFIG_SMARTJOYPLUS_FF=y 278 CONFIG_HID_TIVO=y 279 CONFIG_HID_TOPSEED=y 280 CONFIG_HID_THRUSTMASTER=y 281 CONFIG_HID_WACOM=y 282 CONFIG_HID_WIIMOTE=y 283 CONFIG_HID_ZEROPLUS=y 284 CONFIG_HID_ZYDACRON=y 285 CONFIG_USB_USBNET=y 286 CONFIG_USB_ANNOUNCE_NEW_DEVICES=y 287 CONFIG_USB_EHCI_HCD=y 288 CONFIG_ION=y 289 CONFIG_ANDROID_RAM_CONSOLE=y 290 CONFIG_ANDROID_TIMED_GPIO=y 291 CONFIG_EXT4_FS=y 292 CONFIG_EXT4_FS_SECURITY=y 293 CONFIG_FUSE_FS=y 294 CONFIG_MSDOS_FS=y 295 CONFIG_VFAT_FS=y 296 CONFIG_TMPFS=y 297 CONFIG_TMPFS_POSIX_ACL=y 298 CONFIG_SCHEDSTATS=y 299 CONFIG_TIMER_STATS=y 300 CONFIG_SCHED_TRACER=y 301 CONFIG_CPUSETS=y 302 CONFIG_PROC_PID_CPUSET=y 303 </pre> 304 305 <h3 id="audio">For USB host mode audio</h3> 306 307 <pre> 308 CONFIG_SND_USB=y 309 CONFIG_SND_USB_AUDIO=y 310 # CONFIG_USB_AUDIO is for a peripheral mode (gadget) driver 311 </pre> 312 313 <h3 id="midi">For USB host mode MIDI</h3> 314 315 <pre> 316 CONFIG_SND_USB_MIDI=y 317 </pre> 318