Esto ya tiene poca utilidad,pero me parecio interesante pues aprendi varias cosas bastante utiles.
The Pre's flash disk appears to the device as a MMC and uses the standard fdisk partition scheme, with a MBR-like structure in the first block. There
are three partitions:
1. type 0xf0 start 0x00000400 size 0x00002000 NVRAM and Tokens
2. type 0x83 start 0x00002400 size 0x00010000 /boot (ext3)
3. type 0x8e start 0x00012400 size 0x00f3dc00 Logical Volumes
The space between the MBR and the first partition are used to store the bootloader (Bootie). The /boot partition contains the linux kernel (in uImage
format), a copy of the bootloader and the minimal userland required to start the LVM and to pivot the root to /dev/mapper/store-root and perform the
"real" boot from there
Boot Manager (type 0xF0), located anywhere on the disk. It can be primary partition or a logical disk inside the extended partition. The boot manager
will be written to this partition.
Problem :the filesystem size is bad on this post!!it is imposible create ext2 or fat filesystem on 2 as example.
The right sizes was:
1./dev/mmcblk0p1 defined as a Linux/PA-RISC boot partition is only 4MB
2. /dev/mmcblk0p2 defined as a Linux partition and is 32MB mounted as /boot
3./dev/mmcblk0p3 defined as a Linux LVM partition is 7.62GB
I created a void file:
>dd if=/dev/zero of=mmcblk0 bs=32M count=250
used parted to partition:
>parted mmcblk0
>>mkpartfs primary ext2 0 4M
>>mkpartfs primary ext2 3998kB 32M
>>mkpartfs primary ext2 32,0MB 7.62GB
>>quit
use fdisk to change the kind of partition:
>fdisk
>>t 1 f0
>>t 2 83
>>l
Disposit. Inicio Comienzo Fin Bloques Id Sistema
mmcblk0p1 1 61 3888 f0 inicio Linux/PA-RISC
mmcblk0p2 62 488 27328 83 Linux
mmcblk0p3 489 106812 6804736 8e Linux LVM
(the name is similar to kernel seems use)
After give the format.The problem is a file and you can not do simply :
mkfs.ext3 mmcblk0p2
Accessing raw images with partitions "inside" is a bit tricky. Still this links explains it:
Basically you "simulate" a block device /dev/loop0 for your file with the command:
>losetup /dev/loop1 mmcblk0
if i do :
>fdisk -l /dev/loop1
Disco /dev/loop1: 8388 MB, 8388608000 bytes
4 cabezas, 32 sectores/pista, 128000 cilindros
Unidades = cilindros de 128 * 512 = 65536 bytes
Identificador de disco: 0x00080655
Disposit. Inicio Comienzo Fin Bloques Id Sistema
/dev/loop1p1 1 61 3888 f0 inicio Linux/PA-RISC
/dev/loop1p2 62 488 27328 83 Linux
/dev/loop1p3 489 106812 6804736 8e Linux LVM
now i need map the "partitions" for mount and/or give filesystem.(for mount you could do it easily with the offset on loop.
kpartx -av /dev/loop1
and now i have the partition as if they were on a hd!!!
>ls -alF /dev/mapper
total 0
drwxr-xr-x 2 root root 120 2010-06-10 18:45 ./
drwxr-xr-x 15 root root 4180 2010-06-10 18:45 ../
crw-rw---- 1 root root 10, 60 2010-04-05 11:54 control
brw-rw---- 1 root disk 252, 0 2010-06-10 18:45 loop1p1
brw-rw---- 1 root disk 252, 1 2010-06-10 18:45 loop1p2
brw-rw---- 1 root disk 252, 2 2010-06-10 18:45 loop1p3
format
>mkfs.ext3 /dev/mapper/loop1p1 // i dont know if they are ext but when insert bootloader could change this.
>mkfs.ext3 /dev/mapper/loop1p2
And finally the LVM part.
I had to install lvm2 ,be carefull when finished desinstall .i am not expert with lvm but when installed it wanna change something on initrd.
I wanna as LVM physical volume (PV) all partition loop1p3
>pvcreate /dev/mapper/loop1p3
and i need the name was store (it mount on /dev/store/...).create the (VG)
>vgcreate store /dev/mapper/loop1p3
finally the "partitions" (LV)
>lvcreate -L 456M -n root store
>lvcreate -L 256M -n var store
>lvcreate -L 56M -n update store
>lvcreate -L 40M -n log store
>lvcreate -L 128M -n swap store
>lvcreate -L 5,57G -n media store //the free space
now the /dev/mmcblk0p3 partition should be a Linux Volume Group that is sliced into six Logical Volumes
Format:
>mkfs.ext3 -v /dev/store/log
>mkfs.ext3 -v /dev/store/media
>mkfs.ext3 -v /dev/store/root
>mkfs.ext3 -v /dev/store/var
>mkfs.ext3 -v /dev/store/update
>mkswap /dev/store/swap
(i can see the "partitions" with pvdisplay )
and unmount
>lvremove store
(yes all questions)
>kpartx -d /dev/loop1
>losetup -d /dev/loop1
desinstall lvm2 for avoing problems
>apt-get remove lvm2
compress the file
>tar cvjf mmcblk0.tar.bz2 mmcblk0
//Also i think maybe i could be used qemu image and after conver to raw:
qemu-img convert -f vmdk converted.vmdk -O raw converted.raw
Poblate the filesystem (work in progress)
Sobre todo kpartx ,losetup,lvm
THREE:load on qemu
First grab qemu omap3
I used :
qemu-omap3-v0.01.tar.bz2
>cd qemu-omap3
>./configure --target-list=arm-softmmu
>make
qemu-system-arm will be generated in directory qemu-omap3/arm-softmmu.
I copy on /usr/bin
We have some ways of load with qemu:
1)Using it as SDCARD ( i belive it is the easier way because the root devices names)
>qemu-system-arm -M beagle -sd mmcblk0 -append "root=/dev/mmcblk0
question:how to add the boot loader??
b)nandflash
(i am going to use the beagle'boards files because the loader is similar.the uImage i tried with older filesystem was nova-cust-image-castle)
>bb_nandflash.sh x-load.bin.ift webos.bin x-loader
>bb_nandflash.sh u-boot.bin webos.bin u-boot
>bb_nandflash.sh uImage webos.bin kernel
>bb_nandflash.sh mmcblk0 webos rootfs
>bb_nandflash_ecc webos.bin 0x0 0xe80000
>qemu-system-arm -M beagle -mtdblock mmcblk0
c)using a kernel ,ramdisk with our filesystem
qemu-system-arm -M versatilepb -cpu cortex-a8 -kernel uImage.bin -initrd ramdisk.bin -append boot-device=RAMDISK,rdoffset=0x200
No hay comentarios:
Publicar un comentario