I am on Ubuntu Server 12.04 x86_64 and I need to build Android CyanogenMod 7.2 kernel module. My phone has custom ROM and a patched kernel:adb shell cat /proc/versionyieldsLinux version 2.6.37.3-cyanogenmod-gf3345ef-dirty (subbotin@avs234) (gcc version 4.4.0 (GCC) ) #2 PREEMPT Sun Mar 13 14:55:50 MSK 2011I have this variable setup in addition to toolchain variables etc.export LOCALVERSION=-cyanogenmod-gf3345ef-dirty (subbotin@avs234)When I run make (note that on Ubuntu bash is dash) I get the following:CHK    include/linux/version.h/bin/sh: 1: Syntax error: ( unexpected (expecting ))make: ***[include/generated/utsrelease.h] Error 2However, if I remove (subbotin@avs234) the kernel compiles just fine. I need a full vermagic string since I suspect that this kernel module wouldn't load because of difference in the version string. What is the problem with parentheses?A more detailed description:The device is HTC Desire (bravo) GSM and the application is EDS Lite (http://play.google.com/store/apps/details?id=com.sovworks.edslite).I partially followed this http://oldwiki.cyanogenmod.org/wiki/Building_Kernel_from_source and this is a kernel module compilation guide http://www.sovworks.com/details.html#compileModule. In the latter link it is mentioned that vermagic string should probably match completely. When I try to load this module from the application mount menu I get 'failed loading kernel module'#get repo toolmkdir -p ~/bin curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo chmod a+x ~/bin/repo #clone repo for cm-kernelmkdir -p ~/Android/kernel cd ~/Android/kernel git clone git://github.com/CyanogenMod/cm-kernel.git cd cm-kernel#pull the kernel configuration from the device#my config file is here: http://pastebin.com/aHA2mETGadb pull /proc/config.gz ~/Android/kernel/cm-kernelcd ~/Android/kernel/cm-kernelgunzip config.gz#replace CONFIG_LOCALVERSION and CONFIG_LOCALVERSION_AUTO with null stringsed 's/CONFIG_LOCALVERSION\([[:alnum:][:punct:]]\)*//' config > .configcp config .config#toolchain from http://developer.android.com/sdk/index.html#download (sdk tools)export CROSS_COMPILE=~/Android/Toolchain/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-export CCOMPILER=~/Android/Toolchain/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-export ARCH=armexport SUBARCH=armexport LOCALVERSION=-cyanogenmod-gf3345ef-dirty (subbotin@avs234)make oldconfig#Answer no CONFIG_LOCALVERSION_AUTO (the second prompt) request.make#download EDS kernel module src http://www.sovworks.com/downloads.html#extract to ~/Android/kmcd ~/kmmake -C ~/Android/kernel/cm-kernel\ ARCH=arm CROSS_COMPILE=~/Android/Toolchain/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-\ EXTRA_CFLAGS=-fno-pic\ SUBDIRS=~/Android/km modules#if LOCALVERSION=-cyanogenmod-gf3345ef-dirty then vermagic string is as in the followingmodinfo eds.ko#...vermagic:       2.6.37.6-cyanogenmod-gf3345ef-dirty preempt mod_unload ARMv7 upd: just noticed that the stable version of currently installed kernel (which is 3) is not equal to the built kernel stable version (6). Not sure if they are compatible - maybe the problem is with installed kernel version string after all?
Running make with vermagic kernel string with parentheses causes /bin/sh syntax error
kernel;compiling;android
However, if I remove (subbotin@avs234) the kernel compiles just fine.You don't need this in the LOCALVERSION. subbotin@avs234 is just the one that compiled the kernel (user@host). It's not part of the version string nor needed for anything related to the compilation of the kernel.