From 84948db5d3f35269b5f9e5068319c7f00c95f892 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Wed, 13 Dec 2023 21:56:37 +0800 Subject: [PATCH] =?UTF-8?q?core:=20=E6=9A=B4=E5=8A=9B=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E5=88=86=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trans.sh | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/trans.sh b/trans.sh index 5968aab..23da20e 100644 --- a/trans.sh +++ b/trans.sh @@ -105,23 +105,29 @@ download() { } update_part() { - # partx - # https://access.redhat.com/solutions/199573 - if is_have_cmd partx; then - partx -u $1 - fi + sleep 1 - if rc-service --exists udev && rc-service udev status; then - # udev - udevadm trigger - udevadm settle - else - # busybox mdev - # 得刷新多次,不然找不到新分区 - # -f 好像没用,而且 3.16 没有 - mdev -s 2>/dev/null - mdev -s 2>/dev/null - fi + # 玄学 + for i in 1 2 3; do + sync + partprobe /dev/$xda 2>/dev/null + + # partx + # https://access.redhat.com/solutions/199573 + if is_have_cmd partx; then + partx -u $1 + fi + + if rc-service --exists udev && rc-service -q udev status; then + # udev + udevadm trigger + udevadm settle + else + # busybox mdev + # -f 好像没用,而且 3.16 没有 + mdev -s 2>/dev/null + fi + done } is_efi() {