2008年12月25日星期四

gst-ffmpeg

/home/gstreamer/gst-ffmpeg-0.10.6
./configure --host=arm-linux --prefix=/home/gstreamer/install --enable-shared CFLAGS=-I/home/gstreamer/install/include/ LDFLAGS="-L/home/gstreamer/install/lib -lbz2 -lamrwb -lamrnb" --with-ffmpeg-extra-configure="--prefix=/home/gstreamer/install --enable-cross-compile --enable-gpl --disable-network --disable-ipv6 --disable-vhook --disable-mpegaudio-hp --enable-pthreads --disable-parsers --arch=armv4l --disable-muxers --disable-encoders --disable-stripping --host-cc=arm-linux-gcc --disable-armv6 --disable-armv5te --disable-armvfp --disable-ffmpeg --enable-static --enable-shared --cross-prefix=/usr/local/arm/3.4.1/bin/arm-linux- ARCH_ARMV4L=y --enable-libamr-nb --enable-libamr-wb --enable-libxvid --enable-nonfree"

/home/gstreamer/amrnb-7.0.0.2
echo ac_cv_func_malloc_0_nonnull=yes >> arm.cache
echo ac_cv_file__bin_bash=yes >> arm.cache
./configure --host=arm-linux --prefix=/home/gstreamer/amrnb-7.0.0.2/../install --cache-file=arm.cache

/home/gstreamer/amrwb-7.0.0.3
echo ac_cv_func_malloc_0_nonnull=yes >> arm.cache
echo ac_cv_file__bin_bash=yes >> arm.cache
./configure --host=arm-linux --prefix=/home/gstreamer/amrwb-7.0.0.3/../install --cache-file=arm.cache

/home/gstreamer/xvidcore/build/generic
./configure --host=arm-linux --prefix=/home/gstreamer/install

How to install FFmpeg with MP3 and AMR support

http://www.mattiouz.com/blog/2007/07/02/how-to-install-ffmpeg-with-mp3-and-amr-support/

2008年12月20日星期六

编译gstreamer相关

把编译完的配置从config.log里拷出来,去掉双引号了,记得加上

gstreamer统一目录是/home/gstreamer,编译后统一安装在/home/gstreamer/install文件夹里,所以设置pkgconfig就只用设置一个地址
export PKG_CONFIG_LIBDIR=/home/gstreamer/install/lib/pkgconfig

然后开始编译
/home/gstreamer/gstreamer-0.10.21/

$ ./configure --disable-nls --disable-static --enable-binary-registry --disable-loadsave --with-html-dir=/tmp/dump --prefix=/home/gstreamer/gstreamer-0.10.21/../install --host=arm-linux LDFLAGS=-L/home/gstreamer/install/lib/ -L/home/gstreamer/install/lib/ -lglib-2.0 -lgio-2.0 -lgobject-2.0 -lgthread-2.0 -lgmodule-2.0 -lxml2 CFLAGS=-I/home/gstreamer/install/include/ -I/home/gstreamer/install/include/glib-2.0/ -I/home/gstreamer/install/lib/glib-2.0/include

/home/gstreamer/gst-plugins-base-0.10.21/
$ ./configure --host=arm-linux --prefix=/home/gstreamer/gst-plugins-base-0.10.21/../install --disable-static --with-html-dir=/tmp/dump CFLAGS=-I/home/gstreamer/install/lib/glib-2.0/include -I/home/gstreamer/install/include/glib-2.0 -I/home/gstreamer/install/include/liboil-0.3/liboil -I/home/gstreamer/install/include/gstreamer-0.10/gst -I/home/gstreamer/install/include/gio-unix-2.0/gio -I/home/gstreamer/install/include/libxml2/libxml LDFLAGS=-L/home/gstreamer/install/lib/ -L/home/gstreamer/install/lib/gstreamer-0.10 -L/home/gstreamer/install/lib/python2.5/site-packages --with-pkg-config-path=/home/gstreamer/install/lib/pkgconfig --disable-x --disable-xvideo --disable-xshm --disable-gnome_vfs --disable-cdparanoia --disable-libvisual --disable-alsa --disable-ogg --disable-oggtest --disable-pango --disable-vorbis --disable-vorbistest

/home/gstreamer/gst-plugins-good-0.10.11/
$ ./configure --host=arm-linux --prefix=/home/gstreamer/gst-plugins-good-0.10.11/../install --disable-nls --disable-static --with-html-dir=/tmp/dump --with-plugins=avi,qtdemux CFLAGS=-I/home/gstreamer/install/lib/glib-2.0/include -I/home/gstreamer/install/include/glib-2.0 -I/home/gstreamer/install/include/liboil-0.3/liboil -I/home/gstreamer/install/include/gstreamer-0.10/gst -I/home/gstreamer/install/include/gio-unix-2.0/gio -I/home/gstreamer/install/include/libxml2/libxml LDFLAGS=-L/home/gstreamer/install/lib/ -L/home/gstreamer/install/lib/gstreamer-0.10 -L/home/gstreamer/install/lib/python2.5/site-packages --disable-x --disable-xshm --disable-xvideo --disable-esd --disable-shout2

/home/gstreamer/gst-plugins-ugly-0.10.10/
$ ./configure --host=arm-linux --prefix=/home/gstreamer/gst-plugins-ugly-0.10.10/../install --disable-nls --disable-static --with-html-dir=/tmp/dump --with-plugins=asfdemux CFLAGS=-I/home/gstreamer/install/lib/glib-2.0/include -I/home/gstreamer/install/include/glib-2.0 -I/home/gstreamer/install/include/liboil-0.3/liboil -I/home/gstreamer/install/include/gstreamer-0.10/gst -I/home/gstreamer/install/include/gio-unix-2.0/gio -I/home/gstreamer/install/include/libxml2/libxml LDFLAGS=-L/home/gstreamer/install/lib/ -L/home/gstreamer/install/lib/gstreamer-0.10 -L/home/gstreamer/install/lib/python2.5/site-packages

/home/gstreamer/gst-plugins-bad-0.10.9/
$ ./configure --host=arm-linux --prefix=/home/gstreamer/gst-plugins-bad-0.10.9/../install CFLAGS=-I/home/gstreamer/install/lib/glib-2.0/include -I/home/gstreamer/install/include/glib-2.0 -I/home/gstreamer/install/include/liboil-0.3/liboil -I/home/gstreamer/install/include/gstreamer-0.10/gst -I/home/gstreamer/install/include/gio-unix-2.0/gio -I/home/gstreamer/install/include/libxml2/libxml LDFLAGS=-L/home/gstreamer/install/lib/ -L/home/gstreamer/install/lib/gstreamer-0.10 -L/home/gstreamer/install/lib/python2.5/site-packages --disable-nls --disable-static --with-html-dir=/tmp/dump --disable-apexsink --disable-sdl

