Linaro 12.04 Ubuntu를 ODROID-PC에 올려 보겠습니다.
...
복구가 끝나면 /dev/sde2를 mount하여 rootfs를 pc로 복사 시킵니다.
android uboot을 사용하지만 partition 확인하는 부분을 제거하여 fastboot가 가능합니다.
http://dev.odroid.com/projects/ics#s-6.3
아래 사이트에서 uboot 소스를 받으시고 아래와 같이 고칩니다.
http://com.odroid.com/sigong/nf_file_board/nfile_board_view.php?keyword=&tag=&bid=94
common/cmd_fastboot.c
...
ptable[pcount].length = PART_SIZE_ROOTFS;
ptable[pcount].flags = FASTBOOT_PTENTRY_FLAGS_USE_MOVI_CMD;
pcount++;
#if 0
/* System */
get_mmc_part_info(dev_num, 2, &start, &count, &pid);
if (pid != 0x83)
...
ptable[pcount].length = count * CFG_FASTBOOT_SDMMC_BLOCKSIZE;
ptable[pcount].flags = FASTBOOT_PTENTRY_FLAGS_USE_MMC_CMD;
pcount++;
#endif
#if 1 // Debug
fastboot_flash_dump_ptn();
ODROID-PC는 LCD가 없고 HDMI만 있습니다.
따라서 HDMI 출력이 되도록 kernel에 작업해야 합니다.
Linaro에서 Origen 보드에 HDMI 출력이 가능하도록 작업을 하였습니다.
Origen의 kernel을 ODROID-PC의 H/W에 맞게 수정해 줘야 합니다.
tobetter님이 이 작업을 해주셨고 github에 올려 해 주셨습니다.
https://github.com/tobetter/hardkernel-linux
$ git clone git://github.com/tobetter/hardkernel-linux.git
Cloning into hardkernel-linux...
$make hardkernel_ubuntu_defconfig
make -j6 후 만들어진 zImage를 fastboot를 이용하여 write합니다.
Linaro Ubuntu의 rootfs가 매우 크기 때문에 ODROID-PC의 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
로 수정합니다.
setenv bootargs 'root=/dev/sda1 rw rootfstype=ext4 init=/sbin/init console=ttySAC1,115200 rootdelay=10'