4
1
mirror of https://github.com/DragonOS-Community/DragonOS.git synced 2025-06-21 22:43:23 +00:00

fix: 修复运行脚本不能正确获取对应的回环设备号的问题

This commit is contained in:
longjin
2022-08-13 01:17:19 +08:00
parent 83d0b8ec11
commit 26ef8f46e5
2 changed files with 12 additions and 4 deletions

8
run.sh

@ -108,7 +108,11 @@ cfg_content='set timeout=15
# rm -rf ${iso_folder} # rm -rf ${iso_folder}
LOOP_DEVICE=$(lsblk | grep disk_mount) 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 sync
bash umount_virt_disk.sh bash umount_virt_disk.sh
@ -154,4 +158,4 @@ if [ $flag_can_run -eq 1 ]; then
fi fi
else else
echo "不满足运行条件" echo "不满足运行条件"
fi fi

@ -6,6 +6,10 @@ if [ ! $uid == "0" ];then
fi fi
LOOP_DEVICE=$(lsblk | grep disk_mount) LOOP_DEVICE=$(lsblk | grep disk_mount)
LOOP_DEVICE=${LOOP_DEVICE:2:10}
LOOP_DEVICE=${LOOP_DEVICE%%p1*}
umount -f ../bin/disk_mount/ umount -f ../bin/disk_mount/
losetup -d /dev/${LOOP_DEVICE:2:5} losetup -d /dev/$LOOP_DEVICE
echo ${LOOP_DEVICE:2:5} echo $LOOP_DEVICE