|
本帖最后由 sam7200 于 2016-8-17 20:25 编辑
请版主关闭本帖子
结论出来了:只要换成Ubuntu 12.04 64bit版本作为编译机,下面的问题都不存在了;
下述的操作步骤仍然可以作为制作完整Debian EMMC启动固件的范例; |
目的:在CB2的EMMC板子上,生成一个自己定制的Debian Server;
参考文档:
CubieBoard2-20151211-EMMC Linux源码编译和制作固件-V1.0
文档链接地址:http://pan.baidu.com/s/1jGEFvBC# ... %252FDocs%252FLinux
系统平台:Ubuntu 14.04
源码下载位置:http://dl.cubieboard.org/model/Common/linux-sdk-binaries/
工作环境目录结构,其中linux-sunxi,products,tools均为按文档要求git下来的最新版本:
开始编译的时候走了很多弯路,最后觉得一个干净的环境最重要,所以以下目录在下载文件完成后,先备份一个完整的tar.gz包,每次构建都是删除掉整个目录和/tmp/tmp_cb2目录后重新解压缩执行的,以便保证目录的干净性;
sam@cb-compile-server:~/linux-sdk-card$ ll
总用量 24
drwxrwxr-x 6 sam sam 4096 8月 16 18:12 ./
drwxr-xr-x 4 sam sam 4096 8月 16 20:37 ../
drwxrwxr-x 3 sam sam 4096 8月 16 18:26 binaries/
drwxrwxr-x 27 sam sam 4096 8月 16 16:24 linux-sunxi/
drwxrwxr-x 7 sam sam 4096 8月 16 18:03 products/
drwxrwxr-x 7 sam sam 4096 8月 16 16:40 tools/
binaries目录内的内容
sam@cb-compile-server:~/linux-sdk-card$ ll binaries/
总用量 204744
drwxrwxr-x 3 sam sam 4096 8月 16 18:26 ./
drwxrwxr-x 6 sam sam 4096 8月 16 18:12 ../
-rw-rw-r-- 1 sam sam 7451664 11月 24 2014 card_flash_rootfs.tar.gz
-rw-rw-r-- 1 sam sam 201385855 1月 22 2015 debian-server-v1.2.tar.gz
drwxrwxr-x 2 sam sam 4096 11月 11 2014 u-boot-a20/
-rw-rw-r-- 1 sam sam 800966 11月 24 2014 u-boot-a20.tar.gz
tf卡所在分区:/dev/sdb
sam@cb-compile-server:~/linux-sdk-card$ sudo fdisk -l
WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/sda: 128.0 GB, 128035676160 bytes
255 heads, 63 sectors/track, 15566 cylinders, total 250069680 sectors
Units = 扇区 of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
设备 启动 起点 终点 块数 Id 系统
/dev/sda1 1 250069679 125034839+ ee GPT
Disk /dev/sdb: 7985 MB, 7985954816 bytes
246 heads, 62 sectors/track, 1022 cylinders, total 15597568 sectors
Units = 扇区 of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
设备 启动 起点 终点 块数 Id 系统
/dev/sdb1 2048 26623 12288 83 Linux
/dev/sdb2 26624 15597567 7785472 83 Linux
----------------------开始--------------------
执行命令如下,蓝色粗体字为我手动输入的内容:
sam@cb-compile-server:~/linux-sdk-card$ source tools/scripts/envsetup.sh
Products
0 - cb
1 - cb2
2 - ct
3 - cubieaio
please select a board:1
0 - cb2-cubieez
1 - cb2-cubieez-cs
2 - cb2-debian-server
3 - cb2-linaro-14.04-desktop
4 - cb2-linaro-server
please select a system:2
Creating working dirs
--------------------------------------------------------------
* Building Micro-sd Card Image Step:
0.Insert Micro-sd Card into host PC
!!!!! WARNNING !!!!!
The below steps will format your Micro-sd Card
Please make sure your Micro-sd Card label
$ sudo fdisk -l
$ sudo umount /dev/sdx
1.Micro-sd Card Image packing:
(1)$ cb_build_card_image
(2)$ cb_part_install_tfcard nand/tfx2/tsd/emmc sdx pack
(3)$ cb_install_tfcard nand/tfx2/tsd/emmc sdx [pack]
2.Micro-sd Card flash EMMC/TSD:
(1)$ cb_build_flash_card_image
(2)$ cb_part_install_flash_card emmc/tsd sdx
(3)$ cb_install_flash_card emmc/tsd sdx [pack]
* Explanation of parameters
- nand: Nand flash storage version for cbs
- tfx2: Cubieboard2-dualcard version
- emmc: EMMC flash storage version for cbs
- tsd: Tsd flash storage version for cbs
- sdx: Micro-sd Card label on host PC
- pack: Calculation Micro-sd Card partition size
- [pack]: Optional parameters,backup and release image
* Building example for NAND version board Micro-sd Card Image
$ cb_build_card_image
$ cb_part_install_tfcard nand sdc pack
$ cb_install_tfcard nand sdc pack
* Building example for EMMC version board Micro-sd Card Image
$ cb_build_card_image
$ cb_part_install_tfcard emmc sdc pack
$ cb_install_tfcard emmc sdc pack
-----------------------------------------------------------------
sam@cb-compile-server:~/linux-sdk-card$ cb_build_flash_card_image
中间内容略过,只给出个结果
Start Building linux
"/home/sam/linux-sdk-card/products/cb2/cb2-debian-server/kernel_defconfig" -> "/home/sam/linux-sdk-card/linux-sunxi/arch/arm/configs/kernel_defconfig"
make:进入目录'/home/sam/linux-sdk-card/linux-sunxi'
HOSTCC scripts/basic/fixdep
GEN /home/sam/linux-sdk-card/build/cb2/cb2-debian-server/linux/Makefile
HOSTCC scripts/kconfig/conf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/zconf.lex.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
drivers/net/wireless/bcmdhd/Kconfig:44:warning: defaults for choice values not supported
#
# configuration written to .config
#
make:离开目录“/home/sam/linux-sdk-card/linux-sunxi”
"/home/sam/linux-sdk-card/products/cb2/cb2-debian-server/rootfs.cpio.gz" -> "/home/sam/linux-sdk-card/build/cb2/cb2-debian-server/linux/rootfs.cpio.gz"
make:进入目录'/home/sam/linux-sdk-card/linux-sunxi'
GEN /home/sam/linux-sdk-card/build/cb2/cb2-debian-server/linux/Makefile
scripts/kconfig/conf --silentoldconfig Kconfig
drivers/net/wireless/bcmdhd/Kconfig:44:warning: defaults for choice values not supported
GEN /home/sam/linux-sdk-card/build/cb2/cb2-debian-server/linux/Makefile
IHEX2FW firmware/keyspan_pda/xircom_pgs.fw
make:离开目录“/home/sam/linux-sdk-card/linux-sunxi”
Build linux successfully
mkdir: 已创建目录 "/home/sam/linux-sdk-card/output/cb2/cb2-debian-server/card0-rootfs"
记录了700+0 的读入
记录了700+0 的写出
734003200字节(734 MB)已复制,0.339844 秒,2.2 GB/秒
mke2fs 1.42.9 (4-Feb-2014)
/home/sam/linux-sdk-card/output/cb2/cb2-debian-server/debian-server-20140923.ext4 is not a block special device.
无论如何也要继续? (y,n) Discarding device blocks: 完成
文件系统标签=
OS type: Linux
块大小=4096 (log=2)
分块大小=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
44832 inodes, 179200 blocks
8960 blocks (5.00%) reserved for the super user
第一个数据块=0
Maximum filesystem blocks=184549376
6 block groups
32768 blocks per group, 32768 fragments per group
7472 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840
Allocating group tables: 完成
正在写入inode表: 完成
Creating journal (4096 blocks): 完成
Writing superblocks and filesystem accounting information: 完成
make:进入目录'/home/sam/linux-sdk-card/linux-sunxi'
INSTALL crypto/af_alg.ko
INSTALL /home/sam/linux-sdk-card/output/cb2/cb2-debian-server/card0-rootfs/lib/firmware/yam/9600.bin
DEPMOD 3.4.79
make:离开目录“/home/sam/linux-sdk-card/linux-sunxi”
sam@cb-compile-server:~/linux-sdk-card$ cb_part_install_flash_card emmc sdb
PartSize=709380 sizeByte=255722929
Cleaning /dev/sdb
733956
Checking that no-one is using this disk right now ...
OK
磁盘 /dev/sdb:1022 个柱面,246 个磁头,62 个扇区/磁道
旧状况:
Units = sectors of 512 bytes, counting from 0
设备 启动 开头 结束 #扇区 Id 系统
/dev/sdb1 2048 26623 24576 83 Linux
/dev/sdb2 26624 15597567 15570944 83 Linux
/dev/sdb3 0 - 0 0 空
/dev/sdb4 0 - 0 0 空
新状况:
Units = sectors of 512 bytes, counting from 0
设备 启动 开头 结束 #扇区 Id 系统
/dev/sdb1 2048 26623 24576 83 Linux
/dev/sdb2 26624 760579 733956 83 Linux
/dev/sdb3 0 - 0 0 空
/dev/sdb4 0 - 0 0 空
Warning: partition 1 does not end at a cylinder boundary
Warning: partition 2 does not start at a cylinder boundary
Warning: partition 2 does not end at a cylinder boundary
Warning: no primary partition is marked bootable (active)
This does not matter for LILO, but the DOS MBR will not boot this disk.
成功写入了新分区表
正在重新读取分区表...;
If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)
mke2fs 1.42.9 (4-Feb-2014)
文件系统标签=
OS type: Linux
块大小=1024 (log=0)
分块大小=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
3072 inodes, 12288 blocks
614 blocks (5.00%) reserved for the super user
第一个数据块=1
Maximum filesystem blocks=12582912
2 block groups
8192 blocks per group, 8192 fragments per group
1536 inodes per group
Superblock backups stored on blocks:
8193
Allocating group tables: 完成
正在写入inode表: 完成
Writing superblocks and filesystem accounting information: 完成
mke2fs 1.42.9 (4-Feb-2014)
文件系统标签=
OS type: Linux
块大小=1024 (log=0)
分块大小=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
91800 inodes, 366976 blocks
18348 blocks (5.00%) reserved for the super user
第一个数据块=1
Maximum filesystem blocks=67633152
45 block groups
8192 blocks per group, 8192 fragments per group
2040 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729, 204801, 221185
Allocating group tables: 完成
正在写入inode表: 完成
Creating journal (8192 blocks): 完成
Writing superblocks and filesystem accounting information: 完成
Make sunxi partitons successfully
sam@cb-compile-server:~/linux-sdk-card$ cb_install_flash_card emmc sdb
cp: 无法获取"/home/sam/linux-sdk-card/binaries/card_flash_nand_rootfs.tar.gz" 的文件状态(stat): 没有那个文件或目录
"/home/sam/linux-sdk-card/binaries/card_flash_rootfs.tar.gz" -> "/home/sam/linux-sdk-card/output/cb2/cb2-debian-server/card_flash_rootfs.tar.gz"
"/home/sam/linux-sdk-card/build/cb2/cb2-debian-server/linux/arch/arm/boot/uImage" -> "/tmp/sdc1/uImage"
"/home/sam/linux-sdk-card/products/cb2/cb2-debian-server/configs/emmc/uEnv-mmc.txt" -> "/tmp/sdc1/uEnv.txt"
Check ok: /dev/sdb
记录了254+1 的读入
记录了254+1 的写出
260980字节(261 kB)已复制,0.105431 秒,2.5 MB/秒
Build successfully
mount ok
"/home/sam/linux-sdk-card/output/cb2/cb2-debian-server/rootfs.tar.gz" -> "/tmp/sdc2/rootfs.tar.gz"
mkdir: 已创建目录 "/tmp/sdc2/bootfs"
"/home/sam/linux-sdk-card/binaries/u-boot-a20/u-boot-sunxi-with-spl-mmc2.bin" -> "/tmp/sdc2/bootfs/u-boot.bin"
"/home/sam/linux-sdk-card/build/cb2/cb2-debian-server/linux/arch/arm/boot/uImage" -> "/tmp/sdc2/bootfs/uImage"
"/home/sam/linux-sdk-card/products/cb2/cb2-debian-server/configs/emmc/uEnv-emmc.txt" -> "/tmp/sdc2/bootfs/uEnv.txt"
cp ok
"/home/sam/linux-sdk-card/products/cb2/cb2-debian-server/configs/emmc/install.sh" -> "/tmp/sdc2/bin/install.sh"
tar ok
----------------------结束--------------------
把tf从ubuntu14.04的编译机上拔出后,我插到了emmc版本的CB2上,给CB2通电,等了一会,自动关机了,到目前来看一切正常;
把tf从CB2上拔出后,给CB2通电,出现卡死的现象,如下图所示:
提示都会卡在-----【 end trace cd52d4746042bd04 】 ------ 后面的字符有些时候会不一样
使用另外的卡启动模式也会碰到一样的问题;
Cubieboard群里面的有朋友说要用u-boot-a20支持emmc的才可以,实在不懂,所以想上来咨询下;
为了怕自己未按教程操作,发帖子前已经尝试了5天了,各种尝试都不行,所以还请高人能指点下,完整的编译日志在附件中,如果有需要,可以参考;
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|