rv1108: cvr: compat with new partition setting

Signed-off-by: Zhichao Yu <zhichao.yu@rock-chips.com>
Change-Id: I3f259b4493471bc25270a6bd007060f51b0c9676
This commit is contained in:
Zhichao Yu
2020-05-02 14:48:18 +08:00
parent 14ed4ae23c
commit 9dcb8d5355
4 changed files with 118 additions and 2 deletions

View File

@ -61,7 +61,7 @@ export RK_USERDATA_FILESYSTEM_SIZE=6M
########################################
# Set root data config
export RK_ROOT_FILESYSTEM_TYPE=jffs2
export RK_ROOT_FILESYSTEM_SIZE=6M
export RK_ROOT_FILESYSTEM_SIZE=8M
########################################
# Firmware Config #

View File

@ -0,0 +1,58 @@
#!/bin/sh
#
# Start mount /data....
#
case "$1" in
start)
target_part_name="userdata"
find_target_part=0
storage_type_emmc=1
mount_dir="/data"
nor_block_path=/dev/mtdblock5
if [ -e /dev/mmcblk0p1 ]; then
for block_path in /dev/mmcblk0p*;
do
block_name=`echo $block_path | sed 's/\/dev\///g'`
part_name=`cat /sys/block/mmcblk0/$block_name/uevent | grep PARTNAME | sed 's/PARTNAME=//g'`
if [ $part_name == $target_part_name ]; then
find_target_part=1
break
fi
done
echo block_name=$block_name
fi
if [ -e /dev/mtdblock0 ]; then
if [ -e $nor_block_path -a $find_target_part -eq 0 ]; then
find_target_part=1
storage_type_emmc=0
block_path=$nor_block_path
fi
echo block_name=$block_name
fi
if [ $find_target_part -eq 1 ]; then
if [ ! -d $mount_dir ]; then mkdir $mount_dir; fi
if [ $storage_type_emmc -eq 1 ]; then
/bin/busybox mount -t ext4 $block_path $mount_dir
else
/bin/busybox mount -t jffs2 $block_path $mount_dir
fi
str_value=`/bin/busybox df | grep $mount_dir`
[ ! -z "$str_value" ] && echo "$mount_dir mount success" || echo "$mount_dir mount fail"
else
echo "no found $target_part_name"
fi
;;
stop)
umount /data
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit $?

View File

@ -0,0 +1,58 @@
#!/bin/sh
#
# Start mount /data....
#
case "$1" in
start)
target_part_name="root"
find_target_part=0
storage_type_emmc=1
mount_dir="/root"
nor_block_path=/dev/mtdblock4
if [ -e /dev/mmcblk0p1 ]; then
for block_path in /dev/mmcblk0p*;
do
block_name=`echo $block_path | sed 's/\/dev\///g'`
part_name=`cat /sys/block/mmcblk0/$block_name/uevent | grep PARTNAME | sed 's/PARTNAME=//g'`
if [ $part_name == $target_part_name ]; then
find_target_part=1
break
fi
done
echo block_name=$block_name
fi
if [ -e /dev/mtdblock0 ]; then
if [ -e $nor_block_path -a $find_target_part -eq 0 ]; then
find_target_part=1
storage_type_emmc=0
block_path=$nor_block_path
fi
echo block_name=$block_name
fi
if [ $find_target_part -eq 1 ]; then
if [ ! -d $mount_dir ]; then mkdir $mount_dir; fi
if [ $storage_type_emmc -eq 1 ]; then
/bin/busybox mount -t ext4 $block_path $mount_dir
else
/bin/busybox mount -t jffs2 $block_path $mount_dir
fi
str_value=`/bin/busybox df | grep $mount_dir`
[ ! -z "$str_value" ] && echo "$mount_dir mount success" || echo "$mount_dir mount fail"
else
echo "no found $target_part_name"
fi
;;
stop)
umount /data
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit $?