[问题].config文件在ubuntu的什么文件夹下

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
炫目黑客
帖子: 2
注册时间: 2007-10-18 15:40

[问题].config文件在ubuntu的什么文件夹下

#1

帖子 炫目黑客 » 2007-10-18 16:23

1. 我的Makefile文件如下
# set to your kernel tree
KERNEL = /home/linux

# get the Linux architecture. Needed to find proper include file for CFLAGS
ARCH=$(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
# set default flags to compile module
CFLAGS = -D__KERNEL__ -DMODULE -I$(KERNEL)/include
CFLAGS+= -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing

all: sharelist.o

# get configuration of kernel
include $(KERNEL)/.config
# modify CFLAGS with architecture specific flags
include $(KERNEL)/arch/${ARCH}/Makefile

# enable the module versions, if configured in kernel source tree
ifdef CONFIG_MODVERSIONS
CFLAGS+= -DMODVERSIONS -include $(KERNEL)/include/linux/modversions.h
endif
# enable SMP, if configured in kernel source tree
ifdef CONFIG_SMP
CFLAGS+= -D__SMP__
endif

# note: we are compiling the driver object file and then linking
# we link it into the module. With just one object file as in
# this example this is not needed. We can just load the object
# file produced by gcc
# link the thread driver module
sharelist.o: sharelist.c
gcc $(CFLAGS) -c sharelist.c
clean:
rm -f *.o


# modify CFLAGS with architecture specific flags
include $(KERNEL)/arch/${ARCH}/Makefile

2. sharelist.c文件已编写好

3.
我的本来理解是:把arch/${ARCH}/Makefile文件和.config文件存储到/home/linux下,而linux文件夹只是个用户文件夹,可以随着自己定义的不同而变化,比如我的电脑上是/home/chen,就是把arch/${ARCH}/Makefile文件和.config文件存储到chen文件夹下,然后把Makefile中开始部分的代码改为KERNEL = /home/chen,不知道我的理解对不对

问题:每次以输入make就显示arch/${ARCH}/Makefile和.config找不到,但是我在LINUX中搜索.config根本找不到,找到的只是*.config形式的文件,至于arch/${ARCH}/Makefile,因为前面ARCH的复杂定义,我就更摸不着头脑了,我刚刚接触LINUX不久,希望有高手能帮我解决一下上述问题

邮箱:[email protected]
QQ: 416508484
Wang Lei
帖子: 214
注册时间: 2007-07-16 21:42

#2

帖子 Wang Lei » 2007-10-18 18:16

应该在你内核源代码的目录下,比如:..../linux-2.6/

另外,/boot下有个config-2.6.....
HP Compaq 6515b(GL087PA)
Sawfish+Emacs+Firefox+Xpdf+MPlayer...
炫目黑客
帖子: 2
注册时间: 2007-10-18 15:40

我搜索了的,没有

#3

帖子 炫目黑客 » 2007-10-19 10:26

一是我不知道unubtu的内核文件夹在什么地方,redhat的内核文件一般在/usr/src下,但unubtu下似乎并不在那个录下;二是我在整个文件系统都搜索过,没有什么.config文件的

邮箱:[email protected]
QQ: 416508484
MSN:[email protected]
Wang Lei
帖子: 214
注册时间: 2007-07-16 21:42

#4

帖子 Wang Lei » 2007-10-19 10:32

如果你自己编译了内核当然会知道内核文件夹在哪,如果你用apt-get下载了内核源码就会在/usr/src下。

如果都没有,在/boot下有个config-2.6.....,是你当前内核的配置文件,可以下载内核源码,然后把它COPY到那个目录下,重命名为.config。然后make oldconfig编译内核。

我说清楚了吗?:)
HP Compaq 6515b(GL087PA)
Sawfish+Emacs+Firefox+Xpdf+MPlayer...
回复