Files
openloongarch-buildroot-202…/board/loongson/ls2k1000la/rootfs_ramdisk_overlay/home/recover_reboot.sh
T
2024-07-25 16:25:13 +08:00

51 lines
1.3 KiB
Bash
Executable File

echo " ";
echo "*************************************************************************"
echo "*********************************STARG 3*********************************"
echo "*******************this stage for check log and reboot*******************"
echo "*************************************************************************"
echo " ";
# sda1 / usb1
# sda2 data usb2
# sda3 swap usb3
# sda4 backup usb4
boot_device_type=0
boot_device_num=1
check_cmdline_ins_target()
{
install_target_type=0
# install_target_type=$(cat /proc/cmdline | grep ins_target="scsi") #default is scsi
install_target_type=$(cat /proc/cmdline | grep rec_target=mmc)
if [ ! -z "$install_target_type" ]; then
boot_device_type=1
return 0
fi
}
#防止前面的脚本出现错误,导致没有解除挂载一些已经挂载的分区。
check_and_umount_for_safe()
{
for i in /mnt/usb*; do
{
if mountpoint -q i; then
{
sync;
umount i;
}
fi
}
done
}
#防止前面的脚本出现错误,导致没有解除挂载一些已经挂载的分区。
check_cmdline_ins_target
check_and_umount_for_safe;
/home/sys_config_tool $boot_device_type 0 $boot_device_num
echo "-------------> stage3 reboot system <-------------"
#检查是否有错误记录文件,则之前的脚本执行时出错
reboot -f
echo "-------------> stage3 end <-------------"