OK335xS-Android pack-ubi-256M.sh hacking

 1 #/*******************************************************************************
 2 # *                  OK335xS-Android pack-ubi-256M.sh hacking
 3 # *  声明:
 4 # *      1. 本文解析仅仅是为了知道pack-ubi-256M.sh自动生成ubi文件系统的原理
 5 # *      2. 本文在网页上可能不好阅读,最好cp一份在其他文本编辑器中阅读
 6 # *                                    2015-6-4 晴 深圳 南山平山村 曾剑锋
 7 # ******************************************************************************/
 8
 9
10 # /bin/sh
11
12 ANDROID_PATH=`pwd`                                   # get android root path
13 KERNEL_PATH=$ANDROID_PATH/kernel                     # get android kernel path
14 UBOOT_PATH=$ANDROID_PATH/u-boot                      # get android u-boot path
15 echo "start make rootfs.tar.bz2......"               # show start message
16 cd $ANDROID_PATH/out/target/product/am335xevm        # change directory to out path
17 rm -rf android_rootfs                                # remove android_rootfs directory
18 mkdir android_rootfs                                 # make directory for android_rootfs
19 cp -rf root/* android_rootfs                         # cp all file to android_rootfs directory from root directory
20 cp -rf data android_rootfs/                          # cp data directory to android_rootfs directory
21 cp -rf system android_rootfs/                        # cp system directory to android_rootfs directory
22 cp -rf $ANDROID_PATH/vendor/busybox android_rootfs/system/bin                         # cp busybox as a shell command
23 cp -rf $ANDROID_PATH/RowboPerf/RowboPerf_libs/armeabi/* android_rootfs/system/lib     # cp RowboPerf armeabi lib as system lib
24 cp -rf $ANDROID_PATH/RowboPerf/Zeroxbench_bins/armeabi/* android_rootfs/system/bin    # cp RowboPerf armeabi bin as system bin
25 cp -rf $ANDROID_PATH/RowboPerf/*.apk android_rootfs/data/app                          # cp RowboPerf apk as data spp
26 cd android_rootfs/data                               # change directory to android_rootfs/data
27 mkdir data                                           # make directory for data
28 cd $ANDROID_PATH/out/target/product/am335xevm        # change directory to out path
29 chown 1000:1000 android_rootfs/data/app -R           # change file own
30 chmod 775 android_rootfs/data/app                    # change file mode of app
31 chmod 777 android_rootfs/data/data                   # change file mode of data
32 ../../../../build/tools/mktarball.sh ../../../host/linux-x86/bin/fs_get_stats android_rootfs . rootfs rootfs.tar.bz2 # create a tar file
33 sleep 2
34 cp -rf rootfs.tar.bz2 $ANDROID_PATH/mkubifs                         # cp rootfs.tar.bz2 to mkubifs directory
35 cd  $ANDROID_PATH/mkubifs                                           # go to mkubifs directory
36 rm -rf rootfs                                                       # rm -rf rootfs directory
37 mkdir rootfs                                                        # make rootfs directory
38 tar -jxvf rootfs.tar.bz2 -C rootfs                                  # use tar with -jxvf argument extract files from rootfs.tar.bz2
39 ./mkfs.ubifs -F -r rootfs -m 2048 -e 126976 -c 1866 -o ubifs.img    # create the ubifs image
40 # ubinize.cfg                                              |
41 #     [ubifs]                                              |
42 #     mode=ubi                                             |
43 #     image=ubifs.img    <---------------------------------+
44 #     vol_id=0
45 #     vol_size=220MiB
46 #     vol_type=dynamic
47 #     vol_name=rootfs
48 #     vol_flags=autoresize
49 ./ubinize -o ubi.img -O 2048 -m 2048 -p 128KiB -s 2048 ubinize.cfg    # create the ubi image
50 sleep 2
51 echo " make end"                                                      # show work end
52
53 cd  $ANDROID_PATH                                                     # goto android root path
54 cp $KERNEL_PATH/arch/arm/boot/uImage temp                             # cp uImage to temp directory
55 #cp $UBOOT_PATH/MLO temp                                              # cp MLO to temp directory
56 #cp $UBOOT_PATH/u-boot.img temp                                       # cp u-boot.img to temp directory
57 cp $ANDROID_PATH/mkubifs/ubi.img temp                                 # cp ubi.img to temp directory
58
59 cp $KERNEL_PATH/arch/arm/boot/uImage mmc-android-ubifs/Boot_Images    # cp uImage to mmc-android-ubifs/Boot_Images
60 #cp $UBOOT_PATH/MLO mmc-android-ubifs/Boot_Images                     # cp MLO to temp directory
61 #cp $UBOOT_PATH/u-boot.img mmc-android-ubifs/Boot_Images              # cp u-boot.img to temp directory
62 cp $ANDROID_PATH/mkubifs/ubi.img mmc-android-ubifs/Filesystem         # cp ubi.img to temp directory
63 echo "pack complete"

 

时间: 2024-09-29 15:28:06

OK335xS-Android pack-ubi-256M.sh hacking的相关文章

AM335x Android eMMC mkmmc-android.sh hacking

# AM335x Android eMMC mkmmc-android.sh hacking # # 1. 有空解读一下android的分区文件. # 2. 代码来源:https://github.com/hendersa/bbbandroid-external-ti_android_utilities/blob/master/am335x/mk-mmc/mkmmc-android.sh # # 2016-9-8 深圳 南山平山村 曾剑锋 #!/bin/bash # 如果参数只有一个,这里就会使

OK335xS psplash make-image-header.sh hacking

/***************************************************************************** * OK335xS psplash make-image-header.sh hacking * 说明: * 移植的时候想知道移植psplash中./make-image-header.sh Screenshot.png POKY * 最后的POKY为什么要指定,觉得只要解读这份代码就能知道为什么了. * * 2016-4-18 深圳 南山

Android Mokoid Open Source Project hacking

/***************************************************************************** * Android Mokoid Open Source Project hacking * * 声明: * 1. 本文主要是为了了解Android HAL工作机制,从而决定分析mokoid开源项目: * 2. 源代码URL:https://code.google.com/p/mokoid/source/checkout: * 3. 本文通

OK335xS-Android mkmmc-android-ubifs.sh hacking

1 #/******************************************************************************* 2 # * OK335xS-Android mkmmc-android-ubifs.sh hacking 3 # * 声明: 4 # * 通过分析该源代码,可以知道常说的自动烧写软件的工作原理 5 # * 参考:sfidsk创建可启动分区问题--http://segmentfault.com/a/1190000002493628

I.MX6 mkuserimg.sh hacking

/*********************************************************************** * I.MX6 mkuserimg.sh hacking * 说明: * 上次发现Android源码使用mkuserimg.sh来打包Android文件系统,现在来 * 跟踪一下其内部的工作机制. * * 2016-6-28 深圳 南山平山村 曾剑锋 ***************************************************

ti processor sdk linux am335x evm /bin/create-sdcard.sh hacking

#!/bin/bash # # ti processor sdk linux am335x evm /bin/create-sdcard.sh hacking # 说明: # 本文主要对TI的sdk中的create-sdcard.sh脚本进行解读,该文件只解读 # 前面一部分,后面一部分未解读,主要是因为后面的代码并不能获取到正确 # 的设备节点,于是不打算深入解读.其中学会到了tar中显示解压进度的写法, # 以及拷贝文件夹的显示当前拷贝数据的进度的方法. # # 2016-4-16 深圳 南

ti processor sdk linux am335x evm /bin/commom.sh hacking

#!/bin/sh # # ti processor sdk linux am335x evm /bin/commom.sh hacking # 说明: # 本文主要对TI的sdk中的common.sh脚本进行解读,是为了了解其工作机制. # # 2016-4-16 深圳 南山平山村 曾剑锋 # This distribution contains contributions or derivatives under copyright # as follows: # # Copyright (

ti processor sdk linux am335x evm /bin/setup-package-install.sh hacking

#!/bin/sh # # ti processor sdk linux am335x evm /bin/setup-package-install.sh hacking # 说明: # 本文主要对TI的sdk中的setup-package-install.sh脚本进行解读,是为了了解 # 其工作机制. # # 2016-4-16 深圳 南山平山村 曾剑锋 # This distribution contains contributions or derivatives under copyri

ti processor sdk linux am335x evm /bin/setup-tftp.sh hacking

#!/bin/sh # # ti processor sdk linux am335x evm /bin/setup-tftp.sh hacking # 说明: # 本文主要对TI的sdk中的setup-tftp.sh脚本进行解读,是为了了解其工作机制. # # 2016-4-16 深圳 南山平山村 曾剑锋 # This distribution contains contributions or derivatives under copyright # as follows: # # Cop