Installing, Building, and Running Yocto*
Getting Started Guide
47
Caution: The following commands assume that your flash drive is /dev/sdf. Modify the
commands if necessary. Failure to use the correct path for the target drive may result in loss of
data.
Clone the image into the flash drive as follows:
# sudo dd if=/dev/zero of=/dev/sdb bs=1M count=512
# sudo sync
# sudo dd if=<path_to>/<image_name>.hddimg of=/dev/sdf
# sudo sync
# sudo eject /dev/sdf
6.2.2.2
Creating a SATA Boot Disk
Identify the device name for your SATA disk. In a typical case, this will be /dev/sdb. Study
the output of one or more of the following commands to give confidence as to which disk
is which:
# sudo parted -l # df -h
# cat /proc/partitions
Note:
The following commands assume that the target SATA drive is /dev/sdb. Modify the
commands if necessary. Failure to use the correct path for the target drive may result in loss of data.
Determine the physical characteristics of the target disk:
# fdisk /dev/sdb
At the fdisk prompt, enter p to print out the physical characteristics of the disk. The output
will include the information on the number of heads, sectors per tracks, and number of
cylinders. Save this information for the next step.
Enter q to exit the fdisk prompt.
Create the correct partition table and partition, substituting the correct value from the
previous step for the number of cylinders, heads, and sectors per track.
# mkdiskimage -4 /dev/sdb <cylinders> <heads> <sectors_per_track>
The command above creates a FAT32, bootable partition 4.
This command may take an hour or more for large disks. Choose a smaller value for the
number of cylinders (for instance, 1024) to complete the command faster.
Note:
If mkdiskimage is not available on your system, you can use other software (for instance,
parted ) to create the partition table and the partition. The partition should be FAT32 with only the
boot flag set. If your partition number is not 4, you should replace the remaining sdb4 references in this
section with the sdb<#> that corresponds to your partition number.
Copy the contents of the
hddimg
to the device:
# mkdir /tmp/Yocto-image
# mkdir /tmp/Yocto-hdd
# mount -o loop <path_to>/<img_file.hddimg> /tmp/Yocto-image
# mount /dev/sdb4 /tmp/Yocto-hdd
# cp -rf /tmp/Yocto-image/* /tmp/Yocto-hdd
Install the syslinux boot loader:
# syslinux /dev/sdb4