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