/home/gstreamer/glib-2.18.3
$ ./configure --cache-file=arm.cache --host=arm-linux --prefix=/home/gstreamer/glib-2.18.3/install
arm.cache的内容在前面的文章里写了。家里用X86_64编译的,把posix那2个设置为no,可以编译过了。也没有WARNING提示了。

/home/gstreamer/libxml2-2.6.24/
$ ./configure --host=arm-linux --prefix=/home/gstreamer/libxml2-2.6.24/../install/

/home/gstreamer/liboil-0.3.15/
$ ./configure --host=arm-linux --prefix=/home/gstreamer/liboil-0.3.15/../install/ --disable-static --with-html-dir=/tmp/dump CFLAGS=-I/home/gstreamer/install/lib/glib-2.0/include -I/home/gstreamer/install/include/glib-2.0 LDFLAGS=-L/home/gstreamer/install/lib/
修改的configure文件在前面文章里写了

这里的编译都是不带额外的plugins,比如没有把mad加进去

运行时设置环境变量GST_PLUGINS_PATH为包含plugin的地址
在没有设置该环境变量时,运行/home/gstreamer/gstreamer-0.10.21/tests/examples/helloworld/.libs下的helloworld程序会报错:

# ./helloworld a
**
ERROR:helloworld.c:59:main: assertion failed: (filesrc)
Aborted

本来是件简单的事情,设置环境变量就行了,但是网上没搜到解决办法,加入了gstreamer的QQ群,也没人告诉我。有个人倒是算热心回答我问题,但是他觉得这里不应该出错,他不会在这里出错。那么他们怎么把有哪些plugin告诉gstreamer的?可能办法不一样吧。结果我找到一篇"GStreamer Plugin Writer's Guide(0.10.21.1)",Chapter 9. Building a Test Application才知道要设置GST_PLUGIN_PATH

2008年12月19日星期五

在fedora9 x86_64上编译arm qt2.2.0

系统:Fedora9 x86_64

1>下载cross-3.3.2.tar.bz2,并解压到/usr/local/arm/文件夹下,设置环境变量PATH
tar zjf cross-3.3.2.tar.bz2 -C /usr/local/arm/
export PATH=$PATH:/usr/local/arm/3.3.2/bin

2>建立目录armqt,设置环境变量
mkdir /home/armqt //arm qt根目录
export ARMQT=/home/armqt
mkdir $ARMQT/tools //arm库
mkdir $ARMQT/tools/lib //arm库lib
mkdir $ARMQT/tools/include //arm库include
mkdir $ARMQT/arm220 //编译arm qt
mkdir $ARMQT/qtopia //make install的路径,生成的qt及其库的文件系统文件夹

3>下载qtopia-free-src-2.2.0.tar.gz解压到$ARMQT/arm220,省掉下一级qtopia-free-2.2.0目录

4>下载arm需要的库,并解压到$ARMQT/tools下,并编译
A e2fsprogs-1.39.tar.gz

下载地址
http://nchc.dl.sourceforge.net/sourceforge/e2fsprogs/e2fsprogs-1.39.tar.gz

安装
./configure --host=arm-linux --enable-elf-shlibs --with-cc=arm-linux-gcc --with-linker=arm-linux-ld --prefix=/usr/local/arm/2.95.3/arm-linux
make
cp lib/libuuid.so* ../lib/

B jpegsrc.v6b.tar.gz

下载地址
http://down1.chinaunix.net/distfiles/jpegsrc.v6b.tar.gz

I 缺少libtool,下载
yum install libtool
cp /usr/share/libtool/config.guess /home/armqt/tools/jpeg-6b/ -rf
cp /usr/share/libtool/config.sub /home/armqt/tools/jpeg-6b/ -rf

II ./configure --enable-shared

III 修改Makfile,搜索到CC,AR,AR2宏替换为下面(如果是export CC=arm-linux-gcc,
在Makefile中虽然cc,ld等变了,但是ar,ranlib就没有改变)
CC=arm-linux-gcc
AR=arm-linux-ar rc
AR2=arm-linux-ranlib

IV make

V 拷贝库文件和头文件到统一目录
cp *.h ../include/
cp .libs/libjpeg.so* ../lib/

VI 可以用file看一下编译出来的是否是arm版本的及是否动态链接
[root@localhost jpeg-6b]# file wrjpgcom
wrjpgcom: ELF 32-bit LSB executable, ARM, version 1, dynamically linked (uses shared libs), for GNU/Linux 2.0.0, not stripped

C zlib-1.2.3.tar.bz2

下载地址
http://www.zlib.net/zlib-1.2.3.tar.gz

I ./configure -shared

II 修改Makfile,搜索到CC,LDSHARED,CPP,AR,RANLIB,prefix宏替换为下面
CC=arm-linux-gcc
CPP=arm-linux-gcc -E
LDSHARED=arm-linux-gcc -shared -Wl,-soname,libz.so.1
AR=arm-linux-ar rc
RANLIB=arm-linux-ranlib
prefix=/usr/local/arm/3.3.2/arm-linux

III make

IV 拷贝库文件和头文件到统一目录
cp libz.so* ../lib/
cp *.h ../include/

D libpng-1.2.14.tar.bz2

下载地址
http://superb-east.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.14.tar.bz2

I cp scripts/makefile.linux Makefile

II 修改Makfile,搜索到CC,AR,AR2,prefix,ZLIBLIB,ZLIBINC宏替换为下面
CC=arm-linux-gcc
AR=arm-linux-ar rc
AR2=arm-linux-ranlib
prefix=/usr/local/arm/3.3.2/arm-linux
ZLIBLIB=../lib
ZLIBINC=../include

III make

IV 拷贝库文件和头文件到统一目录
cp libpng12.so* ../lib/
cp libpng12.so ../lib/libpng.so
cp *.h ../include/

E uic-qt2

下载地址
http://vanille.de/tools/uic-qt2

chmod 777 uic-qt2
cp uic-qt2 $ARMQT/arm220/qt2/bin/uic

5>编译qt前的准备
A修改文件$ARMQT/arm220/qtopia/mkspecs/qws/linux-arm-g++/qmake.conf
chmod 777 $ARMQT/arm220/qtopia/mkspecs/qws/linux-arm-g++/qmake.conf

QMAKE_LIBS_QT = -lqte
改为
QMAKE_LIBS_QT = -lqte -lpng -lz -luuid -ljpeg

B修改文件$ARMQT/arm220/qtopia/src/qt/qconfig-qpe.h
chmod 777 $ARMQT/arm220/qtopia/src/qt/qconfig-qpe.h
添加到文件最后
#define QT_QWS_IPAQ
#define QT_QWS_IPAQ_RAW

