Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
en:xu3_building_android [2017/01/04 17:07] odroid [Android Platform] |
en:xu3_building_android [2017/05/17 14:47] codewalker [XU4] |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Android ====== | ====== Android ====== | ||
- | This page introduce how you can download and compile the Android kernel for **ODROID-XU3**. | + | This page introduce how you can download and compile the Android kernel for **ODROID-XU3/XU4**. \\ |
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. | ||
+ | |||
+ | <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.\\ | ||
+ | </WRAP> | ||
+ | |||
+ | <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. \\ | ||
+ | http://source.android.com/source/requirements.html#hardware-requirements | ||
+ | |||
+ | 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. \\ | ||
+ | </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 61: | Line 75: | ||
[[http://source.android.com/source/downloading.html]] | [[http://source.android.com/source/downloading.html]] | ||
- | * Downloaded source code size is around 58GB. Prepare enough space before building the Android source code. | + | * Downloaded Android full source code size is around 58GB. Prepare enough space before building the Android platform. |
</WRAP> | </WRAP> | ||
Line 84: | Line 98: | ||
Once you complete the long build process, the img files can be found in "out/target/product/odroidxu3/update" directory. | Once you complete the long build process, the img files can be found in "out/target/product/odroidxu3/update" directory. | ||
- | ===== adb over TCPIP ===== | + | ===== adb over TCPIP (Ethernet port) ===== |
==== device console ==== | ==== device console ==== | ||
Get device's IP. | Get device's IP. | ||
Line 519: | Line 533: | ||
# SD/eMMC FAT Format | # SD/eMMC FAT Format | ||
#------------------------------------------------------------------------------------------------------ | #------------------------------------------------------------------------------------------------------ | ||
+ | mmcinfo 1 | ||
fatformat mmc 1:1 | fatformat mmc 1:1 | ||
Line 545: | Line 560: | ||
| /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> |