linux 查看emmc分区表_嵌入式linux系统开机自动检测emmc,如果没有分区就格式化及自动分区的一种方法...

本文说明利用shell脚本实现linux系统上电自动检测emmc的一种方法。不需要人工去配置emmc,提升工作效率。

该脚本已经在海思平台HI3516CV300验证可行。

#!/bin/sh

#1.Determines whether the /data directory is mounted

echo "Determines whether the /data directory is mounted"

if mountpoint -q /data

then

echo "The /data directory has been mounted,will exit the shell"

exit

else

echo "The /data directory not mounted"

fi

#2.Determine if /dev/mmcblk0p1 exists. If so, try mount it first

echo "Determine if /dev/mmcblk0p1 exists. If so, try mount it first"

if [ -e '/dev/mmcblk0p1' ]

then

echo "/dev/mmcblk0p1 already exist!"

echo "do- mount /dev/mmcblk0p1 /data"

mount /dev/mmcblk0p1 /data

if [ "$?" = 0 ]

then

echo "mount /dev/mmcblk0p1 /data successful!!!"

你可能感兴趣的:(linux,查看emmc分区表)