C修改文件$ARMQT/arm220/qt2/include/qvaluestack.h
chmod 777 $ARMQT/arm220/qt2/include/qvaluestack.h
remove( this->fromLast() );
改为
this->remove( this->fromLast() );

D修改文件$ARMQT/arm220/qtopia/src/libraries/qtopia/qdawg.cpp
chmod 777 $ARMQT/arm220/qtopia/src/libraries/qtopia/qdawg.cpp
QDawgPrivate::~QDawgPrivate()
改为
~QDawgPrivate()

E
cp $ARMQT/arm220/qtopia/src/qt/qconfig-qpe.h $ARMQT/arm220/qt2/src/tools
cd $ARMQT/arm220/qtopia/src/libraries/qtopia
cp custom-linux-ipaq-g++.cpp custom-linux-arm-g++.cpp
cp custom-linux-ipaq-g++.h custom-linux-arm-g++.h

F编译时出现了qvfb错误,没搜到网上别人怎么做的,反正arm也用不上,所以干脆删了
rm $ARMQT/arm220/dqt/tools/qvfb -rf

G下面都是在编译时少什么就加什么库,先用yum whatprovides确定库名字,然后用yum install更新,感觉很不安全一样,我怕影响有些什么功能不能使用了.gcc -m32也就是32位编译了,不知道为什么更新后它自动加上了-m32,是自适应还是手动?

/*****
本来安装了这3个包,但是按照前2天在32位机上使用gcc32的做法(替换gcc,g++,lib)会出错,所以只好放弃,谁能告诉我怎样在x86_64上用i386 gcc32?
compat-gcc-32-3.2.3-47.3.i386.rpm
compat-gcc-32-c%2B%2B-3.2.3-47.3.i386.rpm
compat-libstdc++-33-3.2.3-63.i386.rpm
******/

I gcc少头文件和libc
yum whatprovides */gnu/stubs-32.h
yum install glibc-devel.i386

yum whatprovides */4.3.0/libstdc++.a
yum install libstdc++-devel.i386

II 编译时缺少的其他i386库
yum whatprovides */libXext.so
yum install libXext-devel.i386

yum whatprovides */libX11*
yum install libX11-devel.i386
yum install libX11.i386

yum whatprovides */libSM*
yum install libSM.i386
cd /usr/lib64
rm libSM.so -rf
ln -s ../lib/libSM.so.6 libSM.so

yum whatprovides */libICE*
yum install libICE-devel.i386

H 配置环境变量
export QPEDIR=$ARMQT/arm220/qtopia
export QTDIR=$ARMQT/arm220/qtopia
export QTDIR=$ARMQT/arm220/qt2
export LD_LIBRARY_PATH=$QTDIR/lib:$QPEDIR/lib:$LD_LIBRARY_PATH
export TMAKEDIR=$ARMQT/arm220/tmake
export TMAKEPATH=$TMAKEDIR/lib/qws/linux-arm-g++

6>配置及编译qt, 最好配置是手敲的,网上考下来的容易少空格,配置错了又要重编划不来
echo 'yes'|./configure -qte "-embedded -xplatform linux-arm-g++ -qconfig qpe -no-qvfb -depths 16,24 -system-jpeg -system-libpng -system-zlib -gif -thread -no-xft -release -I$ARMQT/tools/include -L$ARMQT/tools/lib -lpng -lz -luuid -ljpeg" -qpe "-xplatform linux-arm-g++ -edition pda -displaysize 320x240 -I$ARMQT/tools/include -L$ARMQT/tools/lib -prefix=$ARMQT/qtopia"

make
make install

总算编出来了

2008年12月18日星期四

liboil编译选项

下载地址是http://liboil.freedesktop.org/download/

./configure --host=arm-linux --prefix=$PWD/install GLIB_CFLAGS=-I/home/gongh/test/gstreamer/glib-2.18.3/install/include/ GLIB_LIBS=-L/home/gongh/test/gstreamer/glib-2.18.3/install/lib/ CFLAGS="-I/home/gongh/test/gstreamer/glib-2.18.3/install/lib/glib-2.0/include -I/home/gongh/test/gstreamer/glib-2.18.3/install/include/glib-2.0" LDFLAGS=-L/home/gongh/test/gstreamer/glib-2.18.3/install/lib/ --disable-static --with-html-dir=/tmp/dump

开始用的是liboil0.3.15一直不能编译通过,错误是
arm-linux-gcc -DHAVE_CONFIG_H -I. -I. -I../.. -Wall -D_BSD_SOURCE -D_GNU_SOURCE -I../.. -DOIL_ENABLE_UNSTABLE_API -mfpu=vfp -I/home/gongh/test/gstreamer/glib-2.18.3/install/lib/glib-2.0/include -I/home/gongh/test/gstreamer/glib-2.18.3/install/include/glib-2.0 -MT libarm_la-math_vfp.lo -MD -MP -MF .deps/libarm_la-math_vfp.Tpo -c math_vfp.c -fPIC -DPIC -o .libs/libarm_la-math_vfp.o
cc1: error: invalid option `fpu=vfp'
make[3]: *** [libarm_la-math_vfp.lo] Error 1
make[3]: Leaving directory `/home/gongh/test/gstreamer/liboil-0.3.15/liboil/arm'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/gongh/test/gstreamer/liboil-0.3.15/liboil'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/gongh/test/gstreamer/liboil-0.3.15'
make: *** [all] Error 2

然后我换成了0.3.12版本居然过了。

但是0.3.12版本不能满足gstreamer 最低0.3.14要求。
再编译0.3.15,注释configure16617行,
#VFP_CFLAGS="$VFP_CFLAGS -mfpu=vfp"
这样是可以编译过,但这样会不会有什么问题?

gstreamer编译选项

另外下载了flex-2.5.35.tar.gz编译后替换了/usr/bin/flex,不然gstreamer-0.10.21配置检查flex版本过不了,即使修改configure中flex版本让老版本的去编译,也通过不了,确实还是需要高版本的flex才行

GLIB_CFLAGS=-I/home/gongh/test/gstreamer/glib-2.18.3/install/include/glib-2.0/ GLIB_LIBS=-L/home/gongh/test/gstreamer/glib-2.18.3/install/lib/ XML_LIBS=-L/home/gongh/test/gstreamer/libxml2-2.6.30/install/lib/ XML_CFLAGS=-I/home/gongh/test/gstreamer/libxml2-2.6.30/install/include/ ./configure --disable-nls --disable-static --enable-binary-registry --disable-loadsave --with-html-dir=/tmp/dump --prefix=$PWD/install --host=arm-linux LDFLAGS="-L/home/gongh/test/gstreamer/libxml2-2.6.30/install/lib/ -L/home/gongh/test/gstreamer/glib-2.18.3/install/lib/ -lglib-2.0 -lgio-2.0 -lgobject-2.0 -lgthread-2.0 -lgmodule-2.0" CFLAGS="-I/home/gongh/test/gstreamer/libxml2-2.6.30/install/include/ -I/home/gongh/test/gstreamer/glib-2.18.3/install/include/glib-2.0/ -I/home/gongh/test/gstreamer/glib-2.18.3/install/lib/glib-2.0/include" GLIB_ONLY_CFLAGS=-I/home/gongh/test/gstreamer/glib-2.18.3/install/include/glib-2.0/ GLIB_ONLY_LIBS=-L/home/gongh/test/gstreamer/glib-2.18.3/install/lib/

