f2fs学习笔记 - 2. f2fs基础实验环境搭建
生活随笔
收集整理的這篇文章主要介紹了
f2fs学习笔记 - 2. f2fs基础实验环境搭建
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1.前言
本文主要記錄如何搭建f2fs的環境,用于f2fs文件系統的學習。我們選用了f2fs第一個補丁提交前的內核版本:linux3.7.0。然后通過提取出f2fs的最小補丁來學習f2fs文件系統,這個最小補丁主要涵蓋了f2fs作者的前18個patch
Arch: arm
kenrel: kernel 3.7.0
busybox: busybox-1.24.2
gcc: gcc-linaro-arm-linux-gnueabihf-4.7-2013.04-20130415_linux
注:經試驗其它版本會導致內核啟動時報錯,NOTE:gcc版本的選擇一般要與內核版本時間相近,推薦使用linaro的版本
2. 基本環境準備
提取f2fs的前18個patch
3f6a0150291b (HEAD -> f2fs_branch) f2fs: update the f2fs document 8377ab02b6a3 f2fs: update Kconfig and Makefile 1c2b6e049f10 f2fs: move proc files to debugfs f23f0a2f65b5 f2fs: add recovery routines for roll-forward a9b5553371e4 f2fs: add garbage collection functions f029047fa7ed f2fs: add xattr and acl functionalities 1f9b35c9b066 f2fs: add core directory operations 3bf7b8e98675 f2fs: add inode operations for special inodes 64c43f6109f7 f2fs: add core inode operations 6b8a900a84a2 f2fs: add address space operations for data 2350d1455a41 f2fs: add file operations 4e4c95127944 f2fs: add segment operations 0ac2640ab9af f2fs: add node operations 0a507cbdc259 f2fs: add checkpoint operations b3862b18fe88 f2fs: add super block operations c9e70d0dae5e f2fs: add superblock and major in-memory structure 778d9a9c8a2c f2fs: add on-disk layout 868dfc32edd0 f2fs: add document根文件系統及qemu環境搭建
略
下載f2fs tools
git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git回退到與初始f2fs patch匹配的版本
git reset --hard 050e8712a60c7d982a7be8c076fb72452364dae4 commit 050e8712a60c7d982a7be8c076fb72452364dae4 (HEAD -> master) Author: Jaegeuk Kim <jaegeuk.kim@samsung.com> Date: Thu Oct 17 15:15:54 2013 +0900README: add description how to cross-compileThis patch adds description for the cross-compilation.Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>編譯f2fs tools的host版本:
sudo apt-get install libtool sudo apt-get install uuid-devautoreconf --install chmod a+x configure ./configure make sudo make install編譯f2fs tools的arm版本
1. Add the below line into mkfs/Makefile.am:mkfs_f2fs_LDFLAGS = -all-static2. Add the below line into fsck/Makefile.am:fsck_f2fs_LDFLAGS = -all-static3.sudo LDFLAGS=--static ./configure --host=arm-none-linux-gnueabi --target=arm-none-linux-gnueabi4.make3. 配置內核
4. 編譯內核
make zImage dtbs moduels
編譯時會報如下的WARNING:
如果不修復此 warning,在insmode f2fs.ko時會提示undefined symbol錯誤
修復方法:
在fs/f2fs/super.c中加入:
5. 制作f2fs文件系統鏡像
dd if=/dev/zero of=~/qemu/out/f2fs.img bs=1M count=128 sudo mkfs.f2fs -l myf2fs f2fs.imginsmod f2fs.komount -t f2fs f2fs.img /mnt -o loop總結
以上是生活随笔為你收集整理的f2fs学习笔记 - 2. f2fs基础实验环境搭建的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 方案设计阶段的准备工作
- 下一篇: EFM32芯片被锁解决方法