rv1108: lock: compat with new partition setting

Signed-off-by: Zhichao Yu <zhichao.yu@rock-chips.com>
Change-Id: Id0e54a84b6948e2abd93bac04db1a27b42b36f87
This commit is contained in:
Zhichao Yu
2020-05-02 11:43:01 +08:00
parent ba2990810c
commit 14ed4ae23c
3 changed files with 119 additions and 3 deletions

View File

@ -54,20 +54,20 @@ export RK_KERNEL_DTS=rv1108-${RK_TARGET_BOARD_VERSION}
######################################## ########################################
# Set userdata config # Set userdata config
export RK_USERDATA_FILESYSTEM_TYPE=jffs2 export RK_USERDATA_FILESYSTEM_TYPE=jffs2
export RK_USERDATA_FILESYSTEM_SIZE=6M export RK_USERDATA_FILESYSTEM_SIZE=4M
######################################## ########################################
# Root Config # # Root Config #
######################################## ########################################
# Set root data config # Set root data config
export RK_ROOT_FILESYSTEM_TYPE=jffs2 export RK_ROOT_FILESYSTEM_TYPE=jffs2
export RK_ROOT_FILESYSTEM_SIZE=6M export RK_ROOT_FILESYSTEM_SIZE=8M
######################################## ########################################
# Firmware Config # # Firmware Config #
######################################## ########################################
# setting.ini for firmware # setting.ini for firmware
export RK_SETTING_INI=setting.ini export RK_SETTING_INI=setting-lock.ini
######################################## ########################################
# Build Config # # Build 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/mtdblock7
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/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 $?