土曜日, 1月 12, 2013

Ubuntu Quantal Quetzal

自前でubootやfilesystemつくるとうまく動かない。bootのしくみ理解してないからなぁ。
仕組みが理解しやすそうなubuntuを使ってみよう。
Ubuntu Quantal Quetzalをdownloadして展開。以下のコマンドでSDcard作成。
  # ./setup_sdcard.sh --mmc /dev/sdc --uboot bone

I see...
fdisk -l:
Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
Disk /dev/sdc: 7951 MB, 7951351808 bytes

mount:
/dev/sda1 on / type ext3 (rw,errors=remount-ro,user_xattr)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
/dev/sdc2 on /tmp/tmp.CepIlLbXYQ/disk type ext4 (rw)

Are you 100% sure, on selecting [/dev/sdc] (y/n)? y

Debug: image has bone kernel support: v3.2.33-psp26
Debug: image has omap kernel support: v3.6.8-x4
Debug: image has panda 3.2 kernel support: v3.2.34-x15
Debug: ARM rootfs: armhf-rootfs-201211292037.tar
Debug: image has initrd.img:
Debug: image has device tree:
Debug: fdisk version:
fdisk (util-linux 2.20.1)

Downloading Device's Bootloader
-----------------------------
attempting to use rcn-ee.net for dl files [10 second time out]...
2013-01-12 20:06:22 URL:http://rcn-ee.net/deb/tools/latest/bootloader-ng [4422/4422] -> "/tmp/tmp.F7sJDwaGs0/dl/bootloader-ng" [1]
2013-01-12 20:06:23 URL:http://rcn-ee.net/deb/tools/beaglebone/MLO-beaglebone-v2013.01-rc2-r0 [76406/76406] -> "/tmp/tmp.F7sJDwaGs0/dl/MLO-beaglebone-v2013.01-rc2-r0" [1]
SPL Bootloader: MLO-beaglebone-v2013.01-rc2-r0
--2013-01-12 20:06:23--  http://rcn-ee.net/deb/tools/beaglebone/u-boot-beaglebone-v2013.01-rc2-r0.img
Resolving rcn-ee.net (rcn-ee.net)... 69.163.130.148
Connecting to rcn-ee.net (rcn-ee.net)|69.163.130.148|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 279020 (272K) [text/plain]
Saving to: `/tmp/tmp.F7sJDwaGs0/dl/u-boot-beaglebone-v2013.01-rc2-r0.img'

100%[===============================================================>] 279,020      293K/s   in 0.9s    

2013-01-12 20:06:24 (293 KB/s) - `/tmp/tmp.F7sJDwaGs0/dl/u-boot-beaglebone-v2013.01-rc2-r0.img' saved [279020/279020]

UBOOT Bootloader: u-boot-beaglebone-v2013.01-rc2-r0.img

Unmounting Partitions
-----------------------------

Using fdisk to create an omap compatible fatfs BOOT partition
-----------------------------

Command (m for help): Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): Partition number (1-4, default 1): First sector (2048-15529983, default 2048): Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-15529983, default 15529983): 
Command (m for help): Selected partition 1
Hex code (type L to list codes): Changed system type of partition 1 to e (W95 FAT16 (LBA))

Command (m for help): 
Disk /dev/sdc: 7951 MB, 7951351808 bytes
245 heads, 62 sectors/track, 1022 cylinders, total 15529984 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000ba3a8

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            2048      133119       65536    e  W95 FAT16 (LBA)

Command (m for help): 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.
Setting Boot Partition's Boot Flag
-----------------------------
Creating rootfs ext4 Partition
-----------------------------
Formating Boot Partition
-----------------------------
mkfs.vfat 3.0.12 (29 Oct 2011)
Formating rootfs Partition as ext4
-----------------------------
mke2fs 1.42 (29-Nov-2011)
Filesystem label=rootfs
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
481440 inodes, 1924608 blocks
96230 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1971322880
59 block groups
32768 blocks per group, 32768 fragments per group
8160 inodes per group
Superblock backups stored on blocks: 
 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

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

Populating Boot Partition
-----------------------------
`/tmp/tmp.F7sJDwaGs0/dl/MLO-beaglebone-v2013.01-rc2-r0' -> `/tmp/tmp.F7sJDwaGs0/disk/MLO'
`/tmp/tmp.F7sJDwaGs0/dl/MLO-beaglebone-v2013.01-rc2-r0' -> `/tmp/tmp.F7sJDwaGs0/disk/backup/MLO'
-----------------------------
`/tmp/tmp.F7sJDwaGs0/dl/u-boot-beaglebone-v2013.01-rc2-r0.img' -> `/tmp/tmp.F7sJDwaGs0/disk/u-boot.img'
`/tmp/tmp.F7sJDwaGs0/dl/u-boot-beaglebone-v2013.01-rc2-r0.img' -> `/tmp/tmp.F7sJDwaGs0/disk/backup/u-boot.img'
-----------------------------
Copying Kernel image:
`/home/ike/BOARDS/beaglebone/ubuntu-12.10-r2-minimal-armhf-2012-11-29/vmlinuz-3.2.33-psp26' -> `/tmp/tmp.F7sJDwaGs0/disk/zImage'
-----------------------------
Copying Kernel initrd:
`/home/ike/BOARDS/beaglebone/ubuntu-12.10-r2-minimal-armhf-2012-11-29/initrd.img-3.2.33-psp26' -> `/tmp/tmp.F7sJDwaGs0/disk/initrd.img'
-----------------------------
Copying uEnv.txt based boot scripts to Boot Partition
-----------------------------
`/tmp/tmp.F7sJDwaGs0/bootscripts/normal.cmd' -> `/tmp/tmp.F7sJDwaGs0/disk/uEnv.txt'
-----------------------------
kernel_file=zImage
initrd_file=initrd.img