2008年12月17日星期三

交叉编译glib 2.18.3

现在版本是glib-2.18.3,编译器arm-linux 3.4.1

我用FC4编译的,有点老,在configure的时候说pkg-config版本太老了,至少要0.16版本的,而FC4是0.15版本,所以我把configure改了.新linux应该不用改吧
7600 if $PKG_CONFIG --atleast-pkgconfig-version 0.16 ; then
改成了
7600 if $PKG_CONFIG --atleast-pkgconfig-version 0.15 ; then

然后参考一篇很有用的howto
http://library.gnome.org/devel/glib/unstable/glib-cross-compiling.html
需要写一个cache文件arm.cache,且我在当前目录下建立了一个install文件夹,存放make install后的库等。配置是
./configure --cache-file=arm.cache --host=arm-linux --prefix=$PWD/install

编译时如果出现错误,就看错误是什么,根据howto添加,我编译时最少添加如下几项后就能配置通过,然后就编译通过了。以下是arm.cache的内容。
glib_cv_long_long_format=ll
glib_cv_stack_grows=no
glib_cv_uscore=no
ac_cv_func_posix_getpwuid_r=yes
ac_cv_func_posix_getgrgid_r=yes

当配置成功后arm.cache内容就变了

2008年12月11日星期四

MPlayer-1.0rc2编译选项

--target=arm-linux --prefix=install --cc=/usr/local/arm/gcc-3.4.5-glibc-2.3.6/arm-softfloat-linux-gnu/bin/arm-softfloat-linux-gnu-gcc --enable-fbdev --disable-win32dll --disable-dvdread --disable-network --enable-menu --disable-ftp --disable-alsa --enable-ossaudio --disable-tv --disable-x11 --enable-cross-compile --target=arm-linux --host-cc=gcc --disable-armv5te --disable-armv6 --language=en --enable-debug

可以跑,不过mp3没声音,所以一会加个mad上去
加上了,要make clean后再make,不然链接有错误
./configure --target=arm-linux --prefix=install --cc=/usr/local/arm/gcc-3.4.5-glibc-2.3.6/arm-softfloat-linux-gnu/bin/arm-softfloat-linux-gnu-gcc --enable-fbdev --disable-win32dll --disable-dvdread --disable-network --enable-menu --disable-ftp --disable-alsa --enable-ossaudio --disable-tv --disable-x11 --enable-cross-compile --target=arm-linux --host-cc=gcc --disable-armv5te --disable-armv6 --language=en --enable-debug --enable-mad --with-extraincdir=/home/gongh/test/libmad-0.15.1b/install/include --with-extralibdir=/home/gongh/test/libmad-0.15.1b/install/lib --disable-mp3lib

可以播mp3了

但是播放avi时还是会音视频不同步,加autosync后,视频虽然和音频打印同步了,但是其实CPU速度就是不够,声音还是走在视频前面

2008年11月27日星期四

uda1341在2.6.27 2440

直接用的网上的patch,虽然patch的时候稍微有一点差别,造成*.orig, *.prej,但是改一下就好了,把patch地址给出来。连续4页

[PATCH RESEND 0/3] ALSA SOC driver for s3c24xx with uda134x

http://www.spinics.net/lists/arm-kernel/msg58298.html

http://www.spinics.net/lists/arm-kernel/msg58299.html

http://www.spinics.net/lists/arm-kernel/msg58300.html

http://www.spinics.net/lists/arm-kernel/msg58301.html

记录一下今天上午看的mmc代码(2.6.27)

S3C2440板子。先统计一下编译了哪些文件,分别是

card/
block.o queue.o
host/
s3cmci.o
core/
bus.o core.o host.o
及sd,mmc,sdio 3种规范的相关文件:
sd: sd.o sd_ops.o
mmc: mmc.o mmc_ops.o
sdio: sdio.o sdio_ops.o sdio_bus.o sdio_cis.o sdio_io.o sdio_irq.o

看别人写的抄下来的流程:
1. 内核启动initcall ==>> mmc_init() ==>> mmc_blk_init()
2. xx_mmc_probe 检测挂在的设备
3. 起延时任务mmc_rescan()对卡初始化
4. mmc_attach_sd(),mmc_attach_mmc(),mmc_attach_sdio()加载设备
5. mmc_add_card()

6.卡加入系统后,mmc_blk_probe()分配mmc_blk_data结构变量
7.mmc_init_queue()初始化
8.建立线程mmc_queue_thread(),接受块设备读写请求并处理

然后看代码把每个文件做的事写一下,有点乱
s3cmci.c
注册s3c2410,2412,2440平台驱动
mmc_alloc_host
硬件初始化,注册中断
mmc->ops = &s3cmci_ops 结构成员函数有request,set_ios,get_ro,get_cd
中断函数s3cmci_irq()完成读写,中断中起tasklet即pio_tasklet(),再区分为do_pio_read(),do_pio_write()

block.c
注册块设备,主设备号179,向mmc_driver注册驱动
mmc_blk_probe()==>>mmc_blk_alloc()==>>mmc_init_queue()在此函数中起线程.线程函数是queue.c中的mmc_queue_thread()
在 线程中根据blk_queue_plugged()判断队列是否有插入,取得elv_next_request()的返回值struct request*,调用mq->issue_fn函数即block.c的mmc_blk_issue_irq()处理,在 mmc_wait_for_req()函数种把请求传给host->ops->request,即s3cmci_ops中的request结 构成员函数

bus.c
struct mmc_card结构相关
提供函数alloc card(),add_card(), 在add_card()中调用device_add()添加设备
向系统注册总线mmc_bus_type
把block.c注册过来的mmc_driver注册为系统的驱动

core.c
mmc_rescan()分辨检测卡
mmc_init()起工作队列,初始检测及热插拔时detect用
调用注册总线,注册class

host.c
与s3cmci.c相关联的文件,找到设备前先假设有设备,mmc_alloc_host()起工作队列mmc_rescan()检测设备,未检测到释放host,检测到了调用device_add添加设备

只看mmc规范
mmc.c
mmc_rescan中找到卡后调用mmc_attach_mmc初始化卡,提供detect函数每次检测卡是否拔出

