6AM SD card boot

=Introduction=

This page gives info on how to boot 6AM.1.x Marshmallow images out of SD card.

=Prerequisite= You have built all components by following the 6AM.1.x release notes

=Preparing Android SD Card Image=

Prepare boot partition files
cd $MYDROID/out/target/product/jacinto6evm mkdir boot cp ${YOUR_PATH}/kernel/android-3.14/arch/arm/boot/uImage boot/ cp ${YOUR_PATH}/kernel/android-3.14/arch/arm/boot/dts/dra7*.dtb boot/ cp ${YOUR_PATH}/u-boot/u-boot.img boot/ cp ${YOUR_PATH}/u-boot/MLO boot/

Prepare file system
cd $MYDROID/out/target/product/jacinto6evm mkdir fs cp -Rfp root/* fs/ cp -Rfp system fs/ cp -Rfp data fs/

Hack change for SD card support in Android

 * Edit the $MYDROID/out/target/product/jacinto6evm/fs/init.jacinto6evmboard.rc file with below changes for SD card support

diff --git a/init.jacinto6evmboard.rc b/init.jacinto6evmboard.rc index 67619b5..184693e 100644 --- a/init.jacinto6evmboard.rc +++ b/init.jacinto6evmboard.rc @@ -8,6 +8,12 @@ on init symlink /sdcard /mnt/sdcard symlink /sdcard /storage/sdcard0

+on post-fs +   # HACK: for SD card boot mounting rootfs as rw and setuid for su +    mount rootfs rootfs / rw remount +   chmod 6755 /system/xbin/su +   chown dhcp shell /system/etc/dhcpcd/dhcpcd-run-hooks + on post-fs-data

mkdir /data/media 0770 media_rw media_rw

diff --git a/fstab.jacinto6evmboard b/fstab.jacinto6evmboard index 21fa0d2..8db1e95 100644 --- a/fstab.jacinto6evmboard +++ b/fstab.jacinto6evmboard @@ -3,11 +3,11 @@
 * Edit the $MYDROID/out/target/product/jacinto6evm/fs/fstab.jacinto6evmboard file with below changes for SD card support
 * 1) The filesystem that contains the filesystem checker binary (typically /system) cannot
 * 2) specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK

-/dev/block/platform/44000000.ocp/480b4000.mmc/by-name/system          /system         ext4    ro                      wait -/dev/block/platform/44000000.ocp/480b4000.mmc/by-name/efs             /factory        ext4    ro                      wait -/dev/block/platform/44000000.ocp/480b4000.mmc/by-name/cache           /cache          ext4    noatime,nosuid,nodev    wait,check -/dev/block/platform/44000000.ocp/480b4000.mmc/by-name/userdata        /data           ext4    noatime,nosuid,nodev    wait,check -/dev/block/platform/44000000.ocp/480b4000.mmc/by-name/recovery        /recovery       emmc    defaults                defaults +#/dev/block/platform/44000000.ocp/480b4000.mmc/by-name/system         /system         ext4    ro                      wait +#/dev/block/platform/44000000.ocp/480b4000.mmc/by-name/efs            /factory        ext4    ro                      wait +#/dev/block/platform/44000000.ocp/480b4000.mmc/by-name/cache          /cache          ext4    noatime,nosuid,nodev    wait,check +#/dev/block/platform/44000000.ocp/480b4000.mmc/by-name/userdata               /data           ext4    noatime,nosuid,nodev    wait,check +#/dev/block/platform/44000000.ocp/480b4000.mmc/by-name/recovery               /recovery       emmc    defaults                defaults

/devices/44000000.ocp/488c0000.omap_dwc3_2/488d0000.usb*      auto    auto    defaults        voldmanaged=usb0:auto /devices/44000000.ocp/48880000.omap_dwc3_1/48890000.usb*      auto    auto    defaults        voldmanaged=usb1:auto

Formatting SD card
You will need to format your SD for the Linux file system. Connect your micro SD memory card reader with memory card inserted to a USB port on your Linux Ubuntu PC.

There is a shell script that performs all of the formatting required. Download it with:

$ wget http://cgit.openembedded.org/cgit.cgi/openembedded/plain/contrib/angstrom/omap3-mkcard.sh

Add execution permission:

$ chmod +x omap3-mkcard.sh

And you are ready to use it by just typing:

$sudo ./omap3-mkcard.sh 

Once it has finished, remove and reinsert the micro SD card. If you are logged in graphically, "/media/boot" and "/media/Angstrom" will be automatically mounted. Otherwise you will need to mount them manually.

Installing the required files to micro SD
Assuming your micro SD card is mounted on "/media/boot" and "/media/Angstrom", use the following commands to populate the card:

cd $MYDROID/out/target/product/jacinto6evm sudo cp -rf boot/* /media/boot/ sudo cp -rf fs/* /media/Angstrom/ sync

After copying the files to micro SD card, unmount the partitions and your SD card is ready for use.

=Boot instructions for SD card=

Hit any key to stop autoboot: 3
 * Boot the board with SD card inserted
 * Power on the board and stop the board at u-boot prompt by interrupting with key press
 * Type in the following commands to boot out of SD card (Note that you may have to change the dtb file name based on board you are using)