This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

IPNC_RDK_V3.8.0 DM385 制作SD卡失败



sudo ./mksd-ti81xx.sh /dev/sdb MLO u-boot.bin uImage filesys_full_feature.tar.gz 

mksd-ti81xx.sh脚本内容如下:

{

#!/bin/bash

if [[ -z $1 || -z $2 || -z $3 || -z $4 ]]
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"
exit
fi

if ! [[ -e $2 ]]
then
echo "Incorrect MLO location!"
exit
fi

if ! [[ -e $3 ]]
then
echo "Incorrect u-boot.bin location!"
exit
fi

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 ans
if ! [ $ans == 'y' ]
then
exit
fi

echo "[Partitioning $1...]"

DRIVE=$1
dd 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/null
mkfs.ext3 -L rootfs "$1"2 &> /dev/null

echo "[Copying files...]"

mount "$1"1 /mnt
cp $2 /mnt/MLO
cp $3 /mnt/u-boot.bin
cp $4 /mnt/uImage
umount "$1"1

mount "$1"2 /mnt
tar zxvf $5 -C /mnt &> /dev/null
chmod 755 /mnt
umount "$1"2

echo "[Done]"

}

出现如下错误:

Commands:
-A, --activate <dev> [<part> ...] list or set bootable MBR partitions
-d, --dump <dev> dump partition table (usable for later input)
-J, --json <dev> dump partition table in JSON format
-g, --show-geometry [<dev> ...] list geometry of all or specified devices
-l, --list [<dev> ...] list partitions of each device
-F, --list-free [<dev> ...] list unpartitions free areas of each device
-s, --show-size [<dev> ...] list sizes of all or specified devices
-T, --list-types print the recognized types (see -X)
-V, --verify [<dev> ...] test whether partitions seem correct

--part-label <dev> <part> [<str>] print or change partition label
--part-type <dev> <part> [<type>] print or change partition type
--part-uuid <dev> <part> [<uuid>] print or change partition uuid
--part-attrs <dev> <part> [<str>] print or change partition attributes

<dev> device (usually disk) path
<part> partition number
<type> partition type, GUID for GPT, hex for MBR

Options:
-a, --append append partitions to existing partition table
-b, --backup backup partition table sectors (see -O)
--bytes print SIZE in bytes rather than in human readable format
-f, --force disable all consistency checking
--color[=<when>] colorize output (auto, always or never)
colors are enabled by default
-N, --partno <num> specify partition number
-n, --no-act do everything except write to device
--no-reread do not check whether the device is in use
-O, --backup-file <path> override default backup file name
-o, --output <list> output columns
-q, --quiet suppress extra info messages
-X, --label <name> specify label type (dos, gpt, ...)
-Y, --label-nested <name> specify nested label type (dos, bsd)

-L, --Linux deprecated, only for backward compatibility
-u, --unit S deprecated, only sector unit is supported

-h, --help display this help and exit
-v, --version output version information and exit

Available columns (for -o):
gpt: Device Start End Sectors Size Type Type-UUID Attrs Name UUID
dos: Device Start End Sectors Cylinders Size Type Id Attrs Boot End-C/H/S
Start-C/H/S
bsd: Slice Start End Sectors Cylinders Size Type Bsize Cpg Fsize
sgi: Device Start End Sectors Cylinders Size Type Id Attrs
sun: Device Start End Sectors Cylinders Size Type Id Flags

For more details see sfdisk(8).
[Making filesystems...]
[Copying files...]
mount: special device /dev/sdc1 does not exist
cp: cannot create regular file '/mnt/MLO': Input/output error
cp: cannot create regular file '/mnt/u-boot.bin': Input/output error
cp: cannot create regular file '/mnt/uImage': Input/output error
umount: /dev/sdc1: mountpoint not found
mount: special device /dev/sdc2 does not exist
umount: /dev/sdc2: mountpoint not found

在Linux系统上ls /dev/sd* 可以看到sd sd1

  • 你好,

    你运行的命令使用了/dev/sdb,请问你的系统上是否有/dev/sdb?
  • dg q 说:
    For more details see sfdisk(8).
    [Making filesystems...]
    [Copying files...]
    mount: special device /dev/sdc1 does not exist
    cp: cannot create regular file '/mnt/MLO': Input/output error
    cp: cannot create regular file '/mnt/u-boot.bin': Input/output error
    cp: cannot create regular file '/mnt/uImage': Input/output error
    umount: /dev/sdc1: mountpoint not found
    mount: special device /dev/sdc2 does not exist
    umount: /dev/sdc2: mountpoint not found

    你上面的命令是 /dev/sdb ,这里 异常包的是 /dev/sdc  , 这个你可以查一下 ;

  • 方便 ,打印一下 fdisk -l 的信息看一下吗 ?
  • qdg@ubuntu:~$ fdisk -l
    fdisk: cannot open /dev/sda: Permission denied
    fdisk: cannot open /dev/sdb: Permission denied
    qdg@ubuntu:~$ sudo !!
    sudo fdisk -l
    [sudo] password for qdg:
    Disk /dev/sda: 60 GiB, 64424509440 bytes, 125829120 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
    Disklabel type: dos
    Disk identifier: 0xa08f0514

    Device Boot Start End Sectors Size Id Type
    /dev/sda1 * 2048 123731967 123729920 59G 83 Linux
    /dev/sda2 123734014 125827071 2093058 1022M 5 Extended
    /dev/sda5 123734016 125827071 2093056 1022M 82 Linux swap / Solaris




    Disk /dev/sdb: 1.9 GiB, 2032664576 bytes, 3970048 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
    Disklabel type: dos
    Disk identifier: 0x10798932

    Device Boot Start End Sectors Size Id Type
    /dev/sdb1 * 63 3970047 3969985 1.9G c W95 FAT32 (LBA)
  • 建议 切换 到 root 后运行;

    另外 如果还是制作失败,可以参考 脚本手动操作一下;

    步骤: 把 sd 卡 分2个区, 分别格式化为 fat32 和 ext3 , 再把对应的镜像拷贝进去就可以了;