mmc_ops.c
mmc的具体命令,比如go_idle(),send_cid()等

分辨sdio,mmc,sd卡,通过发命令,具体命令我不确定
发送cmd5,如果有响应就是sdio,没响应就往下走
发送cmd1,如果有响应就是mmc,如果没响应就是sd

卡插入中断后的处理:
s3cmci,c中的s3cmci_irq_cd()==>>mmc_detect_change()==>>host->detect()==>>mmc_detect()
这里的s3cmci_irq_cd()是sd卡插入检测脚cd的中断处理函数

mmc/sd 在 2.6.27 2440

让板子能识别热插拔的卡。正好手上MMC卡和SD卡都有,能用

1. 先加上sdi的platform_device, s3c_device_sdi
arch/arm/mach-s3c2440/mach-smdk2440.c
static struct platform_device *smdk2440_devices[] __initdata = {
&s3c_device_usb,
&s3c_device_lcd,
&s3c_device_wdt,
&s3c_device_i2c,
&s3c_device_iis,
//zhourr
&s3c_device_adc,
&s3c_device_sdi,
};

2. 添加自己板子特别的地方,比如卡接的中断脚,卡插入检测脚,卡写保护脚,检测和写保护脚的极性,提供的sd卡电压范围
static struct s3c24xx_mci_pdata s3cmci_def_pdata = {
/* This is currently here to avoid a number of if (host->pdata)
* checks. Any zero fields to ensure reaonable defaults are picked. */
//zhourr
.wprotect_invert = 0,
.detect_invert = 0,
.gpio_detect = S3C2410_GPG8,
.gpio_wprotect = S3C2410_GPH8,
.ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34,
.set_power = NULL,
};

此时MMC卡已经可以热插拔,并在dev下找到mmcblk0

# ls -l /dev/mmc*
brw-rw---- 1 0 0 179, 0 Jan 1 00:03 /dev/mmcblk0

但是SD卡系统启动前正常,热插拔插入时会有timeout错误
错误1:
s3c2440-sdi s3c2440-sdi: mci_setup_data() transfer stillin progress.
s3c2440-sdi s3c2440-sdi: CMDSTAT: error CMDTIMEOUT
s3c2440-sdi s3c2440-sdi: CMD[ERR -110] #47 op:6 arg:0x00fffff1 flags:0x08b5 retries:0 Status:nothing to complete
s3c2440-sdi s3c2440-sdi: DAT[OK] #4 bsize:64 blocks:1 bytes:64
s3c2440-sdi s3c2440-sdi: powered down.
mmc0: error -110 whilst initialising SD card

错误2:
s3c2440-sdi s3c2440-sdi: unfinished read - pio_count:[0] pio_words:[16]
s3c2440-sdi s3c2440-sdi: CMD[OK] #68 op:6 arg:0x00fffff1 flags:0x08b5 retries:0 R0:0x00000900
s3c2440-sdi s3c2440-sdi: DAT[ERR -22] #6 bsize:64 blocks:1 bytes:64 DCNT:0x00000000
mmc0: problem reading switch capabilities, performance might suffer.

3.解决SD插入错误-->加延时
driver/mmc/core/sd.c 的mmc_sd_init_card()函数中mmc_read_switch前延时10ms

mdelay(10);

err = mmc_read_switch(card);

查看插入后的设备
# ls -l /dev/mmc*
brw-rw---- 1 0 0 179, 0 Jan 1 00:04 /dev/mmcblk0
brw-rw---- 1 0 0 179, 1 Jan 1 00:04 /dev/mmcblk0p1

mount后使用卡,可读写
# mount -t vfat /dev/mmcblk0p1 /opt/

写完后自己sync一下,确保写进去了,PC上就可以看到了


4.有个问题:
如果拔出太快又插入,现在会当作只拔出了。还不清楚MMC里怎么做的,要看一下了

2008年11月26日星期三

cs8900在2440 linux2.6.27

driver/net/cs89x0.c

1.修改ioaddr和irq,接CS3,addr24选择io或memory方式,irq是EINT9,GPG1,写网卡MAC地址
#include "../../arch/arm/mach-s3c2410/include/mach/map.h"
#include "../../arch/arm/mach-s3c2410/include/mach/regs-mem.h"
#include "../../arch/arm/mach-s3c2410/include/mach/regs-gpio.h"
#include "../../arch/arm/mach-s3c2410/include/mach/regs-irq.h"
static unsigned int netcard_portlist[] __used __initdata = { S3C24XX_VA_CS8900_CS3 + 0x300, 0};
static unsigned int cs8900_irq_map[] = {IRQ_EINT9,0,0,0};

2.添加2440硬件初始化函数
static void cs89x0_hw_setup(struct net_device *dev)
{
unsigned int regval = 0;

//CS3, 16 bit bus width
__raw_writel(0x2211d110,S3C2410_BWSCON);
__raw_writel(0x1f7c,S3C2410_BANKCON3);

//EINT[9]
regval = __raw_readl(S3C2410_GPGCON);
regval &= ~(3<<2);
regval |= 2 <<2;
__raw_writel(regval, S3C2410_GPGCON);

//irq mode
regval = __raw_readl(S3C2410_EXTINT1);
regval &= ~(7<<4);
regval |= 4 <<4;
__raw_writel(regval, S3C2410_EXTINT1);

//irq MASK
regval = __raw_readl(S3C2410_EINTMASK);
regval &= ~(1<<9);
__raw_writel(regval, S3C2410_EINTMASK);

//mac addr
dev->dev_addr[0] = 0x00;
dev->dev_addr[1] = 0x00;
dev->dev_addr[2] = 0xc0;
dev->dev_addr[3] = 0xff;
dev->dev_addr[4] = 0xee;
dev->dev_addr[5] = 0x08;

printk("[cs89x0_probe] S3C2410_BWSCON = %x\r\n", __raw_readl(S3C2410_BWSCON));
printk("[cs89x0_probe] S3C2410_BANKCON3 = %x\r\n", __raw_readl(S3C2410_BANKCON3));
printk("[cs89x0_probe] S3C2410_GPGCON = %x\r\n", __raw_readl(S3C2410_GPGCON));
printk("[cs89x0_probe] S3C2410_EXTINT1 = %x\r\n", __raw_readl(S3C2410_EXTINT1));
printk("[cs89x0_probe] S3C2410_EINTMASK = %x\r\n", __raw_readl(S3C2410_EINTMASK));
printk("[cs89x0_probe] MAC ADDR: %x-%x-%x-%x-%x-%x\r\n",
dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);

}

3.在cs89x0_probe里调用cs89x0_hw_setup函数

cs89x0_hw_setup(dev);

if (net_debug)
printk("cs89x0:cs89x0_probe(0x%x)\n", io);

