工作笔记-2014.5.28

这篇工作笔记记录了在Linux系统中进行系统安全测试时,如何对yaffs2格式的img文件进行编辑修改。通过安装和使用相关工具,如git、patch,以及进行文件操作,展示了编辑img文件的过程。
摘要由CSDN通过智能技术生成

说明:进行系统安全测试,需要对yaffs2格式的img文件进行编辑修改,以下为linux下的修改方法。

 

Selecting previously unselected package liberror-perl.
(正在读取数据库 ... 系统当前共安装有 164924 个文件和目录。)
正在解压缩 liberror-perl (从 .../liberror-perl_0.17-1_all.deb) ...
Selecting previously unselected package git-man.
正在解压缩 git-man (从 .../git-man_1%3a1.7.9.5-1_all.deb) ...
Selecting previously unselected package git.
正在解压缩 git (从 .../git_1%3a1.7.9.5-1_i386.deb) ...
Selecting previously unselected package patch.
正在解压缩 patch (从 .../patch_2.6.1-3_i386.deb) ...
正在处理用于 man-db 的触发器...
正在设置 liberror-perl (0.17-1) ...
正在设置 git-man (1:1.7.9.5-1) ...
正在设置 git (1:1.7.9.5-1) ...
正在设置 patch (2.6.1-3) ...
yly@yly-vm:~/work/yaffs2/utils$ ls
Makefile         mkyaffsimage.c  yaffs_ecc.h   yaffs_hweight.c  yaffs_list.h         yaffs_packedtags2.h  yportenv.h
mkyaffs2image.c  yaffs_ecc.c     yaffs_guts.h  yaffs_hweight.h  yaffs_packedtags2.c  yaffs_trace.h        yutilsenv.h
yly@yly-vm:~/work/yaffs2/utils$ git status -uno
# On branch master
nothing to commit (use -u to show untracked files)
yly@yly-vm:~/work/yaffs2/utils$ git branch
* master
yly@yly-vm:~/work/yaffs2/utils$ git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/aleph1-release-branch
  remotes/origin/big-files
  remotes/origin/block-summary
  remotes/origin/case-insensitive
  remotes/origin/driver-refactoring
  remotes/origin/fix-uboot
  remotes/origin/master
  remotes/origin/stephanetest
yly@yly-vm:~/work/yaffs2/utils$ sudo apt-get install gitk
正在读取软件包列表... 完成
正在分析软件包的依赖关系树      
正在读取状态信息... 完成      
将会安装下列额外的软件包:
  libxss1 tcl tcl8.5 tk tk8.5
建议安装的软件包:
  git-doc tclreadline
下列【新】软件包将被安装:
  gitk libxss1 tcl tcl8.5 tk tk8.5
升级了 0 个软件包,新安装了 6 个软件包,要卸载 0 个软件包,有 688 个软件包未被升级。
需要下载 2,244 kB 的软件包。
解压缩后会消耗掉 8,024 kB 的额外空间。
您希望继续执行吗?[Y/n]Y
获取:1 http://cn.archive.ubuntu.com/ubuntu/ precise/main libxss1 i386 1:1.2.1-2 [8,604 B]
获取:2 http://cn.archive.ubuntu.com/ubuntu/ precise/main tcl8.5 i386 8.5.11-1ubuntu1 [1,097 kB]
获取:3 http://cn.archive.ubuntu.com/ubuntu/ precise/main tk8.5 i386 8.5.11-1 [996 kB]
获取:4 http://cn.archive.ubuntu.com/ubuntu/ precise/main tcl all 8.5.0-2 [4,690 B]
获取:5 http://cn.archive.ubuntu.com/ubuntu/ precise/main tk all 8.5.0-2 [4,720 B]
获取:6 http://cn.archive.ubuntu.com/ubuntu/ precise/main gitk all 1:1.7.9.5-1 [133 kB]
下载 2,244 kB,耗时 5秒 (437 kB/s)
Selecting previously unselected package libxss1.
(正在读取数据库 ... 系统当前共安装有 165583 个文件和目录。)
正在解压缩 libxss1 (从 .../libxss1_1%3a1.2.1-2_i386.deb) ...
Selecting previously unselected package tcl8.5.
正在解压缩 tcl8.5 (从 .../tcl8.5_8.5.11-1ubuntu1_i386.deb) ...
Selecting previously unselected package tk8.5.
正在解压缩 tk8.5 (从 .../tk8.5_8.5.11-1_i386.deb) ...
Selecting previously unselected package tcl.
正在解压缩 tcl (从 .../archives/tcl_8.5.0-2_all.deb) ...
Selecting previously unselected package tk.
正在解压缩 tk (从 .../archives/tk_8.5.0-2_all.deb) ...
Selecting previously unselected package gitk.
正在解压缩 gitk (从 .../gitk_1%3a1.7.9.5-1_all.deb) ...
正在处理用于 man-db 的触发器...
正在设置 libxss1 (1:1.2.1-2) ...
正在设置 tcl8.5 (8.5.11-1ubuntu1) ...
update-alternatives: 使用 /usr/bin/tclsh8.5 来提供 /usr/bin/tclsh (tclsh),于 自动模式 中。
正在设置 tk8.5 (8.5.11-1) ...
update-alternatives: 使用 /usr/bin/wish8.5 来提供 /usr/bin/wish (wish),于 自动模式 中。
正在设置 tcl (8.5.0-2) ...
update-alternatives: 使用 /usr/bin/tclsh-default 来提供 /usr/bin/tclsh (tclsh),于 自动模式 中。
正在设置 tk (8.5.0-2) ...
update-alternatives: 使用 /usr/bin/wish-default 来提供 /usr/bin/wish (wish),于 自动模式 中。
正在设置 gitk (1:1.7.9.5-1) ...
正在处理用于 libc-bin 的触发器...
ldconfig deferred processing now taking place
yly@yly-vm:~/work/yaffs2/utils$ gitk
^C
yly@yly-vm:~/work/yaffs2/utils$ git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/aleph1-release-branch
  remotes/origin/big-files
  remotes/origin/block-summary
  remotes/origin/case-insensitive
  remotes/origin/driver-refactoring
  remotes/origin/fix-uboot
  remotes/origin/master
  remotes/origin/stephanetest
