NAME | start block | size |
MBR | 0 | 1 block |
u-boot-with-spl.bin | 16 (8 KB) | ~250 KB |
FAT | 2048 (1 MB) | 15 MB |
EXT4 | 32768 (16 MB) | rest |
# fdisk /dev/sda
(查看当前分区情况)
Command (m for help): p
Disk /dev/sda: 15.9 GB, 15931539456 bytes
64 heads, 32 sectors/track, 15193 cylinders, total 31116288 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: 0x5452574f
Device Boot Start End Blocks Id System
(创建新分区1)
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1):
Using default value 1
First sector (2048-31116287, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-31116287, default 31116287): +15M
(创建新分区2)
Command (m for help): n
Partition type:
p primary (1 primary, 0 extended, 3 free)
e extended
Select (default p): p
Partition number (1-4, default 2):
Using default value 2
First sector (32768-31116287, default 32768):
Using default value 32768
Last sector, +sectors or +size{K,M,G} (32768-31116287, default 31116287): +240M
(将分区1修改为FAT32格式,原文使用的mkfs.vfat命令)
Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): c
Changed system type of partition 1 to c (W95 FAT32 (LBA))
(执行修改)
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.
# fdisk -l /dev/sda
Disk /dev/sda: 15.9 GB, 15931539456 bytes
64 heads, 32 sectors/track, 15193 cylinders, total 31116288 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: 0x5452574f
Device Boot Start End Blocks Id System
/dev/sda1 2048 32767 15360 c W95 FAT32 (LBA)
/dev/sda2 32768 524287 245760 83 Linux
# dd if=openwrt-sunxi-Lamobo_R1-u-boot-with-spl.bin of=/dev/sda bs=1024 seek=8
#mount -t vfat /dev/sda1 /mnt
# cp openwrt-sunxi-Lamobo_R1-uEnv.txt /mnt/uEnv.txt
# cp sun7i-a20-lamobo-r1.dtb /mnt/dtb
# cp openwrt-sunxi-uImage /mnt/uImage
# cp openwrt-sunxi-Lamobo_R1-boot.scr /mnt/boot.scr
# resize2fs openwrt-sunxi-root.ext4 240M
# dd if=openwrt-sunxi-root.ext4 of=/dev/sda2 bs=128k
# sync
# umount /mnt
U-Boot SPL 2015.01 (Jan 19 2015 - 01:03:44)
DRAM: 1024 MiB
CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
U-Boot 2015.01 (Jan 19 2015 - 01:03:44) Allwinner Technology
CPU: Allwinner A20 (SUN7I)
I2C: ready
DRAM: 1016 MiB
MMC: SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment
Reserved 8192kB of RAM for Framebuffer.
In: serial
Out: serial
Err: serial
SCSI: SUNXI SCSI INIT
SATA link 0 timeout.
AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
flags: ncq stag pm led clo only pmp pio slum part ccc apst
Net: dwmac.1c50000
(Re)start USB...
USB0: USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
USB1: USB EHCI 1.00
scanning bus 1 for devices... 2 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot: 2 1 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0...
Found U-Boot script /boot.scr
reading /boot.scr
377 bytes read in 16 ms (22.5 KiB/s)
## Executing script at 43100000
reading uImage
1939536 bytes read in 230 ms (8 MiB/s)
reading dtb
23803 bytes read in 29 ms (800.8 KiB/s)
## Booting kernel from Legacy Image at 42000000 ...
Image Name: ARM OpenWrt Linux-3.18.2
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1939472 Bytes = 1.8 MiB
Load Address: 40008000
Entry Point: 40008000
Verifying Checksum ... OK
## Flattened Device Tree blob at 43000000
Booting using the fdt blob at 0x43000000
Loading Kernel Image ... OK
Using Device Tree in place at 43000000, end 43008cfa
Starting kernel ...
apt-get install dosfstools
欢迎光临 狗趴(GodPub),开源硬件学习与实践 (http://forum.godpub.com/) | Powered by Discuz! X3.2 |