請問如何編譯新的kernel module

如果您覺得您的問題不屬於 debian desktop 或是 debian server 版的範圍內,請在這裡發問。

版主: mufa

請問如何編譯新的kernel module

文章ricky » 週四 3月 18, 2004 3:45 pm

請問需要那些步驟才能再外加新的module

以下是我的情況
想要使用 lufs
但是安裝完
lufs-source & lufs-util後
要mount時卻出現找不到module的訊息
ricky
可愛的小學生
可愛的小學生
 
文章: 72
註冊時間: 週五 10月 10, 2003 8:17 pm

re:請問如何編譯新的kernel module

文章cweijen » 週四 3月 18, 2004 3:50 pm

你是否可以將那些訊息可以PO上來...

insmod name_module //安裝
rmmod name_module //反安裝



HAVE FUN!
----------------------------------------
提倡RSS....期盼RSS世界.......
http://zonble.twbbs.org/archives/2003_11/000966.php
頭像
cweijen
可愛的小學生
可愛的小學生
 
文章: 87
註冊時間: 週一 12月 22, 2003 5:04 pm

re:請問如何編譯新的kernel module

文章kanru » 週四 3月 18, 2004 4:58 pm

安裝完source後應該會在/usr/src裡面
到那裡把source解開再看看要怎麼裝^^
圖檔
頭像
kanru
榮譽學長
榮譽學長
 
文章: 578
註冊時間: 週六 7月 12, 2003 12:09 pm

re:請問如何編譯新的kernel module

文章ricky » 週四 3月 18, 2004 6:58 pm

kanru 寫:安裝完source後應該會在/usr/src裡面
到那裡把source解開再看看要怎麼裝^^


:/usr/src/modules/lufs# dpkg-buildpackage
dpkg-buildpackage: source package is lufs
dpkg-buildpackage: source version is 0.9.7-2
dpkg-buildpackage: source maintainer is Eduard Bloch <blade@debian.org>
dpkg-buildpackage: host architecture is i386
debian/rules clean
dh_clean
find -name '*.o' | xargs rm -f
dh_testdir
dh_testroot
rm -f build-arch-stamp build-indep-stamp config-stamp config.{guess,sub,log} config/config.{guess,sub,log}
rm -f debian/manpage.{refs,links}
# Add here commands to clean up after the build process.
/usr/bin/make distclean
make[1]: Entering directory `/usr/src/modules/lufs'
make[1]: *** No rule to make target `distclean'. Stop.
make[1]: Leaving directory `/usr/src/modules/lufs'
make: [clean] Error 2 (ignored)
dh_clean
dpkg-source -b lufs
dpkg-source: warning: source directory `./lufs' is not <sourcepackage>-<upstreamversion> `lufs-0.9.7'
dpkg-source: building lufs in lufs_0.9.7-2.tar.gz
dpkg-source: building lufs in lufs_0.9.7-2.dsc
debian/rules build
make: *** No rule to make target `configure', needed by `config.status'. Stop.
ricky
可愛的小學生
可愛的小學生
 
文章: 72
註冊時間: 週五 10月 10, 2003 8:17 pm

re:請問如何編譯新的kernel module

文章阿信 » 週四 3月 18, 2004 7:41 pm

ricky 兄您好

dpkg-buildpackage 會利用 dh_testdir 來檢查目錄的命名規格。

如果要在某一個目錄產生 deb 檔案,其目錄必須限制成 filename-version
頭像
阿信
版面大總管
版面大總管
 
文章: 4756
註冊時間: 週二 9月 03, 2002 11:58 pm
來自: 台灣 - 嘉義

re:請問如何編譯新的kernel module

文章ricky » 週五 3月 19, 2004 1:18 am

阿信 寫:ricky 兄您好

dpkg-buildpackage 會利用 dh_testdir 來檢查目錄的命名規格。

如果要在某一個目錄產生 deb 檔案,其目錄必須限制成 filename-version


感謝阿信 兄的回應
但是用出現了新的問題