console=ttyO0,115200n8

mmcroot=/dev/mmcblk0p2 ro
mmcrootfstype=ext4 rootwait fixrtc

boot_fstype=fat
xyz_load_image=${boot_fstype}load mmc 0:1 0x80300000 ${kernel_file}
xyz_load_initrd=${boot_fstype}load mmc 0:1 0x81600000 ${initrd_file}; setenv initrd_size ${filesize}
xyz_load_dtb=${boot_fstype}load mmc 0:1 0x815f0000 /dtbs/${dtb_file}

xyz_mmcboot=run xyz_load_image; run xyz_load_initrd; echo Booting from mmc ...

video_args=setenv video 
device_args=run video_args; run expansion_args; run mmcargs
mmcargs=setenv bootargs console=${console} ${optargs} ${video} root=${mmcroot} rootfstype=${mmcrootfstype} ${expansion}

optargs=
expansion_args=setenv expansion ip=${ip_method}
loaduimage=run xyz_mmcboot; run device_args; bootz 0x80300000 0x81600000:${initrd_size}

-----------------------------
Debug:
#!/bin/sh
format=1.0
board=BEAGLEBONE_A
bootloader_location=omap_fatfs_boot_part
dd_seek=
dd_bs=

boot_image=bootz
boot_script=uEnv.txt
boot_fstype=fat

serial_tty=ttyO0
kernel_addr=0x80300000
initrd_addr=0x81600000
load_addr=0x80008000
dtb_addr=0x815f0000
dtb_file=

usbnet_mem=

Debug: Adding Useful scripts from: https://github.com/RobertCNelson/tools
-----------------------------
Cloning into '/tmp/tmp.F7sJDwaGs0/disk/tools'...
remote: Counting objects: 395, done.
remote: Compressing objects: 100% (261/261), done.
remote: Total 395 (delta 228), reused 273 (delta 113)
Receiving objects: 100% (395/395), 55.11 KiB, done.
Resolving deltas: 100% (228/228), done.
-----------------------------
Debug: Contents of Boot Partition
-----------------------------
total 5.9M
-rwxr-xr-x  1 root root  75K  1月 12 20:06 MLO
-rwxr-xr-x  1 root root  281  1月 12 20:06 SOC.sh
drwxr-xr-x  2 root root 2.0K  1月 12 20:06 backup
drwxr-xr-x  2 root root 2.0K  1月 12 20:06 dtbs
-rwxr-xr-x  1 root root 3.0M  1月 12 20:06 initrd.img
drwxr-xr-x 10 root root 2.0K  1月 12 20:06 tools
-rwxr-xr-x  1 root root 273K  1月 12 20:06 u-boot.img
-rwxr-xr-x  1 root root  816  1月 12 20:06 uEnv.txt
-rwxr-xr-x  1 root root 2.6M  1月 12 20:06 zImage
-----------------------------
Finished populating Boot Partition
-----------------------------
Populating rootfs Partition
Please be patient, this may take a few minutes, as its transfering a lot of files..
-----------------------------
/home/ike/BOARDS/beaglebone/ubuntu-12.10-r2-minimal-armhf-2012-11-29/armhf-rootfs-201211292037.tar
 469MB 0:01:59 [3.93MB/s] [===========================================================>] 100%            
Transfer of Base Rootfs is Complete, now syncing to disk...
-----------------------------
Ubuntu: with no ethernet cable connected it can take up to 2 mins to login, removing upstart sleep calls...
-----------------------------
Ubuntu: to unfix: sudo sed -i -e 's:#sleep 20:sleep 20:g' /etc/init/failsafe.conf
Ubuntu: to unfix: sudo sed -i -e 's:#sleep 40:sleep 40:g' /etc/init/failsafe.conf
Ubuntu: to unfix: sudo sed -i -e 's:#sleep 59:sleep 59:g' /etc/init/failsafe.conf
-----------------------------
Ubuntu: Serial Login: fixing /etc/init/ttyO2.conf to use ttyO0
-----------------------------
Finished populating rootfs Partition
-----------------------------
setup_sdcard.sh script complete
-----------------------------
The default user:password for this image:
ubuntu:temppwd
-----------------------------
カードをboneにいれてreset button押下で見事boot成功。 ubuntu/temppwdでloginできた。

0 件のコメント: