I.MX6 working note for high efficiency

简介: /**************************************************************************** * I.MX6 working note for high efficiency * * 主要是将在I.MX6 Android工作中的用到的特殊需求用法的记录,并对boot.img * 分解、合成进行了说明,另外增加了一个shell脚本自动完成boot.img合成与拷贝。
/****************************************************************************
 *                I.MX6 working note for high efficiency 
 *
 *      主要是将在I.MX6 Android工作中的用到的特殊需求用法的记录,并对boot.img
 *  分解、合成进行了说明,另外增加了一个shell脚本自动完成boot.img合成与拷贝。
 *
 *                         深圳 南山平山村 晴 2015/05/13 周三 曾剑锋
 ***************************************************************************/

                   \\\\\\\\\\\-*- 目录 -*-///////////
                   |  一. 获取目录的读写权限: 
                   |  二. vi编辑器:
                   |  三. 查看网络方法:
                   |  四. 配置网络方法:
                   |  五. dhcp的配置方法:
                   |  六. boot.img pack unpack:
                   |  七. system.img pack unpack:
                   \\\\\\\\\\\\\\\\\\\//////////////



一. 获取目录的读写权限:
    1. 嵌入式重新挂根目录
        mount -o rw -o remount /dev/block/actb /    
    2. 嵌入式重新挂载/system
        mount -o remount /dev/block/mtdblock2 /system   
3. Ubuntu脚本挂载
echo "aplex" | sudo -S mount -t ext4 system.img yaffs
4. Ubuntu脚本卸载
     echo "aplex" | sudo umount yaffs
二. vi编辑器: busybox vi 三. 查看网络方法:
1. netcfg 2. busybox ifconfig 四. 配置网络方法: 1. ifconfig eth0 192.168.1.1 2. busybox ifconfig eth0 192.168.1.1/24 五. dhcp的配置方法: 1. netcfg eth0 up 2. netcfg eth0 dhcp 六. boot.img pack unpack: 1. 下载工具:[TOOL] Boot.img tools [unpack, repack, ramdisk] http://forum.xda-developers.com/showthread.php?t=2319018 2. 看1中网站对工具的描述说明、使用说明 3. 封装一个repack工具: cat repack << EOF #!/bin/sh echo "begin to repacking boot.img" KERNEL=boot/boot.img-kernel RAMDISK=boot/new-ramdisk.cpio.gz PAGESIZE=2048 BASE=0x10800000 RAMDISKADDR=0x11800000 CMDLINE="console=ttymxc0,115200 init=/init video=mxcfb0:dev=ldb,bpp=32 video=mxcfb1:off video=mxcfb2:off fbmem=10M fb0base=0x27b00000 vmalloc=400M androidboot.console=ttymxc0 androidboot.hardware=freescale" out=${out:-"/home/myzr/myandroid/out/target/product/sabresd_6dq"} # 检查必要的文件或者文件夹 if [ ! -f $RAMDISK ] ; then echo " \nCan't find the boot/new-ramdisk.cpio.gz file.\n " exit 0 fi if [ ! -f $KERNEL ] ; then echo " \nCan't find the boot/boot.img-kernel file.\n " exit 0 fi if [ ! -d boot/ramdisk ] ; then echo " \nCan't find the boot/ramdisk directory.\n " exit 0 fi ./repack_ramdisk boot/ramdisk ./mkbootimg --kernel $KERNEL --ramdisk $RAMDISK --pagesize $PAGESIZE --base $BASE --ramdiskaddr $RAMDISKADDR --cmdline "$CMDLINE" -o newboot.img echo "repacking boot.img over EOF 4. 如果我们是使用虚拟机和Windows,协同工作,何不让让shell脚本帮我们再多做点事, 编译内核时,合成boot.img,并拷贝boot.img到固定的目录Windows制定目录下去: cat remake.sh << EOF #!/bin/sh make uImage out=${out:-"/home/myzr/myandroid/out/target/product/sabresd_6dq"} if [ ! -d $out/bootimgTools/boot/ ]; then mkdir $out/bootimgTools/boot -p echo "mkdir $out/bootimgTools/boot " fi echo "cp arch/arm/boot/zImage $out/bootimgTools/boot/boot.img-kernel" cp arch/arm/boot/zImage $out/bootimgTools/boot/boot.img-kernel #repack boot.img file cd $out/bootimgTools #跳到工具所在的目录 ./repack #执行上3中封装的合成脚本 echo "boot.img repacked over." #共享目录下的目录路径,本人的共享目录是PC机的桌面 WIN_PATH="MY-I.MX6DL-MFG-TOOL-V2.5/MY-I.MX6DL-MFG-TOOL-V2.5/Profiles/MX6DL Linux Update/OS Firmware/files/android" cp newboot.img "${win}/${WIN_PATH}/boot.img" echo "move over. :)" EOF 七. system.img pack unpack: 1. shell命令:file system.img 输出结果:system.img: Linux rev 1.0 ext4 filesystem data, UUID=57f8f4bc-abf4-655f-bf67-946fc0f9f25b (extents) (large files) 由上面的结果分析可知,我们只需要挂载system.img,然后就可以直接修改其中的内容了,很幸运而已: sudo mount -t ext4 system.img <目标路径> 2. 可以考虑做同样的事,写个脚本,让电脑代劳拷贝之类的工作

 

目录
相关文章
|
5月前
|
人工智能
Big Water Problem
Big Water Problem
34 0
PAT (Advanced Level) Practice - 1096 Consecutive Factors(20 分)
PAT (Advanced Level) Practice - 1096 Consecutive Factors(20 分)
142 0
PAT (Advanced Level) Practice - 1004 Counting Leaves(30 分)
PAT (Advanced Level) Practice - 1004 Counting Leaves(30 分)
105 0
|
C++
PAT (Advanced Level) Practice - 1038 Recover the Smallest Number(30 分)
PAT (Advanced Level) Practice - 1038 Recover the Smallest Number(30 分)
120 0
|
Shell
Solving environment: failed with initial frozen solve. Retrying with flexible solve的解决方法
Solving environment: failed with initial frozen solve. Retrying with flexible solve的解决方法
12759 0
Solving environment: failed with initial frozen solve. Retrying with flexible solve的解决方法
Performance problem during saving - activating big form
Performance problem during saving - activating big form
The Rising Smart Logistics Industry: How to Use Big Data to Improve Efficiency and Save Costs
This whitepaper will examine Alibaba Cloud’s Cainiao smart logistics cloud and Big Data powered platform and the underlying strategies used to optimiz.
1531 0
The Rising Smart Logistics Industry: How to Use Big Data to Improve Efficiency and Save Costs