I made dual booting image for ODROID-U3.
http://codewalkerster.blogspot.kr/2014/03/dual-booting-android-and-ubuntu-on.html?m=1
We will make dual booting image for ODROID-C2.
Make bootable android media(eMMC or SD).
http://odroid.com/dokuwiki/doku.php?id=en:c2_release_androidDownload ODROID-C2 Ubuntu Image.
http://odroid.com/dokuwiki/doku.php?id=en:c2_release_linux_ubuntuCopy rootfs and boot partition of ODROID-C2 Ubuntu to your desktop Ubuntu.
- mount disk wrote ODROID-C2 ubuntu image on your desktop PC.
$ mkdir odroid-c2_ubuntu
$ cd odroid-c2_ubuntu
$ mkdir boot
c2/ubuntu/ubuntu64-16.04lts-mate-od* on /media/codewalker/boot type vfat (ro,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks2)
c2/ubuntu/ubuntu64-16.04lts-mate-od* on /media/codewalker/rootfs type ext4 (ro,nosuid,nodev,uhelper=udisks2)
$ mkdir odroid-c2_ubuntu
$ cd odroid-c2_ubuntu
$ sudo cp -a /media/username/boot/* boot/
$ mkdir rootfs
$ sudo cp -a /media/username/rootfs/* rootfs/
- unmount ubuntu disk.
Delete rootfs/aafirstboot
$ rm -rf rootfs/aafirstboot
Edit rootfs/etc/fstab
$ sudo vi rootfs/etc/fstab
LABEL=VFAT /media/boot vfat defaults,rw,owner,flush,umask=000 0 0
Chagne userdata partition UUID.
- Insert disk wrote android image on your desktop PC and unmount /dev/sdX4.
$ sudo umount /dev/sdX4
$ cat rootfs/etc/fstab LABEL=VFAT /media/boot vfat defaults,rw,owner,flush,umask=000 0 0
UUID=e139ce78-9841-40fe-8823-96a304a09859 / ext4 errors=remount-ro,noatime 0 1
$ sudo tune2fs /dev/sdX4 -U e139ce78-9841-40fe-8823-96a304a09859
Copy ODROID-C2 Ubuntu files to android disk.
$ mv /media/username/VFAT/boot. ini /media/username/VFAT/boot. ini.android
$ cp boot/* /media/username/VFAT/
$ sudo cp rootfs/* /media/username/e139ce78-9841-40fe-8823-96a304a09859/ -a
$ sync
Make script to change OS.
in Ubuntu
$ vi boot_android.sh
------------------------------------------------------------------------
#!/bin/bash
sudo mv /media/boot/boot.ini /media/boot/boot.ini.ubuntu
sudo mv /media/boot/boot.ini.android /media/boot/boot.ini
sudo reboot
------------------------------------------------------------------------
#chmod +x boot_android.sh
------------------------------------------------------------------------
#chmod +x boot_android.sh
in Adnroid
$ su
# mount -o rw,remount /
# vi /system/bin/boot_ubuntu.sh
------------------------------------------------------------------------
------------------------------------------------------------------------
#!/bin/sh
mv /storage/internal/boot.ini /storage/internal/boot.ini.android
mv /storage/internal/boot.ini.ubuntu /storage/internal/boot.ini
reboot
------------------------------------------------------------------------
# chmod 777 /system/bin/boot_ubuntu.sh
# chmod 777 /system/bin/boot_ubuntu.sh