4.修改readword,writeword函数,portno不需要左移(我现在怎么看着不需要了啊,好像else里的也没有左移)

static u16
readword(unsigned long base_addr, int portno)
{
return __raw_readw(base_addr+portno);
}

static void
writeword(unsigned long base_addr, int portno,u16 value)
{
__raw_writew(value,base_addr+portno);
}

5.设置网口RJ45,省去boot启动时带参数
lp->force = g_cs89x0_media__force;
改成
lp->force=FORCE_RJ45;

6.注释掉irq_map的安全检查
#if 0
if (((1 <<>irq) & lp->irq_map) == 0) {
printk(KERN_ERR "%s: IRQ %d is not in our map of allowable IRQs, which is %x\n",
dev->name, dev->irq, lp->irq_map);
ret = -EAGAIN;
goto bad_out;
}
#endif

7.2440初始化时增加分配cs8900的io port,修改mach-smdk2440.c

static struct map_desc smdk2440_iodesc[] __initdata = {
/* ISA IO Space map (memory space selected by A24) */

{
.virtual = (u32)S3C24XX_VA_ISA_WORD,
.pfn = __phys_to_pfn(S3C2410_CS2),
.length = 0x10000,
.type = MT_DEVICE,
}, {
.virtual = (u32)S3C24XX_VA_ISA_WORD + 0x10000,
.pfn = __phys_to_pfn(S3C2410_CS2 + (1<<24)),
.length = SZ_4M,
.type = MT_DEVICE,
}, {
.virtual = (u32)S3C24XX_VA_ISA_BYTE,
.pfn = __phys_to_pfn(S3C2410_CS2),
.length = 0x10000,
.type = MT_DEVICE,
}, {
.virtual = (u32)S3C24XX_VA_ISA_BYTE + 0x10000,
.pfn = __phys_to_pfn(S3C2410_CS2 + (1<<24)),
.length = SZ_4M,
.type = MT_DEVICE,
}, { //zhourr
.virtual = (u32)S3C24XX_VA_CS8900_CS3,
.pfn = __phys_to_pfn(S3C2410_CS3 + (1<<24)),
.length = SZ_1M,
.type = MT_DEVICE,
}
};

8.在arch/arm/mach-s3c2410/include/mach/map.h增加宏定义,跟别的不冲突就行了
#define S3C24XX_VA_CS8900_CS3 S3C2410_ADDR(0x04000000)

2008年11月20日星期四

sh下运行#!/bin/bash开头的脚本会返回not found

inittab脚本:
::sysinit:/etc/rc.sysinit
::respawn:-/bin/sh
::once:/bin/mount -a
::restart:/sbin/init
::ctrlaltdel:/sbin/reboot
::shutdown:/bin/umount -a -r
::shutdown

我在/etc/inittab里想执行/etc/rc.sysinit脚本失败,提示是:
cannot run '/etc/rc.sysinit': No such file or directory

单独在sh里敲提示not found
# /etc/rc.sysinit
-/bin/sh: /etc/rc.sysinit: not found

但是source就可以执行
# source /etc/rc.sysinit
starting udevd...

我以为是没有执行属性,还是不行
chmod 777 /etc/rc.sysinit

网上说sh /etc/rc.sysinit,我就改inittab第一行为:
::sysinit:/bin/sh /etc/rc.sysinit
这样脚本就可以执行了,

但是脚本里udevd失败,报错:
starting udevd...
udevd[824]: main: error disabling OOM: No such file or directory

后来发现我的rc.sysinit脚本前用的是#!/bin/bash,改为#!/bin/sh,又把inittab第一行恢复原样
这样rc.sysinit就可以找到并执行了

但是udevd还是报错,根据启动打印sysinit第一个执行,我想把它放到mount -a的后面,于是把第一行放到了第三行后面
::respawn:-/bin/sh
::once:/bin/mount -a
::sysinit:/etc/rc.sysinit
::restart:/sbin/init
::ctrlaltdel:/sbin/reboot
::shutdown:/bin/umount -a -r
::shutdown
但是它还是第一个执行

我猜是::sysinit:使它第一个执行的,改为::once:
udevd就好了

2008年11月17日星期一

2440 2.6.27启动后主频405Mhz却打印出来是571Mhz

2.6.27
网上有人一样是启动时乱码,他说修改时钟频率为12M就可以了,我的板子本来就是12M晶振
我是临时通过屏蔽内核串口设置来去掉乱码的,下面有正确做法
drivers/serial/samsung.c中8个wr_regl 函数屏蔽掉
core 571.536 MHz,确实是主时钟错了,有点离谱,bootloader里的时钟是405M,启动后不修改uart设置,能正常显示打印,说明这时时钟还是405MHZ。虽然是主频导致uart计算波特率的divider出错导致的乱码,但是为什么会到571Mhz呢?

