Computers/Adv. Linux System Programming

disagrees about version of symbol module_layout

emzei 2014. 10. 6. 16:24


커널 코드 일부 수정 후, VM에서 부팅하려는데 자꾸 오류남.


오류 메시지 일부 : 

usb_common : disagrees about version of symbol module_layout




quick solution

(ref) http://stackoverflow.com/questions/2720177/module-layout-version-incompatibility


I have android system with one binary module (pvrsrvkm for graphics). I have been building kernels from source for this system. In general all works fine, but with some kernel .config options (for kgdb), the pvrsrvkm module would not load with "disagrees about version of symbol" error.

The pvrsrvkm module is loaded by android early and when it fails the system is unusable with no GUI.

Since I was already building kernel, my quick fix was to disable version checking by adding one line (versindex = 0;) to kernel source file kernel/module.c :

static int check_version(Elf_Shdr *sechdrs,
unsigned int versindex,
const char *symname,
struct module *mod,
const unsigned long *crc,
const struct module *crc_owner) 
{
unsigned int i, num_versions;
struct modversion_info *versions;

/* Exporting module didn't supply crcs?  OK, we're already tainted. */
if (!crc)
    return 1;

/* No versions at all?  modprobe --force does this. */
versindex = 0; // I added this line
if (versindex == 0)


+++

2014.11.09 

아 기억이 잘 안나는데 제대로 안 된 경우가 vmlinux만 업데이트 했어서. initrd.img 도 새로 생성해서 같이 적용하니까 탈 안남.

소스코드를 고친 경우에 module도 변경되면 커널 컴파일 및 커널파일시스템에 해당 모듈 설치 및 initrd 업데이트 꼭 하기. 

'Computers > Adv. Linux System Programming' 카테고리의 다른 글

/proc/bus/input/devices 구조  (0) 2014.12.14
wait queue 구조  (0) 2014.12.13
change sources.list  (0) 2014.05.20
install RT linux  (0) 2014.05.19
ubuntu initrd.img 생성  (0) 2014.05.01