关于如何将yaffs2源码打包入linux源码中
2016-01-20 22:05
211 查看
git clone git://www.aleph1.co.uk/yaffs2
download source code
ls
We’re starting off in the directory where I stored the kernel and Yaffs source.
The next step isn’t strictly necessary, but it’s useful to if you are going to be doing development: I’m going to make a branch for my changes to the kernel. Of course if you are using subversion, cvs or some other system for version control then you’ll want
to skip this step or replace it
Let’s list the branches
git branch
Only one makes it easy.
Git checkout master -b yaffs-demo-x86
Okay, so we’ve created a branch.
git branch
And the star indicates that we are working in our new branch.
Now we have the kernel source, but we need to include Yaffs.
Luckily Yaffs comes with a script which automates the source changes necessary to include it.
cd ../yaffs
It’s always a good idea to check the README file. Especially if you are doing this yourself.
less readme-linux.txt
So the script we use to patch the kernel is
./patch-ker.sh c m ~/kernel/source
The c tells the script to copy the changes rather than linking them, and the m indicates that we want the multiprocess option because more than one process might be using Yaffs at one time.
Right, Yaffs has been patched into the kernel. Now we need to configure the kernel build.
Because I’m working on a virtual machine, I don’t need to worry about different flavours of the kernel configuration. I can just go ahead and edit the default configuration. To avoid a long compile, I’m going to remove pretty much all of the non-essential drivers,
and most of the hardware – remember this is running on a virtual machine.
make menuconfig
To include Yaffs we need to enable two things.
The memory technology device support (MTD) and the caching block device access for MTD.
The MTD settings are in the Device drivers section. Usually it will be on. The caching should be on too. Once
those are enabled, Yaffs becomes available as an optional file system.
Go into File systems, Miscellaneous and enable Yaffs.
Here’s a look at the various options.
I’ve set up Yaffs. Now I’m going to go ahead and turn off all the things that I don’t need in this kernel. There are a lot of them, and there’s no need to watch hundreds of items being unticked.
…Skipping ahead….
Once the config is suitable, we can exit and save.
Okay, we’re ready to build the kernel. Just to make sure that everything is fine..
fakeroot make-kpkg clean
and let’s kick the build off
fakeroot make-kpkg –initrd –append-to-version=yaffs kernel-image
and now, since this is running on a uniprocessor virtual machine, I’ll be going for some lunch. But there’s no need for you to wait…
So, the build is finished. It took about 1/2 hour. Your mileage will vary.
We have a Debian package, and I’m going to go ahead and install that.
sudo dpkg –install
We should have our new build in the grub. If we reboot, we’ll have Yaffs available. In the next video we’ll show you how to set up a Yaffs file system. You can download a copy of the virtual machine but you’ll need vagrant to use it. Details are on the site.
download source code
ls
We’re starting off in the directory where I stored the kernel and Yaffs source.
The next step isn’t strictly necessary, but it’s useful to if you are going to be doing development: I’m going to make a branch for my changes to the kernel. Of course if you are using subversion, cvs or some other system for version control then you’ll want
to skip this step or replace it
Let’s list the branches
git branch
Only one makes it easy.
Git checkout master -b yaffs-demo-x86
Okay, so we’ve created a branch.
git branch
And the star indicates that we are working in our new branch.
Now we have the kernel source, but we need to include Yaffs.
Luckily Yaffs comes with a script which automates the source changes necessary to include it.
cd ../yaffs
It’s always a good idea to check the README file. Especially if you are doing this yourself.
less readme-linux.txt
So the script we use to patch the kernel is
./patch-ker.sh c m ~/kernel/source
The c tells the script to copy the changes rather than linking them, and the m indicates that we want the multiprocess option because more than one process might be using Yaffs at one time.
Right, Yaffs has been patched into the kernel. Now we need to configure the kernel build.
Because I’m working on a virtual machine, I don’t need to worry about different flavours of the kernel configuration. I can just go ahead and edit the default configuration. To avoid a long compile, I’m going to remove pretty much all of the non-essential drivers,
and most of the hardware – remember this is running on a virtual machine.
make menuconfig
To include Yaffs we need to enable two things.
The memory technology device support (MTD) and the caching block device access for MTD.
The MTD settings are in the Device drivers section. Usually it will be on. The caching should be on too. Once
those are enabled, Yaffs becomes available as an optional file system.
Go into File systems, Miscellaneous and enable Yaffs.
Here’s a look at the various options.
I’ve set up Yaffs. Now I’m going to go ahead and turn off all the things that I don’t need in this kernel. There are a lot of them, and there’s no need to watch hundreds of items being unticked.
…Skipping ahead….
Once the config is suitable, we can exit and save.
Okay, we’re ready to build the kernel. Just to make sure that everything is fine..
fakeroot make-kpkg clean
and let’s kick the build off
fakeroot make-kpkg –initrd –append-to-version=yaffs kernel-image
and now, since this is running on a uniprocessor virtual machine, I’ll be going for some lunch. But there’s no need for you to wait…
So, the build is finished. It took about 1/2 hour. Your mileage will vary.
We have a Debian package, and I’m going to go ahead and install that.
sudo dpkg –install
We should have our new build in the grub. If we reboot, we’ll have Yaffs available. In the next video we’ll show you how to set up a Yaffs file system. You can download a copy of the virtual machine but you’ll need vagrant to use it. Details are on the site.
相关文章推荐
- linux 学习之路
- 利用crontab定时重启centos
- linux查找指定大小的文件
- linux获取网站的响应时间
- Linux---MySQL密码找回方式
- Linux系统构架 - HA集群配置
- linux字符设备驱动程序(一)----------分配设备号并注册设备
- linux who命令
- linux查看磁盘和目录空间
- Linux centos重启命令
- linux下不是很完美的提高android虚拟机的启动速度
- Linux文件系统管理
- Linux文件系统管理
- 如何在 CentOS / RHEL 上设置 SSH 免密码登录
- linux中断申请之request_threaded_irq 【转】
- Linux 常用命令笔记
- 与 Linux 一起学习:玩音乐
- 【OpenCV移植系列】02. OpenCV 1.0 在嵌入式Linux 上的移植
- 【Linux】环境变量设置
- Linux 性能监控 —— Load Average