diff --git a/run.sh b/run.sh index 06650c377..fa356b036 100644 --- a/run.sh +++ b/run.sh @@ -108,7 +108,11 @@ cfg_content='set timeout=15 # rm -rf ${iso_folder} LOOP_DEVICE=$(lsblk | grep disk_mount) - grub-install --target=i386-pc --boot-directory=${root_folder}/bin/disk_mount/boot/ /dev/${LOOP_DEVICE:2:5} +LOOP_DEVICE=${LOOP_DEVICE:2:10} +LOOP_DEVICE=${LOOP_DEVICE%%p1*} + + + grub-install --target=i386-pc --boot-directory=${root_folder}/bin/disk_mount/boot/ /dev/$LOOP_DEVICE sync bash umount_virt_disk.sh @@ -154,4 +158,4 @@ if [ $flag_can_run -eq 1 ]; then fi else echo "不满足运行条件" -fi \ No newline at end of file +fi diff --git a/tools/umount_virt_disk.sh b/tools/umount_virt_disk.sh index 91488e1a5..30e57ed4d 100755 --- a/tools/umount_virt_disk.sh +++ b/tools/umount_virt_disk.sh @@ -6,6 +6,10 @@ if [ ! $uid == "0" ];then fi LOOP_DEVICE=$(lsblk | grep disk_mount) + +LOOP_DEVICE=${LOOP_DEVICE:2:10} +LOOP_DEVICE=${LOOP_DEVICE%%p1*} + umount -f ../bin/disk_mount/ -losetup -d /dev/${LOOP_DEVICE:2:5} -echo ${LOOP_DEVICE:2:5} \ No newline at end of file +losetup -d /dev/$LOOP_DEVICE +echo $LOOP_DEVICE