查看帮助:
./device/nexell/tools/build.sh -h
编译u-boot:
./device/nexell/tools/build.sh -b drone2 -t u-boot
编译kernel:
./device/nexell/tools/build.sh -b drone2 -t kernel
会提示mkimage找不到的错误,把uboot的mkimage加入PATH就可以:
export PATH=/home/james/android/kitkat-s5p4418drone/android/u-boot/tools:$PATH
* System Type * MMU-based Paged Memory Management Support (MMU) [Y/n/?] y ARM system type 1. ARM Ltd. Integrator family (ARCH_INTEGRATOR) 2. ARM Ltd. RealView family (ARCH_REALVIEW) 3. ARM Ltd. Versatile family (ARCH_VERSATILE) 4. ARM Ltd. Versatile Express family (ARCH_VEXPRESS) 。。。
51. TI DaVinci (ARCH_DAVINCI) 52. TI OMAP (ARCH_OMAP) 53. ST SPEAr (PLAT_SPEAR) 54. VIA/WonderMedia 85xx (ARCH_VT8500) 55. Xilinx Zynq ARM Cortex A9 Platform (ARCH_ZYNQ) > 56. SLsiAP S5P4418D/Q (ARCH_S5P4418) choice[1-56]: 56 Timer frequency 1. 100 HZ (HZ_100) 2. 250 HZ (HZ_250) 3. 300 HZ (HZ_300) > 4. 1000 HZ (HZ_1000) choice[1-4?]: 4 Prototype build mode > 1. Release (S5P4418_PROTO_RELEASE) 2. Debug (S5P4418_PROTO_DEBUG) choice[1-2]: 1 Memory max order > 1. 4Mbyte (S5P4418_MEM_MAX_ORDER_11) 2. 8Mbyte (S5P4418_MEM_MAX_ORDER_12) 3. 16Mbyte (S5P4418_MEM_MAX_ORDER_13) choice[1-3]: 1 * * CPU feature * Goto idle when Suspend (SUSPEND_IDLE) [N/y] n Support PM_DBGOUT (PM_DBGOUT) [N/y] n PWM driver (HAVE_PWM) [Y/n] y /sys/devices/platform/pwm.N (sysfs interface) (PWM_SYSFS) [Y/n] y pwm 0 (HAVE_PWM_CH0) [Y/n] y pwm 1 (HAVE_PWM_CH1) [Y/n] y pwm 2 (HAVE_PWM_CH2) [Y/n] y pwm 3 (HAVE_PWM_CH3) [Y/n] y Support PWM SoC (NXP_PWM) [Y] y Support Display SoC (NXP_DISPLAY) [Y/n] y Primary display output (MLC0/DPC0) (NXP_DISPLAY_1ST) [Y/n] y Secondary display output (MLC1/DPC1) (NXP_DISPLAY_2ST) [Y/n] y Resolution Converter (NXP_DISPLAY_RESCONV) [Y] y DFS For BCLK (NXP_DFS_BCLK) [N/y] n RAM console physical hex address (ANDROID_PERSISTENT_RAM_CONS_AREA) [0x0] 0x0 RAM console size (KB) (ANDROID_PERSISTENT_RAM_CONS_SIZE) [16] 16 * * Board features * Platform board 1. DRONE: Android drone board (PLAT_S5P4418_DRONE) > 2. DRONE: Android drone2 board (PLAT_S5P4418_DRONE2) 3. SVT: Linux svt board (PLAT_S5P4418_SVT) 4. ASB: Linux asb board (PLAT_S5P4418_ASB) (NEW) choice[1-4]: * * Processor Type *
编译android:
./device/nexell/tools/build.sh -b drone2 -t android
编译之后images都会放在 result目录下面的。
编译完成kernel需要将生成的uImage拷贝到out/target/product/drone2/kernel文件。这里的kernel就是uImage。
因为在android源码编译的时候要将ramdisk.img(根文件系统)和内核影响打包成boot.img。
在./device/nexell/tools/build.sh里面编译kernel和u-boot的时候会有make distclean操作,如果重新执行编译,所有会重新编译。编译android的时候没有。
如果都编译成功之后,后期修改kernel或者android源码,建议把./device/nexell/tools/build.sh “make distclean”屏蔽掉。
参考:
http://blog.csdn.net/eliot_shao/article/details/48180265
烧写flash:
两种方式进入fastboot模式。
1、启动长按电源键,进入fastboot模式。
2、在启动过程中按键中断u-boot ,通过fastboot命令进入fastboot模式。u-boot支持fastboot命令,,,串口输入fastboot命令
ubuntu主机用fastboot命令烧写:
fastboot flash bootloader result/u-boot.bin
fastboot flash boot result/boot.img
fastboot flash system result/system.img
…
问题解决:
烧写boot.img后启动不了。通过dmesg查看,
<3>[ 5.484000] vr: version magic '3.4.39+ SMP preempt mod_unload ARMv7 p2v8 ' should be '3.4.39 SMP preempt mod_unload ARMv7 p2v8 '
<3>[ 5.544000] init: /dev/hw_random not found
init启动过程中vr.ko模块不匹配。用以下命令编译ko。
./device/nexell/tools/build.sh -b drone2 -t module
./device/nexell/tools/build.sh -b drone2 -t none
重新烧boot.img问题依旧。原因是需要同时更新boot.img 和system.img, ko模块放在system中(result/system/lib/modules/vr.ko),是在init启动后挂载system,然后再加载的。需要两个镜像同时更新。
ls result/system/lib/modules/ nx_vpu.ko vr.ko wlan.ko
<3>[ 3.389000] init: /init.drone2.rc: 59: invalid command 'restorecon_recursive' <3>[ 3.396000] init: /init.drone2.rc: 190: invalid option '-g@android:wpa_wlan0' <4>[ 3.404000] init (1): /proc/1/oom_adj is deprecated, please use /proc/1/oom_score_adj instead. <3>[ 3.484000] init: /dev/hw_random not found <6>[ 3.523000] EXT4-fs (mmcblk0p2): recovery complete <6>[ 3.528000] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null) <6>[ 3.564000] EXT4-fs (mmcblk0p3): recovery complete <6>[ 3.571000] EXT4-fs (mmcblk0p3): mounted filesystem with ordered data mode. Opts: nomblk_io_submit,errors=remount-ro <6>[ 3.593000] fs_mgr: Running /system/bin/e2fsck on /dev/block/platform/dw_mmc.2/by-num/p3 <6>[ 3.663000] e2fsck: e2fsck 1.41.14 (22-Dec-2010) <6>[ 3.668000] e2fsck: /dev/block/platform/dw_mmc.2/by-num/p3: clean, 14/27392 files, 3537/109568 blocks <6>[ 3.703000] EXT4-fs (mmcblk0p3): mounted filesystem with ordered data mode. Opts: nomblk_io_submit,errors=panic <6>[ 5.048000] EXT4-fs (mmcblk0p7): recovery complete <6>[ 5.055000] EXT4-fs (mmcblk0p7): mounted filesystem with ordered data mode. Opts: nomblk_io_submit,errors=remount-ro <6>[ 5.094000] fs_mgr: Running /system/bin/e2fsck on /dev/block/platform/dw_mmc.2/by-num/p7 <6>[ 5.131000] e2fsck: e2fsck 1.41.14 (22-Dec-2010) <6>[ 5.136000] e2fsck: /dev/block/platform/dw_mmc.2/by-num/p7: clean, 609/366480 files, 63218/1464843 blocks <6>[ 5.160000] EXT4-fs (mmcblk0p7): mounted filesystem with ordered data mode. Opts: nomblk_io_submit,errors=panic <3>[ 5.384000] vr: version magic '3.4.39+ SMP preempt mod_unload ARMv7 p2v8 ' should be '3.4.39 SMP preempt mod_unload ARMv7 p2v8
on fs mount_all /fstab.drone2 setprop ro.crypto.fuse_sdcard true insmod /system/lib/modules/vr.ko
说明是挂载/fstab/drone2后(包含system分区) insmod vr.ko出错。所以要更新system分区。
更新后没有开发人员选项:
连续快速点击版本号5次
查看启动参数:
root@drone2:/ # cat /proc/cmdline
console=ttyAMA0,115200n8 androidboot.hardware=drone2 androidboot.console=ttyAMA0 androidboot.serialno=0123456789abcdef initrd=0x49000000,0x100000 init=/init
root@drone2_s5p4418:/ # cat /proc/cmdline
console=ttyAMA0,115200n8 androidboot.hardware=drone2_s5p4418 androidboot.console=ttyAMA0 androidboot.serialno=0123456789abcdef initrd=0x49000000,0x100000 init=/init
init是/init, 查看根文件系统内容:
root@drone2:/ # ls -l drwxr-xr-x root root 2015-10-09 03:16 acct drwxrwx--- system cache 2015-09-30 02:49 cache dr-x------ root root 2015-10-09 03:16 config lrwxrwxrwx root root 2015-10-09 03:16 d -> /sys/kernel/debug drwxrwx--x system system 2015-09-30 06:40 data -rw-r--r-- system system 120 2015-09-18 02:59 default.prop drwxr-xr-x root root 2015-10-09 03:16 dev lrwxrwxrwx root root 2015-10-09 03:16 etc -> /system/etc -rw-rw-r-- system system 9728 2015-09-18 05:01 file_contexts -rw-r--r-- system system 2238 2015-09-18 03:57 fstab.drone2 -rwxrwxr-x system system 179544 2015-09-18 06:20 init -rw-r--r-- system system 6787 2015-09-18 03:57 init.drone2.rc -rw-r--r-- system system 3062 2015-09-18 03:57 init.drone2.usb.rc -rw-r--r-- system system 919 2015-09-18 03:57 init.environ.rc -rw-r--r-- system system 19671 2015-09-30 08:23 init.rc -rw-r--r-- system system 0 2015-09-18 03:57 init.recovery.drone2.rc -rw-r--r-- system system 1795 2015-09-18 03:57 init.trace.rc -rw-r--r-- system system 3915 2015-09-18 03:57 init.usb.rc drwxrwxr-x root system 2015-10-09 03:16 mnt dr-xr-xr-x root root 1970-01-01 00:00 proc -rw-rw-r-- system system 2161 2015-09-18 05:01 property_contexts drwx------ root root 2015-09-30 08:06 root drwxrwxr-x system system 2015-09-18 06:20 sbin lrwxrwxrwx root root 2015-10-09 03:16 sdcard -> /storage/emulated/legacy -rw-rw-r-- system system 656 2015-09-18 05:01 seapp_contexts -rw-rw-r-- system system 75087 2015-09-18 04:27 sepolicy drwxr-x--x root sdcard_r 2015-10-09 03:16 storage dr-xr-xr-x root root 2015-10-09 03:16 sys drwxr-xr-x root root 1970-01-01 00:00 system -rw-r--r-- system system 507 2015-09-18 03:57 ueventd.drone2.rc -rw-r--r-- system system 4024 2015-09-18 03:57 ueventd.rc lrwxrwxrwx root root 2015-10-09 03:16 vendor -> /system/vendor root@drone2:/ #