2012년 4월 25일 수요일

ODROID-A에 Linaro Ubuntu 올리기...

ODROID-A에 Linaro Ubuntu를 올려보겠습니다.

http://www.linaro.org/downloads/1203

위 사이트에서 Ubuntu Origen을 선택합니다.

http://releases.linaro.org/12.03/ubuntu/leb-origen/


Building a Custom Image 방법대로 f-flash에 복구합니다.


[~/projects/linaro_ubuntu]$ sudo linaro-media-create --mmc /dev/sde --dev origen --hwpack hwpack_linaro-leb-origen_20120327-1_armel_supported.tar.gz --binary linaro-o-ubuntu-desktop-tar-20120327-0.tar.gz
/usr/lib/pymodules/python2.6/argparse.py:1576: DeprecationWarning: The "version" argument to ArgumentParser is deprecated. Please use "add_argument(..., action='version', version="N", ...)" instead
  """instead""", DeprecationWarning)

I see...
Device           Mount point      Size
/dev/sda         none             610480MB
/dev/sda1        /                95366MB
/dev/sda2        none             515112MB
/dev/sda5        none             10869MB
/dev/sda6        /home            504243MB
/dev/sdb         none             476940MB
/dev/sdb1        none             476937MB
/dev/sdc         none             0MB
/dev/sdd         none             0MB
/dev/sde         none             7647MB
/dev/sde1        none             5827MB
/dev/sde2        none             515MB
/dev/sde3        none             1030MB
/dev/sde4        none             134MB
Are you 100% sure, on selecting [/dev/sde] (y/n)? y
...

복구가 끝나면 /dev/sdx2를 mount하여 rootfs를 pc로 복사 시킵니다.

ODROID-A 복구한 t-flash를 준비하고 kernel을 수정하여 write해야 합니다.

ODROID-A 커널 폴더에서 make menuconfig합니다.
    Device Drivers  ---> 
        Character devices  --->      
            [*] Virtual terminal

CONFIG_VT를 체크합니다.

추가로 현재 ODROID-A에 CONFIG_HID가 빠져 있어서 USB Mouse와 keyboard를 사용하기 위해 같이 체크 해 주세요.

make -j6 후 만들어진 zImage를 fastboot를 이용하여 write합니다.

Linaro Ubuntu의 rootfs가 매우 크기 때문에 ODROID-A의 partition table을 다시 만들어야 합니다.

[~/projects/linaro_ubuntu]$ sudo fdisk /dev/sde

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): p

Disk /dev/sde: 8018 MB, 8018460672 bytes
255 heads, 60 sectors/track, 1023 cylinders
Units = cylinders of 15300 * 512 = 7833600 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1             235        1014     5967000    c  W95 FAT32 (LBA)
/dev/sde2              10          78      527850   83  Linux
/dev/sde3              79         216     1055700   83  Linux
/dev/sde4             217         234      137700   83  Linux

Partition table entries are not in disk order

ODROID-A의 Partition입니다.


Command (m for help): d
Partition number (1-4): 1

Command (m for help): d
Partition number (1-4): 2

Command (m for help): d
Partition number (1-4): 3

Command (m for help): d
Selected partition 4

partition을 다 지웁니다.


Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (1-1023, default 1): 11
Last cylinder, +cylinders or +size{K,M,G} (11-1023, default 1023): +4G

Command (m for help): p

Disk /dev/sde: 8018 MB, 8018460672 bytes
255 heads, 60 sectors/track, 1023 cylinders
Units = cylinders of 15300 * 512 = 7833600 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sde2              11         559     4199850   83  Linux

11번 cylinder부터 2번째 partition을 하나 만듭니다. 이 영역에 rootfs를 복사 할 것입니다.


Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1023, default 1): 560
Last cylinder, +cylinders or +size{K,M,G} (560-1023, default 1023): 
Using default value 1023

Command (m for help): p

Disk /dev/sde: 8018 MB, 8018460672 bytes
255 heads, 60 sectors/track, 1023 cylinders
Units = cylinders of 15300 * 512 = 7833600 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1             560        1023     3549600   83  Linux
/dev/sde2              11         559     4199850   83  Linux

