560
edits
Changes
From IGEP - ISEE Wiki
no edit summary
<div style="text-align: left;">First of all it is important to detect which device is our microSD Card. In order to do that we can follow this instructions in a Linux terminal:</div>
<div style="text-align: left; padding-left: 30px;">'''1-''' Clean the ''dmesg'' information:</div>
sudo dmesg -c<div style="text-align: left; padding-left: 30px;">'''2-''' Insert the microSD Card and show the ''dmesg'' information:</div> dmesg<div style="text-align: left;">The result have to be similar to this:</div>[[File:SD1_.png]]
dmesgThe result have to be similar to this: [[File:dev.png]] <div style="text-align: left;">We can see the name of our device in the system: '''/dev/sdX''' where X is the character assigned by our system, in this case /dev/sdsdc'''e.'''</div>
<div style="text-align: left;">Now we have to ensure that the MicroSD Card is completely clean. We can use the following command to do that:</div>
sudo dd if=/dev/zero of=/dev/sdX bs=1024 count=1024<div style="text-align: left;">Where '''X''' is the character returned previously by your system, for example, in the previous situation:</div> sudo dd if=/dev/zero of=/dev/sde sdc bs=1024 count=1024Before use anyway of partition one good practise is unmount the dev where is inserted the SD. -> <div style="text-align: left;"code>umount /dev/sdx</code> Now we are ready to create the corresponding partitions in our MicroSD Card.</div>
==How to partition the MicroSD card==
<span class="mw-headline">It is important to difference between a MicroSD Card for a NXP processor and the other cases. The process of partition is similar but, in the case of NXP chips, there exists some differences. </span>
==='''<span class="mw-headline">General case processUsing Gparted:</span>'''==={| class="contenttable sortable"|-!|====='''<span classGENERAL CASE'''=====!|====="mw-headline">Finding your device</span>'''NXP PROCESSORS'''=====|-||'''1- '''Select the corresponding device||'''1- '''Select the corresponding device|-||<span class="mw-headline">[[File:1.png|733x318px429x186px]]</span> ===='''||<span class="mw-headline">Create the MSDOS Partition Table [[File:1.png|413x179px]]</span>|-||'''2- '''Create a partition table||'''2- ''===='Create a partition table|-||<span class="mw-headline">The next step it's create the msdos table partition for it you should click in the "Device" menu and then in the "Create Partition Table" option[[File:2. png|430x202px]]</span> <span class="mw-headline">[[File:2SD4.png|733x345px433x298px]]</span> ===='''||<span class="mw-headline">Erasing all data[[File:2.png|418x197px]]</span>'''====<span class="mw-headline">Check the default option it's create a msdos partition table[[File:SD4.png|431x297px]]</span>|-||'''<span class="mw-headline"><br />3- </span>''' After that you can '''Apply'''. <span class="mw-headline">[[File:SD4.png|717x494px]]Create a FAT32 '''boot '''partition</span> ===='''||<span class="mw-headline">Creating the '''3- '''Create a FAT32 '''boot '''partition'''leaving 8MB before'''</span>'''====|-||<span class="mw-headline">The Next step it's create the partitions for it you should go to the partition menu and select the "New" option then the application show a window like this[[File:2.png|432x203px]]</span>[[File:fat32_c121.png|429x293px]]
We will configure the partition as:
* Free Space Preceding: 1MB
* Primary Partition
* File system/ Format: FAT32
* Size: 100 MegaBytesMB* Label: '''Boot'''
* '''Align to: cylinder'''
We will configure the partition as:
* Free Space Preceding: '''8MB'''
* Primary Partition
* File system/ Format: FAT32* Free Space Preceding: 8 MiB* Size: 100 MegaBytesMB* Label: '''Boot'''* '''Align to: cylinder'''
[[File:fat32_c5.png|432x291px]]
[[File:fat32_c5.png|431x291px]]
|-
||'''7-''' Check the results are similar to the followings:
||'''7-''' Check the results are similar to the followings:
|-
||[[File:fat32_c6.png|434x294px]]
||[[File:im_3.png|438x301px]]
|}
==='''Using SFDISK & MKFS<br />'''===
Another method is to use the following commands in order to prepare the microSD card. These commands will perform the same operations that in the previous part.
{| class="contenttable sortable" style="width: 890px;"
|-
! style="width: 431.367px;"|GENERAL CASE
! style="width: 436.633px;"|NXP PROCESSORS
|-
| style="width: 431.367px;"|
sudo sfdisk /dev/ <<EOF<br>label: dos<br>63,144522,0x0C,*<br>160650,,,-<br>EOF
| style="width: 436.633px;"|
sudo sfdisk /dev/ <<EOF<br>label: dos<br>16065,128520,0x0C,*<br>144585,,,-<br>EOF
|-
| style="width: 431.367px;"|
sudo mkfs.vfat -F32 /dev/ -n boot
| style="width: 436.633px;"|
sudo mkfs.vfat -F32 /dev/ -n boot
|-
| style="width: 431.367px;"|
sudo mkfs.ext4 /dev/ -L rootfs
| style="width: 436.633px;"|
sudo mkfs.ext4 /dev/ -L rootfs
|-
| style="width: 431.367px;"|'''For example:'''
| style="width: 436.633px;"|'''For example:'''
|-
| style="width: 431.367px;"|
sudo sfdisk /dev/<strong>sdc</strong> <<EOF<br data-attributes="%20/">label: dos<br data-attributes="%20/">63,144522,0x0C,*<br data-attributes="%20/">160650,,,-<br data-attributes="%20/">EOF<br><br>sudo mkfs.vfat -F32 /dev/<strong>sdc1</strong> -n boot<br data-attributes="%20/"><br data-attributes="%20/">sudo mkfs.ext4 /dev/<strong>sdc2</strong> -L rootfs<br><br>
| style="width: 436.633px;"|
sudo sfdisk /dev/<strong>sdc</strong> <<EOF<br data-attributes="%20/">label: dos<br data-attributes="%20/">16065,128520,0x0C,*<br data-attributes="%20/">144585,,,-<br data-attributes="%20/">EOF<br><br>sudo mkfs.vfat -F32 /dev/<strong>sdc1</strong> -n boot<br><br>sudo mkfs.ext4 /dev/<strong>sdc2</strong> -L rootfs<br><br>
|}
='''How to boot each partcopy everything into the MicroSD Card<br />'''=Now we will see where Once the MicroSD is completely prepared, it is time to put each part copy the u-boot, kernel and how root dile system tothe MicroSD Card.
==U-Boot==
After build or download the MLO and u-boot you should follow the next steps:
* Copy MLO and u-boot.img to primary into the ''root folder'' of the '''boot partition''' <pre>cp [your_u-boot_directory]/u.boot.img /media/user/boot
</pre>
You can follow this post [[How to prepare a bootable MicroSD CardThe bootloader U-Boot|linkU-boot Bootloader]] if you want build the MLO and u-boot
* Copy u-boot.imx using dd before primary partition in raw mode as
<pre>sudo dd ifsudo dd if=/home/user/u[your_u-boot-imxboot_directory]/u-boot.imx of=/dev/sde [your_sd] bs=512 seek=2</pre><u>Where /dev/sde is your microsd card</u> You can follow this post [[How to prepare a bootable MicroSD CardThe bootloader U-Boot|linkU-boot Bootloader]] you want build the u-boot.imx
'''How to configure Uenv<br />'''
We present two examples of help to start the system from the MicroSD Card or from an nfs server.
* If we want boot from the bootable microSD Card. [http://downloads.isee.biz/pub/relaunch/uenv.txt uenv.txt]
* If we want boot from nfs server. [http://downloads.isee.biz/pub/relaunch/uenv_nfs.txt uenv.txt]
===<span id="Create_the_Rootfs_mount_point" class="mw-headline">Create the Rootfs mount point</span>=Root file System==Go The root file system have to /media directory and create one sub-be extracted into the'' root folder called "binary" <pre>cd /media sudo mkdir binary</pre>===<span id="Mount_the_RootFS_partition" class="mw-headline">Mount the RootFS partition</span>===Mount '' of the '''rootfs ''' '''partition using the 'binary' directory <pre>$ media > sudo mount /dev/mmcblkp2 /media/binary</pre>===<span id="Untar_the_rootfs_package" class="mw-headline">Untar the rootfs package</span>===Copy "linaro-m-headless-tar-20101108-2'.tar.gz" file inside the /media directory and untar the file <pre>$ media > sudo tar xvfz linaro-m-headless-tar-20101108-2.tar.gz<Where can be [http:/pre><br /> Now you should see inside your rootfs partition a similar structure like thislabs. <div class="center"><div class="thumb tnone"><div class="thumbinner" style="width: 302px;"><div class="thumbcaption"><div class="magnify"></div></div></div></div></div>===<span id="Install_the_kernel_modules" class="mw-headline">Install the kernel modules</span>===Now you should install your kernel modules inside your root file systemisee. <pre>$ media > cd biz/home/jdoe/linux-omap-2index.6 $ /homephp/jdoe/linuxIGEP_Firmware_set-omap-2.6> sudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- modules_install INSTALL_MOD_PATH=/media/binary</pre>Alternatively if you up downloaded the binary package uncompress it inside the directory /media/binary ===<span id="Install_the_kernel_Image" class="mw-headline">Install the kernel Image</span>===Just copy the zImage inside your boot partition, remember before that you must mount your mmc boot partitionhere. <pre>$ /home/jdoe/linux-omap-2.6> sudo cp arch/arm/boot/zImage /media/boot/if you're using dtb kernel as 3.8.y you must copy the dtb too.$ /home/jdoe/linuz-omap-2.6> sudo cp arch/arm/boot/dtbs/omap5-igep0050.dtb /media/boot </pre>After that you can unmount the boot & rootfs partitions. Now we're ready for test our new microsd card ==Kernel & Modules==You can follow this other howto about [index.php/The_Linux_kernel how compile and install the Linux Kernel].