我在DM385 上编译好了UBOOT 写入SD 卡,使用MKSD_TI81XX.SH 写入SD 卡,却总部成功是怎么回事?我的OS 版本是UBUNTU 16.04 ?
Ternence_Hsu:
你好;
你是用的什么版本的SDK;
是用的PNC_RDK_V3.8.0/Utils/sd-script/mksd-ti81xx.sh 这个文件吗?
写入失败,有什么错误提示吗?
Ternence_Hsu:
回复 Ternence_Hsu:
如果是制作SD卡失败,你也可以手动了执行;
用 fdisk 来重新分区;
mkfs.vfat -F 32 -n boot "$1"1 &> /dev/nullmkfs.ext3 -L rootfs "$1"2 &> /dev/null
格式化2个分区,分别拷贝数据,具体看看 mksd-ti81xx.sh 的步骤就可以了
qigong du1:
回复 Ternence_Hsu:
我换了ubuntu12.04 出现
sudo ./mksd-ti81xxuboot.sh /dev/sdb1 MLO u-boot.bin [sudo] password for hp: All data on /dev/sdb1 now will be destroyed! Continue? [y/n]y[Partitioning /dev/sdb1…]1024+0 records in1024+0 records out1048576 bytes (1.0 MB) copied, 0.00569995 s, 184 MB/sDisk /dev/sdb1 doesn't contain a valid partition tableDISK SIZE – 1020788736 bytesCYLINDERS – 124Checking that no-one is using this disk right now …BLKRRPART: Invalid argumentOKWarning: start=2048 – this looks like a partition rather thanthe entire disk. Using fdisk on it is probably meaningless.[Use the –force option if you really want this][Making filesystems…][Copying files…]mount: special device /dev/sdb11 does not existumount: /dev/sdb11: not found
这个怎么操作?
Ternence_Hsu:
回复 qigong du1:
qigong du1sudo ./mksd-ti81xxuboot.sh /dev/sdb1 MLO u-boot.bin
你好;
你的SD卡 是dev/sdb 吗? 你这里命令需要写 /dev/sdb , 不是写/dev/sdb1
这个脚本会重新对sd卡进行分区的,所以下面就报了,找不到sdb11了。
qigong du1:
回复 Ternence_Hsu:
我使用mount 命令查询了设备,显示的是
hp@hp:~/yourapp/Utils/sd-script$ mount/dev/sda1 on / type ext4 (rw,errors=remount-ro)proc on /proc type proc (rw,noexec,nosuid,nodev)sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)none on /sys/fs/fuse/connections type fusectl (rw)none on /sys/kernel/debug type debugfs (rw)none on /sys/kernel/security type securityfs (rw)udev on /dev type devtmpfs (rw,mode=0755)devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)none on /run/shm type tmpfs (rw,nosuid,nodev)gvfs-fuse-daemon on /home/hp/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=hp)vmware-vmblock on /run/vmblock-fuse type fuse.vmware-vmblock (rw,nosuid,nodev,default_permissions,allow_other)/dev/sdb1 on /media/D602-2712 type vfat (rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks)hp@hp:~/yourapp/Utils/sd-script$
这个写/dev/sdb1应该是对的!
现在我只想写UBOOT 和MLO ,一步一步的调试!
#!/bin/bash
if [[ -z $1 || -z $2 || -z $3 ]]then echo "mksd-ti814x Usage:" echo " mksd-ti814x <device> <MLO> <u-boot.bin> <uImage> <rootfs tar.gz >" echo " Example: mksd-ti814x /dev/sdc MLO u-boot.bin uImage nfs.tar.gz" exitfi
if ! [[ -e $2 ]]then echo "Incorrect MLO location!" exitfi
if ! [[ -e $3 ]]then echo "Incorrect u-boot.bin location!" exitfi
#if ! [[ -e $4 ]]#then# echo "Incorrect uImage location!"# exit#fi
#if ! [[ -e $5 ]]#then# echo "Incorrect rootfs location!"# exit#fi
echo "All data on "$1" now will be destroyed! Continue? [y/n]"read ansif ! [ $ans == 'y' ]then exitfi
echo "[Partitioning $1…]"
DRIVE=$1dd if=/dev/zero of=$DRIVE bs=1024 count=1024 SIZE=`fdisk -l $DRIVE | grep Disk | awk '{print $5}'` echo DISK SIZE – $SIZE bytes CYLINDERS=`echo $SIZE/255/63/512 | bc` echo CYLINDERS – $CYLINDERS{echo ,9,0x0C,*echo 10,,,-} | sfdisk -D -H 255 -S 63 -C $CYLINDERS $DRIVE
echo "[Making filesystems…]"
mkfs.vfat -F 32 -n boot "$1"1 &> /dev/nullmkfs.ext3 -L rootfs "$1"2 &> /dev/null
echo "[Copying files…]"
mount "$1"1 /mntcp $2 /mnt/MLOcp $3 /mnt/u-boot.bin#cp $4 /mnt/uImageumount "$1"1
#mount "$1"2 /mnt#tar zxvf $5 -C /mnt &> /dev/null#chmod 755 /mnt#umount "$1"2
echo "[Done]"
我修改了SH 脚本,出现后
[Partitioning /dev/sdb1…]1024+0 records in1024+0 records out1048576 bytes (1.0 MB) copied, 0.00906893 s, 116 MB/sDisk /dev/sdb1 doesn't contain a valid partition tableDISK SIZE – 1020788736 bytesCYLINDERS – 124Checking that no-one is using this disk right now …BLKRRPART: Invalid argumentOKWarning: start=2048 – this looks like a partition rather thanthe entire disk. Using fdisk on it is probably meaningless.[Use the –force option if you really want this][Making filesystems…][Copying files…]mount: special device /dev/sdb11 does not existumount: /dev/sdb11: not found[Done]
实现只写MLO 和UBOOT 怎么操作?
Ternence_Hsu:
回复 qigong du1:
那你直接把mlo 和 uboot 直接拷贝到sd卡,反正你sd卡格式是fat32 的;
正常,应当启动会有uboot打印的