그리고 vfat으로 만들 partition을 만듭니다.


Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): l

 0  Empty           24  NEC DOS         81  Minix / old Lin bf  Solaris        
 1  FAT12           39  Plan 9          82  Linux swap / So c1  DRDOS/sec (FAT-
 2  XENIX root      3c  PartitionMagic  83  Linux           c4  DRDOS/sec (FAT-
 3  XENIX usr       40  Venix 80286     84  OS/2 hidden C:  c6  DRDOS/sec (FAT-
 4  FAT16 <32M      41  PPC PReP Boot   85  Linux extended  c7  Syrinx         
 5  Extended        42  SFS             86  NTFS volume set da  Non-FS data    
 6  FAT16           4d  QNX4.x          87  NTFS volume set db  CP/M / CTOS / .
 7  HPFS/NTFS       4e  QNX4.x 2nd part 88  Linux plaintext de  Dell Utility   
 8  AIX             4f  QNX4.x 3rd part 8e  Linux LVM       df  BootIt         
 9  AIX bootable    50  OnTrack DM      93  Amoeba          e1  DOS access     
 a  OS/2 Boot Manag 51  OnTrack DM6 Aux 94  Amoeba BBT      e3  DOS R/O        
 b  W95 FAT32       52  CP/M            9f  BSD/OS          e4  SpeedStor      
 c  W95 FAT32 (LBA) 53  OnTrack DM6 Aux a0  IBM Thinkpad hi eb  BeOS fs        
 e  W95 FAT16 (LBA) 54  OnTrackDM6      a5  FreeBSD         ee  GPT            
 f  W95 Ext'd (LBA) 55  EZ-Drive        a6  OpenBSD         ef  EFI (FAT-12/16/
10  OPUS            56  Golden Bow      a7  NeXTSTEP        f0  Linux/PA-RISC b
11  Hidden FAT12    5c  Priam Edisk     a8  Darwin UFS      f1  SpeedStor      
12  Compaq diagnost 61  SpeedStor       a9  NetBSD          f4  SpeedStor      
14  Hidden FAT16 <3 63  GNU HURD or Sys ab  Darwin boot     f2  DOS secondary  
16  Hidden FAT16    64  Novell Netware  af  HFS / HFS+      fb  VMware VMFS    
17  Hidden HPFS/NTF 65  Novell Netware  b7  BSDI fs         fc  VMware VMKCORE 
18  AST SmartSleep  70  DiskSecure Mult b8  BSDI swap       fd  Linux raid auto
1b  Hidden W95 FAT3 75  PC/IX           bb  Boot Wizard hid fe  LANstep        
1c  Hidden W95 FAT3 80  Old Minix       be  Solaris boot    ff  BBT            
1e  Hidden W95 FAT1
Hex code (type L to list codes): c
Changed system type of partition 1 to c (W95 FAT32 (LBA))

vfat으로 변환합니다.


Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.

저장하고 나옵니다.


[~/projects/linaro_ubuntu]$ sudo mkfs.ext4 /dev/sde2
mke2fs 1.41.11 (14-Mar-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
262944 inodes, 1049962 blocks
52498 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1077936128
33 block groups
32768 blocks per group, 32768 fragments per group
7968 inodes per group
Superblock backups stored on blocks: 
32768, 98304, 163840, 229376, 294912, 819200, 884736

Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 35 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[~/projects/linaro_ubuntu]$ sudo mkfs.vfat /dev/sde1
mkfs.vfat 3.0.7 (24 Dec 2009)
[~/projects/linaro_ubuntu]$ 

두 partition을 format합니다.


[~/projects/linaro_ubuntu]$ sudo mount /dev/sde2 /media/microSD/
[~/projects/linaro_ubuntu]$ sudo cp -a rootfs/* /media/microSD/

복사해 놓은 rootfs를 t-flash에 복사합니다.


uboot에서 bootargs와 bootcmd를 아래와 같이 수정 합니다.
EXYNOS4 # setenv bootcmd 'movi read kernel 0 40008000;bootm 40008000'
EXYNOS4 # setenv bootargs 'root=/dev/mmcblk0p2 rw rootfstype=ext4 init=/sbin/init console=ttySAC2,115200 rootdelay=1'
EXYNOS4 # sav

EXYNOS4 # pri
baudrate=115200
bootargs=root=/dev/mmcblk0p2 rw rootfstype=ext4 init=/sbin/init console=ttySAC21
bootcmd=movi read kernel 0 40008000;bootm 40008000
bootdelay=1
ethaddr=00:40:5c:26:0a:5b
gatewayip=192.168.0.1
ipaddr=192.168.0.20
netmask=255.255.255.0
serverip=192.168.0.10

Environment size: 309/16380 bytes
EXYNOS4 # boot


오늘 Linaro 12.04가 release 되었네요.

동일한 방법으로 Ubuntu 12.04LTS 올렸습니다.

12.04에 HDMI가 가능하다고 하는데 kernel을 poriting 해야 합니다. 전 give up...



댓글 쓰기