:/usr/src/modules/lufs-0.9.7# dpkg-buildpackage
dpkg-buildpackage: source package is lufs
dpkg-buildpackage: source version is 0.9.7-2
dpkg-buildpackage: source maintainer is Eduard Bloch <blade@debian.org>
dpkg-buildpackage: host architecture is i386
debian/rules clean
dh_clean
find -name '*.o' | xargs rm -f
dh_testdir
dh_testroot
rm -f build-arch-stamp build-indep-stamp config-stamp config.{guess,sub,log} config/config.{guess,sub,log}
rm -f debian/manpage.{refs,links}
# Add here commands to clean up after the build process.
/usr/bin/make distclean
make[1]: Entering directory `/usr/src/modules/lufs-0.9.7'
make[1]: *** No rule to make target `distclean'. Stop.
make[1]: Leaving directory `/usr/src/modules/lufs-0.9.7'
make: [clean] Error 2 (ignored)
dh_clean
dpkg-source -b lufs-0.9.7
dpkg-source: building lufs in lufs_0.9.7-2.tar.gz
dpkg-source: building lufs in lufs_0.9.7-2.dsc
debian/rules build
make: *** No rule to make target `configure', needed by `config.status'. Stop.


請問這是它 rule沒寫好的關係嗎????

#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
#
# Modified to make a template file for a multi-binary package with separated
# build-arch and build-indep targets by Bill Allombert 2001

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

SHELL=/bin/bash

# This has to be exported to make some magic below work.
export DH_OPTIONS
export KSRC
export KVERS
export KDREV

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

CFLAGS = -Wall -g

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif

config.status: configure
dh_testdir
cp /usr/share/automake/config.guess /usr/share/automake/config.sub .
cp /usr/share/automake/config.guess /usr/share/automake/config.sub confi
g
#ifneq "$(wildcard /usr/share/misc/config.sub)" ""
# cp -f /usr/share/misc/config.sub config.sub
#endif
#ifneq "$(wildcard /usr/share/misc/config.guess)" ""
# cp -f /usr/share/misc/config.guess config.guess
#endif
# Add here commands to configure the package.
./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --
prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --en
able-kernel-support=no
perl -pe 's/^CFLAGS.=/$$& -fPIC /' -i filesystems/gnetfs/Makefile

#Architecture
build: build-arch build-indep

build-arch: build-arch-stamp
build-arch-stamp: config.status

# Add here commands to compile the arch part of the package.
#$(MAKE)

build-indep: build-indep-stamp
build-indep-stamp: config.status

# Add here commands to compile the indep part of the package.
#$(MAKE) doc

clean: kdist_clean
dh_testdir
dh_testroot
rm -f build-arch-stamp build-indep-stamp config-stamp config.{guess,sub,
log} config/config.{guess,sub,log}
rm -f debian/manpage.{refs,links}

# Add here commands to clean up after the build process.
-$(MAKE) distclean

dh_clean

