Chinaunix首页 | 论坛 | 博客
  • 博客访问: 420978
  • 博文数量: 32
  • 博客积分: 1843
  • 博客等级: 上尉
  • 技术积分: 634
  • 用 户 组: 普通用户
  • 注册时间: 2008-08-25 14:30
个人简介

Nothing is impossible

文章分类

全部博文(32)

文章存档

2013年(4)

2012年(13)

2011年(6)

2008年(9)

分类: LINUX

2008-08-26 16:49:46


资源:
arm-linux-gcc-3.4.1.tar.bz2 (光盘提供)
linux2.6.14-dma-2440.tar.gz (光盘提供)

1. 解压文件(假设这两个文件都在$USER/目录下)

tar jxvf arm-linux-gcc-3.4.1.tar.bz2 #在当前目录下生成一个usr
tar zxvf linux2.6.14-dma-2440.tar.gz


2. 建立交叉编译环境
(as root)
mkdir /usr/local/arm
chown $USER /usr/local/arm
chmod 777 /usr/local/arm #确保非root用户可以修改其中的内容

(as $USER)
mv ~/usr/local/arm/3.4.1 /usr/local/arm

3. 编译内核映像
cd linux2.6.14-dmatek2440
make clean
make menuconfig #这一步要保存起内核映像的config文件
make zImage

4. 查看内核映像
ls -al arch/arm/boot

如果其中有得到zImage,并且时间吻合的话,那就表示编译是成功的

5. cramfs文件系统
资源:rootdma.cramfs (光盘)
知识点:
Make a CramFs (Compressed ROM File System) mkcramfs lets you construct a CramFs (Compressed ROM File System) image from the contents of a given directory. Cram file systems are used for Debian INITRD images.
文件系统介绍:
http://dev.yesky.com/74/8123574.shtml

下载cramfs-1.1:

载完后将后缀改为.tar.gz
解压 :
tar zxvf sf_200482122123.tar.gz
cd cramfs-1.1
make

这样就可以生成mkcramfs了
链接:
ln -T ~/cramfs-1.1/mkcramfs /usr/bin/mkcramfs (as root)
chmod 777 /usr/bin/mkcramfs

6. 文件系统的制作
资源:rootdma.cramfs (光盘)

建立环境
mkdir rootfs
mkdir rootfs/roms
mkdir rootfs/tmp


拷贝rootdma.cramfs到rootfs目录下,并挂载
(as root)
mount rootfsdma.cramfs roms -o loop


为roms 目录下的内容创建档案
tar cvf 1.tar roms/


将档案解压到tmp/ 下
mv 1.tar tmp/
umount roms (as root)
cd tmp
tar xvf 1.tar


解压时有提示,是否有错???
tar: roms/usr/lib:不可信的旧时间戳 1970-01-01 08:00:00
tar: roms/usr/bin:不可信的旧时间戳 1970-01-01 08:00:00
tar: roms/usr/Qtopia/qtopia-free-1.7.0/bin:不可信的旧时间戳 1970-01-01 08:00:00
tar: roms/usr/Qtopia/qtopia-free-1.7.0:不可信的旧时间戳 1970-01-01 08:00:00
tar: roms/usr/Qtopia:不可信的旧时间戳 1970-01-01 08:00:00
tar: roms/usr:不可信的旧时间戳 1970-01-01 08:00:00
tar: roms/sbin:不可信的旧时间戳 1970-01-01 08:00:00
tar: roms/etc/init.d:不可信的旧时间戳 1970-01-01 08:00:00
tar: roms/etc:不可信的旧时间戳 1970-01-01 08:00:00
tar: roms:不可信的旧时间戳 1970-01-01 08:00:00

-------------------------
注:
查閱 Kernel source 裡 Documentation/filesystems/cramfs.txt 這份文件,可以找到以下這段說明:

<%
 No timestamps are stored in a cramfs, so these default to the epoch
 (1970 GMT).  Recently-accessed files may have updated timestamps, but
 the update lasts only as long as the inode is cached in memory, after
 which the timestamp reverts to 1970, i.e. moves backwards in time.
 %>


所以遇到「不可信的旧时间戳 1970-01-01 08:00:00」這個訊息可以忽略它,沒有影響的。
---------------------------

生成文件系统
mkcramfs roms rootfs_dma.cramfs
$ls
drwxrwxr-x  3 qspy qspy     4096 07-04 18:00 .
drwxrwxr-x  4 qspy qspy     4096 07-04 15:19 ..
-rw-r--r--  1 root root 61061120 07-04 15:19 1.tar
drwxr-xr-x 12 qspy qspy     4096 1970-01-01 roms
-rw-rw-r--  1 qspy qspy 26370048 07-04 18:00 rootfs_dma.cramfs


阅读(4904) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~