分类: LINUX
2005-10-26 11:13:07
yaffs 根文件系统
移植yaffs:
1. 通过CVS下载最新yaffs(在终端里执行如下命令):
export CVSROOT=:pserver:anonymous@cvs.aleph1.co.uk:/home/aleph1/cvs
cvs logon (Hit return when asked for a password)
cvs checkout yaffs
2. 运行下载的yaffs/linux-kernel/patch-ker.sh给内核打补丁:
./patch-ker.sh /linux-2.6.11.8/ (其中/linux-2.6.11.8/为内核所在目录)
它做如下事情:
a. 修改[linux]/fs/Kconfig,使得可以配置yaffs
b. 在fs目录下生成yaffs目录,并在里面生成一个makefile
3. 上面生成的makefile我不知道如何使用,于是在其他地方找了一个,其内容为:
obj-$(CONFIG_YAFFS_FS) += yaffs.o
yaffs-objs := yaffs_fs.o yaffs_guts.o yaffs_mtdif.o yaffs_ecc.o
EXTRA_CFLAGS += $(YAFFS_CONFIGS) -DCONFIG_KERNEL_2_6
4. 在fs/makefile里增加一句:
obj-$(CONFIG_YAFFS_FS) += yaffs/
配置内核时选中yaffs
#include
#include
#include
#include
#include
2、在NAND Resource定义一节增加:
/* NAND Flash */
static int chip0_map[] = { 0 };
struct mtd_partition s3c_nand_part[] = {
{
.name = "vivi",
.offset = 0x00000000,
.size = 0x00020000,
},
{
.name = "kernel",
.offset = 0x00030000,
.size = 0x001d0000,
},
{
.name = "root",
.offset = 0x00200000,
.size = 0x00200000,
},
{
.name = "user",
.offset = 0x00400000,
.size = 0x03c00000,
}
};
static struct s3c2410_nand_set s3c_nand_sets[] = {
[0] = {
.name = "chip0",
.nr_chips = 1,
.nr_map = chip0_map,
.nr_partitions = ARRAY_SIZE(s3c_nand_part),
.partitions = s3c_nand_part
}
};
static struct s3c2410_platform_nand s3c_nand_info = {
.tacls = 0,
.twrph0 = 30,
.twrph1 = 0,
.nr_sets = ARRAY_SIZE(s3c_nand_sets),
.sets = s3c_nand_sets,
};
/* NAND Controller */
static struct resource s3c_nand_resource[] = {
[0] = {
.start = S3C2410_PA_NAND,
.end = S3C2410_PA_NAND + S3C2410_SZ_NAND,
.flags = IORESOURCE_MEM,
}
};
struct platform_device s3c_device_nand = {
.name = "s3c2410-nand",
.id = -1,
.num_resources = ARRAY_SIZE(s3c_nand_resource),
.resource = s3c_nand_resource,
.dev = {
.platform_data = &s3c_nand_info
}
};
EXPORT_SYMBOL(s3c_device_nand);
If you change the "linxu command line",
vivi> param set linux_cmd_line "you wish.."
If you want to see paramters, vivi> param show
If you want to wait a long time when recevie file via xmodem, vivi> param set xmodem_initial_timeout 3000000
一,建立目录:
1.cd ${PRJROOT}/rootfs
2,mkdir bin dev etc lib proc sbin tmp usr var
3,chmod 1777 tmp
4,mkdir usr/bin usr/lib usr/sbin
5,mkdir var/lib var/lock var/log var/run var/tmp
6,chmod 1777 var/tmp
二,添加库文件
1,cd ${TARGET_PREFIX}/lib
2, for file in libc libcrypt libdl libm
> libpthread libresolv libutil
> do
> cp $file-*.so ${PRJROOT}/rootfs/lib
> cp -d $file.so.[*0-9] ${PRJROOT}/rootfs/lib
> done
3,cp -d ld*.so* ${PRJROOT}/rootfs/lib
The -d option is used with the second and third cp commands to preserve the symbolic links as is.
4,powerpc-linux-strip ${PRJROOT}/rootfs/lib/*.so
剪裁库文件
使用uclib
1,cd ${PREFIX}/uclibc/lib
2,cp *-*.so ${PRJROOT}/rootfs/lib
3,cp -d *.so.[*0-9] ${PRJROOT}/rootfs/lib
三,添加内核模块
cp -a ${PRJROOT}/images/modules-2.4.18/* ${PRJROOT}/rootfs
四,内核(可选)
1,mkdir ${PRJROOT}/rootfs/boot
2,cd ${PRJROOT}/images
3,cp zImage-2.4.18 ${PRJROOT}/rootfs/boot
五,构建设备文件目录