fix the bootloader disk read-only

This commit is contained in:
Ing 2024-08-09 20:02:33 +08:00
parent f65eb21930
commit a536eecee3

View File

@ -7,6 +7,11 @@
###############################################################################
# Check loader disk
function checkBootLoader() {
while read KNAME RO; do
[ -z "${KNAME}" ] && continue
[ "${RO}" = "0" ] && continue
hdparm -r0 "${KNAME}" >/dev/null 2>&1 || true
done <<<$(lsblk -pno KNAME,RO 2>/dev/null)
[ ! -w "${PART1_PATH}" ] && return 1
[ ! -w "${PART2_PATH}" ] && return 1
[ ! -w "${PART3_PATH}" ] && return 1