这样我启动后看到的打印是:
enter Main
cp15 register 1 = c000107c
************************************
* *
* 2440 bootloader *
* Nov 17 2008,11:22:08 *
* *
************************************
Read chip id = ec76
Nand flash status = c0
NAND_Read addr : 40000, size : 1c0000
................................................................................................................Uncompressing Linux.................................................................................................................. done, booting the kernel.
Linux version 2.6.27 (root@sherman_samba) (gcc version 3.4.1) #4 Tue Nov 18 11:51:27 CST 2008
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
Machine: SMDK2440
ATAG_INITRD is deprecated; please update your bootloader.
Memory policy: ECC disabled, Data cache writeback
CPU S3C2440A (id 0x32440001)
S3C244X: core 571.536 MHz, memory 142.884 MHz, peripheral 71.442 MHz
S3C24XX Clocks, (c) 2004 Simtec Electronics
CLOCK: Slow mode (2.116 MHz), fast, MPLL on, UPLL on
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
Kernel command line: noinitrd root=/dev/mtdblock2 init=/linuxrc console=ttySAC0,115200
irq: clearing subpending status 00000092
PID hash table entries: 256 (order: 8, 1024 bytes)
timer tcon=00000000, tcnt e88e, tcfg 00000200,00000000, usec 00001580
Console: colour dummy device 80x30
console [ttySAC0] enabled
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 61120KB available (3256K code, 322K data, 144K init)
Calibrating delay loop... 285.08 BogoMIPS (lpj=712704)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 440 bytes
NET: Registered protocol family 16
S3C2410 Power Management, (c) 2004 Simtec Electronics
S3C2440: Initialising architecture
S3C2440: IRQ Support
S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics
DMA channel 0 at c4800000, irq 33
DMA channel 1 at c4800040, irq 34
DMA channel 2 at c4800080, irq 35
DMA channel 3 at c48000c0, irq 36
S3C244X: Clock Support, DVS off
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NET: Registered protocol family 1
NetWinder Floating Point Emulator V0.97 (extended precision)
JFFS2 version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc.
msgmni has been set to 119
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
Console: switching to colour frame buffer device 30x40
fb0: s3c2410fb frame buffer device
lp: driver loaded but no devices found
ppdev: user-space parallel port driver
Serial: 8250/16550 driver4 ports, IRQ sharing enabled
s3c2440-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440
s3c2440-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440
s3c2440-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440
brd: module loaded
loop: module loaded
dm9000 Ethernet Driver, V1.31
Uniform Multi-Platform E-IDE driver
Driver 'sd' needs updating - please use bus_type methods
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
60 ns is too big for current clock rate 142884
s3c2440-nand s3c2440-nand: cannot get suitable timings
s3c2440-nand: probe of s3c2440-nand failed with error -22
usbmon: debugfs is not available
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
usbcore: registered new interface driver libusual
usbcore: registered new interface driver usbserial
usbserial: USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
usbserial: USB Serial support registered for FTDI USB Serial Device
usbcore: registered new interface driver ftdi_sio
ftdi_sio: v1.4.3:USB FTDI Serial Converters Driver
usbserial: USB Serial support registered for pl2303
usbcore: registered new interface driver pl2303
pl2303: Prolific PL2303 USB to serial adaptor driver
mice: PS/2 mouse device common for all mice
S3C24XX RTC, (c) 2004,2006 Simtec Electronics
s3c2440-i2c s3c2440-i2c: slave address 0x10
s3c2440-i2c s3c2440-i2c: bus frequency set to 372 KHz
s3c2440-i2c s3c2440-i2c: i2c-0: S3C I2C adapter
S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
s3c2410-wdt s3c2410-wdt: watchdog inactive, reset disabled, irq enabled
TCP cubic registered
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
Root-NFS: No NFS server available, giving up.
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "mtdblock2" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available partitions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
========================
时钟不对,连nand都不能正常操作
------->>>>
s3c244x.c s3c244x_init_clocks
------->>>>
cpu.c static struct cpu_table cpu_ids[] __initdata
------->>>>
cpu.c s3c24xx_init_clocks
------->>>>
mach-smdk2440.c smdk2440_map_io
该函数中带了时钟输入参数
s3c24xx_init_clocks(16934400);
因为我们用的晶振是12M的,所以需要改成下面这样
s3c24xx_init_clocks(12000000);

这样串口也正常了,时钟也对了,nand也对了

2008年11月13日星期四

动态中断向量

ResetEntry
b ResetHandler
b Undefined_Handler
b SWI_Handler
b Prefetch_Handler
b Abort_Handler
nop
ldr pc, =0x300ffffc
b FIQ_Handler

//0x18 = jump to 0x300ffffc
//0x300ffffc = jump to IsrHandler
//b arm, ea000006 = 6 <<2 +8 + pc
//b code, (dst - src -8) >>2 +0xea000000
void RegInterrupteHandlerTable(void)
{
unsigned long dest_addr = (unsigned long)IsrHandler;
unsigned long offset_addr ;
unsigned long *pIrqHandler = (unsigned long *)0x300ffffc;

offset_addr = (((dest_addr - (unsigned long)pIrqHandler - 8)) >> 2)&0xffffff;

*pIrqHandler = 0xea000000+offset_addr;
}

以前把整个表做重新做动态了,没必要,现在就修改irq这一条,而且思路比以前清晰

0x18地址存放的指令是 pc=0x300ffffc
0x300ffffc地址存放的指令是 b IsrHandler,是做出来的指令

拿一般第一条指令的机器码来说,一般是b resethandler
0地址机器码 :0xea000006
resethandler函数地址 0x20

0 + 6 << 2 +8 = 0x20,这样就会跳转到resethandler函数的地址了

2008年11月4日星期二

-/bin/sh: XXX: not found

# ./qpe
-/bin/sh: ./qpe: not found

shell找不到该文件,及刚启动完打印的找不到/etc/rc.sysinit文件同样的现象

网上有人说是busybox静态编译改成动态编译就可以了,我改了,真的可以了
库文件当然用的是编译器里的*.so文件拷贝到根文件系统/lib下

在Fedora7上编译qtopia-2.2.0 x86版

1>下载gcc32编译器
http://d.download.csdn.net/down/382229/morre
compat-gcc-32-3.2.3-47.3.i386.rpm

http://d.download.csdn.net/down/382235/morre
compat-gcc-32-c++-3.2.3-47.3.i386.rpm

当时没有用rpm命令行安装,是firefox下载后点“打开”,弹出更新软件,点“应用”这样装的
应该怎么安装都行吧。安装完后,出现/usr/bin/gcc32等。有人说改Makefile或设置CC环境变量,我觉得可能会改不全,所以换gcc,下面这样改不确定对不对,不过以前gcc4.1.2编不过的现在可以编过了

//替换gcc
mv /usr/bin/gcc /usr/bin/gccbak
mv /usr/bin/gcc32 /usr/bin/gcc

//替换g++
mv /usr/bin/g++ /usr/bin/g++bak
mv /usr/bin/g++32 /usr/bin/g++

