Skip to content

Commit

Permalink
fix lsblk ID is null
Browse files Browse the repository at this point in the history
  • Loading branch information
wjz304 committed Aug 6, 2024
1 parent cf2776b commit f28d268
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions files/initrd/opt/rr/menu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1755,7 +1755,7 @@ function formatDisks() {
[ "${KNAME}" = "${LOADER_DISK}" -o "${PKNAME}" = "${LOADER_DISK}" ] && continue
[ -z "${ID}" ] && ID="Unknown"
printf "\"%s\" \"%-6s %-4s %s\" \"off\"\n" "${KNAME}" "${SIZE}" "${TYPE}" "${ID}" >>"${TMP_PATH}/opts"
done <<<$(lsblk -pno KNAME,ID,SIZE,TYPE,PKNAME)
done <<<$(lsblk -Jpno KNAME,ID,SIZE,TYPE,PKNAME 2>/dev/null | sed 's|null|"N/A"|g' | jq -r '.blockdevices[] | "\(.kname) \(.id) \(.size) \(.type) \(.pkname)"' 2>/dev/null)
if [ ! -f "${TMP_PATH}/opts" ]; then
DIALOG --title "$(TEXT "Advanced")" \
--msgbox "$(TEXT "No disk found!")" 0 0
Expand Down Expand Up @@ -2138,7 +2138,7 @@ function cloneBootloaderDisk() {
[ -z "${KNAME}" -o -z "${ID}" ] && continue
[ "${KNAME}" = "${LOADER_DISK}" -o "${PKNAME}" = "${LOADER_DISK}" ] && continue
printf "\"%s\" \"%-6s %s\" \"off\"\n" "${KNAME}" "${SIZE}" "${ID}" >>"${TMP_PATH}/opts"
done <<<$(lsblk -dpno KNAME,ID,SIZE,PKNAME)
done <<<$(lsblk -Jpno KNAME,ID,SIZE,PKNAME 2>/dev/null | sed 's|null|"N/A"|g' | jq -r '.blockdevices[] | "\(.kname) \(.id) \(.size) \(.pkname)"' 2>/dev/null)
if [ ! -f "${TMP_PATH}/opts" ]; then
DIALOG --title "$(TEXT "Advanced")" \
--msgbox "$(TEXT "No disk found!")" 0 0
Expand Down

0 comments on commit f28d268

Please sign in to comment.