Linux移植随笔:git的使用


搞了一天的yaffs2文件系统挂载,结果还是挂载不上去。收获之一是知道如何使用git下载源代码。

以前下载的yaffs2源代码在新的内核中编译不通过,而又不知道如何下载yaffs2的源代码包,只好使用git来下载了。开始是在windows下安装一个git客户端,可以下载。但是源代码及脚本文件的格式全部变成DOS格式的,在内核中不能使用,尤其是脚本文件,因为两个系统对回车换行的理解是不同的。没办法,只能在linux平台下下载源代码了。这里记录一下。

git源代码在这里,我下载的是git-1.7.2.tar.gz,当然,也有更新的版本。

下面是安装过程:

1、解压:
$ tar zxf git-1.7.2.tar.gz
2、配置:
$ ./configure --prefix=/usr/local/
3、编译:
$ make
4、安装:
# make install

# which git
/usr/local/bin/git

这里在命令行下输入git会出现许多有用的信息,大意是解释一些常用命令。此处只使用了clone命令,相当于SVN的checkout。

下面通过git来下载yaffs2源代码:

下载yaffs2:
$ git clone git://www.aleph1.co.uk/yaffs2
Cloning into yaffs2...
remote: Counting objects: 6505, done.
remote: Compressing objects: 100% (3794/3794), done.
remote: Total 6505 (delta 5171), reused 3402 (delta 2642)
Receiving objects: 100% (6505/6505), 3.32 MiB | 10 KiB/s, done.
Resolving deltas: 100% (5171/5171), done.

新的源代码的内核补丁文件多了一个选项:m/s。

$ ./patch-ker.sh c s ~/arm-project/linux-2.6.37.3  
 
*** Warning ***  
You have chosen to use the single kernel variant of the yaffs VFS glue code  
that only works with the latest Linux kernel tree. If you are using an older  
version of Linux then you probably wanted to use the multi-version variant by  
re-running the patch-ker.sh script using m as a the second argument. 

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/subfate/archive/2011/03/18/6257978.aspx

我见到有资料说新的内核要使用m选项,不过仔细看这些信息,发现新内核要使用s选项。使用新的yaffs2源代码,可以在新的内核版本中通过编译。

相关内容