Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:xu3_building_android [2017/01/20 11:30] odroid [Android] |
en:xu3_building_android [2017/05/24 10:45] codewalker |
||
---|---|---|---|
Line 3: | Line 3: | ||
You need use **gcc version 4.6** to build the Exynos-5422 Android Kernel. | You need use **gcc version 4.6** to build the Exynos-5422 Android Kernel. | ||
- | You must check the requirement of the Android build machine first.\\ | ||
- | http://source.android.com/source/requirements.html#hardware-requirements | ||
- | |||
- | This page will introduce you how you can download and build Android source tree to customize it for your usage. | ||
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
If you have not built Android on your desktop yet, please read Android's official build environment set up guide [[https://source.android.com/source/initializing.html]] carefully before your proceed. Otherwise, you would have unexpected errors and exhaust to read quite long and complicated build log to find the problem.\\ | If you have not built Android on your desktop yet, please read Android's official build environment set up guide [[https://source.android.com/source/initializing.html]] carefully before your proceed. Otherwise, you would have unexpected errors and exhaust to read quite long and complicated build log to find the problem.\\ | ||
Line 13: | Line 9: | ||
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
We've used Ubuntu 14.04 64bit with 8GB RAM since other newer versions had some issues while building the Android OS. \\ | We've used Ubuntu 14.04 64bit with 8GB RAM since other newer versions had some issues while building the Android OS. \\ | ||
- | </WRAP> | + | http://source.android.com/source/requirements.html#hardware-requirements |
- | <WRAP center round important 60%> | ||
If you want to build full Android source tree, don't download & build the kernel source separately. \\ | If you want to build full Android source tree, don't download & build the kernel source separately. \\ | ||
- | Separated Kernel build might break the Android build process. | + | Separated Kernel build might break the Android build process. \\ |
</WRAP> | </WRAP> | ||
+ | |||
+ | |||
===== Toolchain ===== | ===== Toolchain ===== | ||
Click one of the site to download toolchain to build Linux kernel. | Click one of the site to download toolchain to build Linux kernel. | ||
Line 131: | Line 128: | ||
4 packets transmitted, 4 received, 0% packet loss, time 3001ms | 4 packets transmitted, 4 received, 0% packet loss, time 3001ms | ||
rtt min/avg/max/mdev = 0.718/0.971/1.561/0.344 ms | rtt min/avg/max/mdev = 0.718/0.971/1.561/0.344 ms | ||
- | </code> | ||
- | |||
- | ==== device console ==== | ||
- | <code> | ||
- | 130|root@odroidxu3:/ # setprop service.adb.tcp.port 5555 | ||
- | </code> | ||
- | <code> | ||
- | root@odroidxu3:/ # stop adbd && start adbd | ||
- | [ 286.223070] [c4] adb_release | ||
- | [ 286.224485] [c4] dwc3 12400000.dwc3: request de1f4f80 was not queued to ep0ot | ||
- | root@odroidxu3:/ [ 286.239830] [c1] adb_open | ||
- | [ 286.242450] [c6] adb_bind_config | ||
</code> | </code> | ||
Line 536: | Line 521: | ||
# SD/eMMC FAT Format | # SD/eMMC FAT Format | ||
#------------------------------------------------------------------------------------------------------ | #------------------------------------------------------------------------------------------------------ | ||
+ | mmcinfo 1 | ||
fatformat mmc 1:1 | fatformat mmc 1:1 | ||
Line 562: | Line 548: | ||
| /storage/usb3host | USB 3.0 Host port | USB STORAGE | | | /storage/usb3host | USB 3.0 Host port | USB STORAGE | | ||
| /storage/usb3device | USB 3.0 Device port | USB STORAGE | | | /storage/usb3device | USB 3.0 Device port | USB STORAGE | | ||
+ | |||
+ | ===== How to make release image ===== | ||
+ | Make a directory. | ||
+ | <code> | ||
+ | $ mkdir emmc | ||
+ | $ cd emmc | ||
+ | </code> | ||
+ | |||
+ | Make boot.ini file | ||
+ | <file> | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # | ||
+ | # EMMC to EMMC Recovery boot.ini text file | ||
+ | # | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | ODROIDXU-UBOOT-CONFIG | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # BL1 write to eMMC | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fatload mmc 0:1 40008000 bl1.bin | ||
+ | emmc open 0 | ||
+ | movi w z f 0 40008000 | ||
+ | emmc close 0 | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # BL2 write to eMMC | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fatload mmc 0:1 40008000 bl2.bin | ||
+ | emmc open 0 | ||
+ | movi w z b 0 40008000 | ||
+ | emmc close 0 | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # Bootloader write to eMMC | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fatload mmc 0:1 40008000 u-boot.bin | ||
+ | emmc open 0 | ||
+ | movi w z u 0 40008000 | ||
+ | emmc close 0 | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # Turst Zone Soft Ware write to eMMC | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fatload mmc 0:1 40008000 tzsw.bin | ||
+ | emmc open 0 | ||
+ | movi w z t 0 40008000 | ||
+ | emmc close 0 | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # UBOOT ENV Erase | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | mmc write 0 40008000 0x4CF 0x20 | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # Kernel Image write to eMMC | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fatload mmc 0:1 40008000 zImage-dtb | ||
+ | movi write kernel 0 40008000 | ||
+ | |||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # System Image write to eMMC | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fatload mmc 0:1 40000000 system.img | ||
+ | |||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # Userdata Image write to eMMC | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fatload mmc 0:1 57000000 userdata.img | ||
+ | |||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # Cache Image write to eMMC | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fatload mmc 0:1 61000000 cache.img | ||
+ | |||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # Partition Create to eMMC | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fdisk -c 0 | ||
+ | |||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fastboot flash system 40000000 0 | ||
+ | fastboot flash userdata 57000000 0 | ||
+ | fastboot flash cache 61000000 0 | ||
+ | |||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # SD/eMMC FAT Format | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fatformat mmc 0:1 | ||
+ | |||
+ | reset | ||
+ | </file> | ||
+ | |||
+ | <code> | ||
+ | $ mkdir sd | ||
+ | $ cd sd | ||
+ | </code> | ||
+ | |||
+ | Make boot.ini file | ||
+ | <file> | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # | ||
+ | # SD to SD Recovery boot.ini text file | ||
+ | # | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | ODROIDXU-UBOOT-CONFIG | ||
+ | |||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # BL1 write to eMMC | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fatload mmc 0:1 40008000 bl1.bin | ||
+ | movi w f 0 40008000 | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # BL2 write to eMMC | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fatload mmc 0:1 40008000 bl2.bin | ||
+ | movi w b 0 40008000 | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # Bootloader write to eMMC | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fatload mmc 0:1 40008000 u-boot.bin | ||
+ | movi w u 0 40008000 | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # Turst Zone Soft Ware write to eMMC | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fatload mmc 0:1 40008000 tzsw.bin | ||
+ | movi w t 0 40008000 | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # UBOOT ENV Erase | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | mmc write 0 40008000 0x4CF 0x20 | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # Kernel Image write to eMMC | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fatload mmc 0:1 40008000 zImage-dtb | ||
+ | movi write kernel 0 40008000 | ||
+ | |||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # System Image write to eMMC | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fatload mmc 0:1 40000000 system.img | ||
+ | |||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # Userdata Image write to eMMC | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fatload mmc 0:1 57000000 userdata.img | ||
+ | |||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # Cache Image write to eMMC | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fatload mmc 0:1 61000000 cache.img | ||
+ | |||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # Partition Create to eMMC | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fdisk -c 0 | ||
+ | |||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fastboot flash system 40000000 0 | ||
+ | fastboot flash userdata 57000000 0 | ||
+ | fastboot flash cache 61000000 0 | ||
+ | |||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # SD/eMMC FAT Format | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fatformat mmc 0:1 | ||
+ | |||
+ | reset | ||
+ | </file> | ||
+ | |||
+ | |||
+ | <code> | ||
+ | $ mkdir sd2emmc | ||
+ | $ cd sd2emmd | ||
+ | </code> | ||
+ | |||
+ | Make boot.ini file | ||
+ | <file> | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # | ||
+ | # SD to EMMC Recovery boot.ini text file | ||
+ | # | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | ODROIDXU-UBOOT-CONFIG | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # BL1 write to eMMC | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fatload mmc 0:1 40008000 bl1.bin | ||
+ | emmc open 1 | ||
+ | movi w z f 1 40008000 | ||
+ | emmc close 1 | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # BL2 write to eMMC | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fatload mmc 0:1 40008000 bl2.bin | ||
+ | emmc open 1 | ||
+ | movi w z b 1 40008000 | ||
+ | emmc close 1 | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # Bootloader write to eMMC | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fatload mmc 0:1 40008000 u-boot.bin | ||
+ | emmc open 1 | ||
+ | movi w z u 1 40008000 | ||
+ | emmc close 1 | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # Turst Zone Soft Ware write to eMMC | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fatload mmc 0:1 40008000 tzsw.bin | ||
+ | emmc open 1 | ||
+ | movi w z t 1 40008000 | ||
+ | emmc close 1 | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # UBOOT ENV Erase | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | mmc write 1 40008000 0x4CF 0x20 | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # Kernel Image write to eMMC | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fatload mmc 0:1 40008000 zImage-dtb | ||
+ | movi write kernel 1 40008000 | ||
+ | |||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # System Image write to eMMC | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fatload mmc 0:1 40000000 system.img | ||
+ | |||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # Userdata Image write to eMMC | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fatload mmc 0:1 57000000 userdata.img | ||
+ | |||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # Cache Image write to eMMC | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fatload mmc 0:1 61000000 cache.img | ||
+ | |||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # Partition Create to eMMC | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fdisk -c 1 | ||
+ | |||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fastboot flash system 40000000 1 | ||
+ | fastboot flash userdata 57000000 1 | ||
+ | fastboot flash cache 61000000 1 | ||
+ | |||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | # SD/eMMC FAT Format | ||
+ | #------------------------------------------------------------------------------------------------------ | ||
+ | fatformat mmc 1:1 | ||
+ | |||
+ | fastboot poweroff | ||
+ | </file> | ||
+ | |||
+ | <code> | ||
+ | $ sudo mkdir /media/[username]/fat32 | ||
+ | </code> | ||
+ | |||
+ | Copy update.zip and unzip update.zip | ||
+ | <code> | ||
+ | $ cp out/target/product/odroidxu3/update.zip . | ||
+ | $ unzip update.zip | ||
+ | $ ls update | ||
+ | bl1.bin bl2.bin cache.img ramdisk.img system.img tzsw.bin u-boot.bin userdata.img zImage zImage-dtb | ||
+ | </code> | ||
+ | |||
+ | Copy uboot directory. | ||
+ | <code> | ||
+ | $ cp -a device/hardkernel/odroidxu3/uboot . | ||
+ | </code> | ||
+ | |||
+ | <code> | ||
+ | $ ls | ||
+ | emmc sd sd2emmc uboot update update.zip | ||
+ | </code> | ||
+ | |||
+ | Run script | ||
+ | |||
+ | <file> | ||
+ | #!/bin/bash | ||
+ | |||
+ | sudo umount /media/[username]/fat32 | ||
+ | sudo losetup -d /dev/loop0 | ||
+ | |||
+ | # make image of loop devices filled zero. | ||
+ | echo "dd if=/dev/zero of=./installer.img count=1024000" | ||
+ | dd if=/dev/zero of=./installer.img count=1024000 | ||
+ | |||
+ | # mount loop devices. | ||
+ | echo "sudo losetup /dev/loop0 installer.img" | ||
+ | sudo losetup /dev/loop0 installer.img | ||
+ | |||
+ | # create partition table. | ||
+ | echo "sudo parted /dev/loop0 mktable msdos" | ||
+ | sudo parted /dev/loop0 mktable msdos | ||
+ | |||
+ | # make file-system. | ||
+ | echo "sudo parted /dev/loop0 mkpart primary fat32 105 525" | ||
+ | sudo parted /dev/loop0 mkpart primary fat32 90 525 | ||
+ | |||
+ | # format file-system. | ||
+ | echo "sudo mkfs.vfat -F 32 /dev/loop0p1" | ||
+ | sudo mkfs.vfat -F 32 /dev/loop0p1 | ||
+ | |||
+ | # fusing u-boot. | ||
+ | echo "pushd uboot" | ||
+ | pushd uboot | ||
+ | echo "./sd_fusing.sh /dev/loop0" | ||
+ | sudo ./sd_fusing.sh /dev/loop0 | ||
+ | echo "popd" | ||
+ | popd | ||
+ | |||
+ | # mount user fat partition. | ||
+ | echo "sudo mount /dev/loop0p1 /media/[username]/fat32/" | ||
+ | sudo mount /dev/loop0p1 /media/[username]/fat32/ | ||
+ | |||
+ | # copy android images and u-boot binaries. | ||
+ | echo "sudo cp update/* /media/[username]/fat32/" | ||
+ | sudo cp update/* /media/[username]/fat32/ | ||
+ | |||
+ | # eMMC | ||
+ | # copy script for eMMC. | ||
+ | echo "sudo cp emmc/boot.ini /media/[username]/fat32/" | ||
+ | sudo cp emmc/boot.ini /media/[username]/fat32/ | ||
+ | echo "sudo umount /media/[username]/fat32" | ||
+ | sleep 3 | ||
+ | sudo umount /media/[username]/fat32 | ||
+ | # dump binary | ||
+ | echo "sudo dd if=/dev/loop0 of=emmc/self-emmc.img count=1024000" | ||
+ | sudo dd if=/dev/loop0 of=emmc/self-emmc.img count=1024000 | ||
+ | |||
+ | # SD | ||
+ | # copy script for SD. | ||
+ | echo "sudo mount /dev/loop0p1 /media/[username]/fat32/" | ||
+ | sudo mount /dev/loop0p1 /media/[username]/fat32/ | ||
+ | echo "sudo cp sd/boot.ini /media/[username]/fat32/" | ||
+ | sudo cp sd/boot.ini /media/[username]/fat32/ | ||
+ | echo "sudo umount /media/[username]/fat32" | ||
+ | sleep 3 | ||
+ | sudo umount /media/[username]/fat32 | ||
+ | # dump binary | ||
+ | echo "sudo dd if=/dev/loop0 of=sd/self-sd.img count=1024000" | ||
+ | sudo dd if=/dev/loop0 of=sd/self-sd.img count=1024000 | ||
+ | |||
+ | # SD to eMMC | ||
+ | # copy script for SD to eMMC. | ||
+ | echo "sudo mount /dev/loop0p1 /media/[username]/fat32/" | ||
+ | sudo mount /dev/loop0p1 /media/[username]/fat32/ | ||
+ | echo "sudo cp sd2emmc/boot.ini /media/[username]/fat32/" | ||
+ | sudo cp sd2emmc/boot.ini /media/[username]/fat32/ | ||
+ | echo "sudo umount /media/[username]/fat32" | ||
+ | sleep 3 | ||
+ | sudo umount /media/[username]/fat32 | ||
+ | # dump binary | ||
+ | echo "sudo dd if=/dev/loop0 of=sd2emmc/sd2emmc.img count=1024000" | ||
+ | sudo dd if=/dev/loop0 of=sd2emmc/sd2emmc.img count=1024000 | ||
+ | |||
+ | # umount loop device. | ||
+ | echo "sudo losetup -d /dev/loop0" | ||
+ | sudo losetup -d /dev/loop0 | ||
+ | </file> |