install: install-indep install-arch
install-indep:
dh_testdir
dh_testroot
dh_clean -k -i
dh_installdirs -i /usr/src/modules/lufs
cp -a include kernel README debian/lufs-source/usr/src/modules/lufs
#remove the automake crap
rm -f debian/lufs-source/usr/src/modules/lufs/{include,kernel/Linux}/*.{
am,in}
mkdir debian/lufs-source/usr/src/modules/lufs/debian
cp -a debian/{copyright,changelog,README.Debian,control,*.modules.in,rul
es,compat} debian/lufs-source/usr/src/modules/lufs/debian/
cd debian/lufs-source/usr/src && tar c modules | bzip2 -9 > lufs.tar.bz2
&& rm -rf modules

install-arch:
dh_testdir
dh_testroot
dh_clean -k -a
dh_installdirs -a usr/lib/lufs

# Add here commands to install the arch part of the package into
# debian/tmp.
$(MAKE) install DESTDIR=$(CURDIR)/debian/lufs-utils
mv $(CURDIR)/debian/lufs-utils/usr/lib/lib* $(CURDIR)/debian/lufs-utils/
usr/lib/lufs
ln -sf /usr/bin/lufsd $(CURDIR)/debian/lufs-utils/sbin/mount.lufs
rm $(CURDIR)/debian/lufs-utils/etc/auto.*
# ln -sf /usr/bin/auto.ftpfs $(CURDIR)/debian/lufs-utils/etc/auto.ftpfs
# ln -sf /usr/bin/auto.sshfs $(CURDIR)/debian/lufs-util/etc/auto.sshfs
dh_install -a
dh_installman -plufs-utils man/*.1 debian/lufs.1
for x in lufsmnt.1 lussh.1 ; do ln -s lufs.1.gz debian/lufs-utils/usr/sh
are/man/man1/$$x.gz ; done
mkdir -p debian/lufs-utils/usr/share/man/man8
for x in lufsd.8 auto.sshfs.8 auto.ftpfs.8 mount.lufs.8 ; do ln -s ../ma
n1/lufs.1.gz debian/lufs-utils/usr/share/man/man8/$$x.gz ; done
dh_shlibdeps -a

# Must not depend on anything. This is to be called by
# binary-arch/binary-multi
# in another 'make' thread.
binary-common:
dh_testdir
dh_testroot
dh_installchangelogs -A ChangeLog
dh_installdocs -A debian/README.Debian
# dh_installmenu
# dh_installdebconf
# dh_installlogrotate
# dh_installemacsen
# dh_installpam
# dh_installmime
# dh_installinit
# dh_installcron
# dh_installinfo
dh_installman
dh_link
dh_strip
dh_compress
dh_fixperms
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
# Build architecture independant packages using the common target.
binary-indep: build-indep install-indep
$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common

# Build architecture dependant packages using the common target.
binary-arch: build-arch install-arch
$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common

binary: binary-arch binary-indep

### begin module setup ###

# prefix of the target package name
PACKAGE=lufs-module
# modifieable for experiments or debugging m-a
MA_DIR ?= /usr/share/modass
# load generic variable handling
-include $(MA_DIR)/include/generic.make
# load default rules
-include $(MA_DIR)/include/common-rules.make

kdist_clean:
dh_clean
find -name '*.o' | xargs rm -f

kdist_config: prep-deb-files

binary-modules:
mkdir -p debian/$(PKGNAME)/lib/modules/$(KVERS)/kernel/fs
ifeq "$(shell echo $(KVERS) | sed -e 's/^\(...\).*/\1/')" "2.4"
cd kernel/Linux/2.4 && $(MAKE) -f Makefile.debian && cp lufs.o $(CURDIR)
/debian/$(PKGNAME)/lib/modules/$(KVERS)/kernel/fs/
else
cd kernel/Linux/2.6 && $(MAKE) .DEFAULT KDIR="$(KSRC)" && cp lufs.ko $(C
URDIR)/debian/$(PKGNAME)/lib/modules/$(KVERS)/kernel/fs/
endif
dh_installdocs
dh_installmodules
dh_installchangelogs
dh_link
dh_strip
dh_compress
dh_fixperms
dh_installdeb
dh_gencontrol -- -v$(VERSION)
dh_md5sums
dh_builddeb --destdir=$(DEB_DESTDIR)

### end module setup ###

.PHONY: build clean binary-indep binary-arch binary install install-indep instal
l-arch

ricky
可愛的小學生
可愛的小學生
 
文章: 72
註冊時間: 週五 10月 10, 2003 8:17 pm

re:請問如何編譯新的kernel module

文章ricky » 週三 3月 24, 2004 12:38 pm

我在google找到下列的文章
apt-get install kernel-headers-2.4.20-3-686
apt-get install kernel-package
apt-get install lufs-source
cd /usr/src
tar xzf lufs.tar.gz
cd kernel-headers-2.4.20-3-686
make-kpkg --added-modules lufs modules_image
cd ..
dpkg -i lufs*.deb


請問跟用dpkg-buildpackage有什麼差別

不過,即使最後用dpkg -i lufs*.deb
安裝完後,在進行mount時一樣不行
mount failed: No such device
you don't have kernel lufs support (check whether the lufs module is available/loaded)


請問還有什麼方法嗎????

---
http://lufs.sourceforge.net/lufs/install.html
這是官方的網站,裡面有一個做kernel patch的...
以前沒這個經驗,麻煩高手指點一下
ricky
可愛的小學生
可愛的小學生
 
文章: 72
註冊時間: 週五 10月 10, 2003 8:17 pm

re:請問如何編譯新的kernel module

文章jeul » 週一 11月 08, 2004 3:09 pm

我剛裝了lufs, kernel module用module-assistant來compile/install可以順利使用
jeul
可愛的小學生
可愛的小學生
 
文章: 13
註冊時間: 週三 10月 27, 2004 8:19 am


回到 debian misc

誰在線上

正在瀏覽這個版面的使用者:沒有註冊會員 和 1 位訪客