yly@yly-vm:~/work/yaffs2/utils$ git checkout -b  alpha origin/aleph1-release-branch
Branch alpha set up to track remote branch aleph1-release-branch from origin.
Switched to a new branch 'alpha'
yly@yly-vm:~/work/yaffs2/utils$ git branch -a
* alpha
  master
  remotes/origin/HEAD -> origin/master
  remotes/origin/aleph1-release-branch
  remotes/origin/big-files
  remotes/origin/block-summary
  remotes/origin/case-insensitive
  remotes/origin/driver-refactoring
  remotes/origin/fix-uboot
  remotes/origin/master
  remotes/origin/stephanetest
yly@yly-vm:~/work/yaffs2/utils$ make
gcc -c -I/usr/include -I.. -O2 -Wall -DCONFIG_YAFFS_UTIL -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Winline yaffs_ecc.c -o yaffs_ecc.o
gcc -c -I/usr/include -I.. -O2 -Wall -DCONFIG_YAFFS_UTIL -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Winline mkyaffsimage.c -o mkyaffsimage.o
In file included from mkyaffsimage.c:31:0:
yaffs_guts.h:852:51: 警告: ‘struct iattr’在形参表内部声明 [默认启用]
yaffs_guts.h:852:51: 警告: 它的作用域仅限于此定义或声明,这可能并不是您想要的 [默认启用]
yaffs_guts.h:853:51: 警告: ‘struct iattr’在形参表内部声明 [默认启用]
mkyaffsimage.c:116:14: 警告: ‘yaffs_CalcNameSum’定义后未使用 [-Wunused-function]
mkyaffsimage.c: 在函数‘process_directory’中:
mkyaffsimage.c:442:16: 警告: 忽略声明有 warn_unused_result 属性的‘readlink’的返回值 [-Wunused-result]
mkyaffsimage.c: 在函数‘write_object_header’中:
mkyaffsimage.c:319:25: 警告: 数组下标大于数组边界 [-Warray-bounds]
mkyaffsimage.c:319:19: 警告: 数组下标大于数组边界 [-Warray-bounds]
mkyaffsimage.c:320:25: 警告: 数组下标大于数组边界 [-Warray-bounds]
mkyaffsimage.c:320:19: 警告: 数组下标大于数组边界 [-Warray-bounds]
mkyaffsimage.c:321:25: 警告: 数组下标大于数组边界 [-Warray-bounds]
mkyaffsimage.c:321:19: 警告: 数组下标大于数组边界 [-Warray-bounds]
mkyaffsimage.c:322:25: 警告: 数组下标大于数组边界 [-Warray-bounds]
mkyaffsimage.c:322:19: 警告: 数组下标大于数组边界 [-Warray-bounds]
mkyaffsimage.c:323:26: 警告: 数组下标大于数组边界 [-Warray-bounds]
mkyaffsimage.c:323:19: 警告: 数组下标大于数组边界 [-Warray-bounds]
mkyaffsimage.c:324:26: 警告: 数组下标大于数组边界 [-Warray-bounds]
mkyaffsimage.c:324:19: 警告: 数组下标大于数组边界 [-Warray-bounds]
gcc -o mkyaffsimage yaffs_ecc.o mkyaffsimage.o
gcc -c -I/usr/include -I.. -O2 -Wall -DCONFIG_YAFFS_UTIL -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Winline mkyaffs2image.c -o mkyaffs2image.o
In file included from mkyaffs2image.c:35:0:
yaffs_guts.h:852:51: 警告: ‘struct iattr’在形参表内部声明 [默认启用]
yaffs_guts.h:852:51: 警告: 它的作用域仅限于此定义或声明,这可能并不是您想要的 [默认启用]
yaffs_guts.h:853:51: 警告: ‘struct iattr’在形参表内部声明 [默认启用]
mkyaffs2image.c: 在函数‘write_chunk’中:
mkyaffs2image.c:208:10: 警告: 传递‘little_to_big_endian’的第 1 个参数时在不兼容的指针类型间转换 [默认启用]
mkyaffs2image.c:148:13: 附注: 需要类型‘struct yaffs_Tags *’,但实参的类型为‘struct yaffs_ExtendedTags *’
mkyaffs2image.c: 在文件作用域:
mkyaffs2image.c:345:13: 警告: 函数声明不是一个原型 [-Wstrict-prototypes]
gcc -c -I/usr/include -I.. -O2 -Wall -DCONFIG_YAFFS_UTIL -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Winline yaffs_packedtags2.c -o yaffs_packedtags2.o
In file included from yaffs_packedtags2.h:21:0,
                 from yaffs_packedtags2.c:14:
yaffs_guts.h:852:51: 警告: ‘struct iattr’在形参表内部声明 [默认启用]
yaffs_guts.h:852:51: 警告: 它的作用域仅限于此定义或声明,这可能并不是您想要的 [默认启用]
yaffs_guts.h:853:51: 警告: ‘struct iattr’在形参表内部声明 [默认启用]
ln -s ../yaffs_tagsvalidity.c yaffs_tagsvalidity.c
gcc -c -I/usr/include -I.. -O2 -Wall -DCONFIG_YAFFS_UTIL -Wshadow -Wpointer-arith -Wwrite-str

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值