//替换libc
cp /usr/lib/gcc/i386-redhat-linux/4.1.2 /usr/lib/gcc/i386-redhat-linux/4.1.2bak -rf
cp /usr/lib/gcc-lib/i386-redhat-linux/3.2.3 /* /usr/lib/gcc/i386-redhat-linux/4.1.2/ -rf

2>下载freetype2.1.10
http://download.chinaunix.net/download.php?id=6228&ResourceID=3295
freetype-2.1.10.tar.bz2

解压后
./configure --prefix=/usr
make
make install
mv /usr/freetype2/freetype /usr/freetype2/freetypebak //不用以前的freetype 头文件
cp freetype-2.1.10/include/freetype /usr/freetype2/ -rf //既然只是新的头文件,那么是不是不用编译呢?

3>编译qtopia-2.2.0
./configure
make
make install

4>跑demo
. setQpeEnv
qtopia/bin/startdemo

2008年11月1日星期六

删除libstdc++后缺少libstdc++.so.6库导致很多命令执行不了

fedora7想把gcc4.1.2替换成gcc3.2.2, 所以下载了cpp-3.2.2-5.i386.rpm, gcc-3.2.2-5.i386.rpm等包,但在安装时提示已经有更新的版本,所以先删除新版本再装旧版本,更换cpp和gcc时未出问题,更换libstdc++出问题了
rpm -e --nodeps libstdc++-4.1.2-12
rpm: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

rpm -ivh libstdc++-4.1.2-12.i386.rpm
即使再执行rpm把libstdc++安装回来也不行, 因为rpm命令本身需要libstdc++.so.6库, 我有libstdc++.so.5, ln -s不可行。yum install也不能执行了

所以我到另一台机子考了一个libstdc++.so.6过来,放到/usr/lib/下,至少rpm,yum之类的可以用了,再看怎么换gcc,那台考libstdc++.so.6的机子少另一个gcc库,进不了X,都是被我换gcc搞的

2008年10月29日星期三

解决e2fsck版本太低造成的不能启动的问题:fsck.ext3:Filesystem has unsupported feature(s)

我也遇到了这个问题,到网上搜到的下面这个帖子:

转载请注明原创出处:HateMath的网上田园(http://blog.vckbase.com/hatemath/

1. 症状

PC上已经已装有Fedora 4,出于开发需要又装Red ha t 9.
FC4(hda7) & RH9(hda6) 都是ext3 文件格式.
装好后配置启动菜单,然后重启进FC4,正常进入,再重启进RH9,也正常进入.

开始配置RH9,什么系统、网络、程序、多媒体、等等、等等 - --麻烦啊.
折腾好了后,重启,出现错误:
........
checking root filesystem
fsck.ext3:filesystem has unsupported feature(s) (/12)
e2fsck:get a newer version of e2fsck!

2. 解决方法

将Fedora4中的 /sbin/e2fsck 文件拷贝到RedHat9的/sbin/目录下,覆盖原来的(最好备份一下)e2fsck 文件.
重启,一切恢复正常。

3. 探询原因
RedHat9中的e2fsck版本较低。

4.闲聊
你 看,解决方法好简单啊。可是你知道吗,我搞了3个多小时。用关键词“fsck.ext3:Filesystem has unsupported feature(s) ”google到的70多个外文网页,找了几个没合适的,中文的没有。所以,这下你理解我为什么用它做随笔的标题了吧。希望对别人有用。

(完)

======================================

但是我的fc4不在真实物理盘里,是vmware直接打开vmx文件,我在出错后命令行里看到的sda也只看到了它自己的,在根目录下也只搜索到了/sbin/e2fsck,不知道用哪个来替换了。
所以从启动脚本开始出发。看/etc/rc.d/rc.sysinit,在busybox里init命令调用到/etc/inittab会调用到/etc/rc.d/rc.sysinit,在里面搜索fsck的命令在哪里调用,既然是e2fsck版本的问题,只是检查文件系统有没有坏,那么我不要这条了,反正如果e2fsck检查出坏了也只是提示出错,没坏检查不检查不都差不多吗,或者先去掉sysinit里fsck部分,让桌面启动起来,再下载替换掉fsck命令也应该是可以的。

所以我注释了/etc/rc.d/rc.sysinit 第387-429行,也就是执行了fsck命令,但是不处理它的返回值,问题就解决了。
修改脚本前需要把根文件系统设置为rw,不然是readonly
mount -o remount,rw /
修改完后重启

我不明白为什么非物理盘安装的ubuntu会影响到非物理盘安装的FC4
========================================
xiaoshe说看不明白我写的,所以修改一下再写到下面,上面的也不想删了,照别人的板书写

1.症状
PC上用vmware装了FC4,后来又装了一个ubuntu8.04,当我用vmware打开ubuntu以后,以后在想打开FC4就在启动时提示以下错误:
checking root filesystem
fsck.ext3:filesystem has unsupported feature(s) (/12)
e2fsck:get a newer version of e2fsck!

2.解决办法
@ 网上找的办法: HateMath的网上田园(http://blog.vckbase.com/hatemath/)
将Fedora4中的 /sbin/e2fsck 文件拷贝到RedHat9的/sbin/目录下,覆盖原来的(最好备份一下)e2fsck 文件.
重启,一切恢复正常。

@我的办法:
将根文件系统修改为可读写的
mount -o remount,rw /
注释/etc/rc.d/rc.sysinit第387-429行

3. 探询原因
@ 网上找的原因: HateMath的网上田园(http://blog.vckbase.com/hatemath/)
RedHat9中的e2fsck版本较低。
@我的原因:e2fsck如果版本低就不启动

4.思考过程
既然是e2fsck版本的问题,只是检查文件系统有没有坏,那么我不要这条了,反正如果e2fsck检查出坏了也只是提示出错启动失败,没坏检查不检查不都差不多吗,所以我注释了/etc/rc.d/rc.sysinit 第387-429行,也就是执行了fsck命令,但是不处理它的返回值,问题就解决了

2008年10月27日星期一

安装了suse-linux11.0-dvd-x86_64

dvd我以为很全呢,4.3G,结果make都找不到命令,gcc估计都没有
然后从windows用vmware启动suse,结果在找硬盘处出错,网上有类似现象,by-id找不到,修改fstab不起作用,因为在fstab前就已经出错了,/dev下无sda*设备
我就又下载了fedora9,装3系统,真废时间

suse我觉得挺漂亮的,就是不会用,比fedora难操作

2008年10月24日星期五

编译busybox1.12.1和uboot1.1.6

原本编译器是arm-linux-3.4.1

下载uboot1.1.6后编译出错,网上说因为编译器不支持softfloat
lib_arm/libarm.a(_udivsi3.o)(.text+0x8c):/home/gongh/2440/u-boot-1.1.6/lib_arm/_udivsi3.S:67: relocation truncated to fit: R_ARM_PLT32 __div0
lib_arm/libarm.a(_umodsi3.o)(.text+0xa8):/home/gongh/2440/u-boot-1.1.6/lib_arm/_umodsi3.S:79: relocation truncated to fit: R_ARM_PLT32 __div0
make: *** [u-boot] Error 1

下载busybox1.12.1后编译出错,一般我都是哪个命令出错就去掉哪个命令,有inotifyd,taskset,然后是networking/interface.c出错,网络功能不能去掉,所以这个必须要编译过,这时我脑子是呆的,把uboot的softfloat对应到了busybox编译不过,所以我打算做一个交叉编译工具
networking/interface.c:818: error: `ARPHRD_INFINIBAND' undeclared here (not in a function)
networking/interface.c:818: error: initializer element is not constant
networking/interface.c:818: error: (near initialization for `ib_hwtype.type')
networking/interface.c:818: error: `ARPHRD_INFINIBAND' undeclared here (not in a function)
networking/interface.c:818: error: initializer element is not constant
networking/interface.c:818: error: (near initialization for `ib_hwtype.type')

下载crosstool-0.43
http://kegel.com/crosstool/crosstool-0.43.tar.gz

1>用非root用户登录,如果以root登录会提示这样太危险
2>建立目录/opt/crosstool,修改属性,编译时会建立这个目录,需要有权限
sudo mkdir /opt/crosstool
sudo chown $USER /opt/crosstool
3>./demo-arm-softfloat.sh,下载需要的源码并编译,虚拟机花了100分钟

然后用新的编译器gcc-3.4.5-glibc-2.3.6编译busybox的network就通过了,uboot1.1.6也通过了