2016-12-30 10 views
1

간단한 커널 모듈을 컴파일하려고합니다. 메이크 파일은 다음과 같습니다4.3.0-sabayon linux에서 'hello world'커널 모듈을 컴파일 할 때 문제가 발생했습니다.

obj-m += hello-l.o 
all: 
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules 
clean: 
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean 

오류는 다음과 같습니다 나는 우분투 컴퓨터에이 코드를 컴파일 할 수있었습니다

make[1]: Entering directory '/usr/src/linux-4.3.0-sabayon' 
Makefile:340: scripts/Kbuild.include: No such file or directory 
Makefile:605: arch/x86/Makefile: No such file or directory 
/bin/sh: ./scripts/gcc-goto.sh: No such file or directory 
Makefile:778: scripts/Makefile.kasan: No such file or directory 
Makefile:779: scripts/Makefile.extrawarn: No such file or directory 
make[1]: *** No rule to make target 'scripts/Makefile.extrawarn'. Stop. 
make[1]: Leaving directory '/usr/src/linux-4.3.0-sabayon' 
Makefile:4: recipe for target 'all' failed 
make: *** [all] Error 2 

. 왜 sabayon 컴퓨터가 가장 간단한 코드라도 컴파일하는 데 필요한 파일이 누락 되었습니까?

답변

0

다음 명령 show 무엇 않습니다 커널 (STABLE) 헤더는 사바욘 리눅스 시스템에 설치되지 않습니다

ls -al /usr/src/linux-4.3.0-sabayon 

가 될 수 있을까? Fedora에서 rpm은 kernel-devel입니다. 나는 비슷한 패키지가 Gentoo의 파생물 인 우분투에서 어떻게 불려지는지 알지 못합니다.

+0

LS의 출력 -al /usr/src/linux-4.3.0-sabayon이다 : 총 5156 drwxr-XR-X (3) 루트 루트 2016년 1월 5일 4096. drwxr-xr-x 6 루트 루트 4096 12 월 30 일 12:15 .. -rw-r-r-- 1 루트 루트 177673 12 월 16 일 2015. config drwxr-xr-x 3 루트 루트 4096 년 1 월 5 일 포함 -rw-r-r-- 1 루트 루트 54503 12 월 16 일 2015 메이크 파일 -rw-r-r-- 1 루트 루트 1262265 12 월 16 일 2015 Module.symvers -rw-r-r-- 1 root 루트 3761878 12 월 16 일 2015 System.map 커널 헤더를 검색하여 결과가 헤더가 설치되어 있다고 말합니다. 그러나 그들을 찾아야할지 모르겠다. – Thirdeye

+1

두 개의 질의는 답이 아닌 주석으로 게시되어야합니다. BTW 우분투는 * "젠투의 위험한 [sic]"이 아닙니다 *; 데비안 기반 배포판입니다. – sawdust

+0

오타였습니다. 사과드립니다. 나는 sabayon이 gentoo의 파생물이며, 우분투는 gentoo의 파생물이 아니라는 것을 의미합니다. 라미 로젠 –