Skip to content

Commit

Permalink
install: display error message
Browse files Browse the repository at this point in the history
  • Loading branch information
RadxaYuntian committed Dec 11, 2023
1 parent 6775b69 commit a2e188d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/sub_commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ _install() {
then
trap "set +e; sudo -n true && (sudo umount -R /mnt; sudo kpartx -d '$disk'; sync)" SIGINT SIGQUIT SIGTSTP EXIT
sudo kpartx -a "$disk"
disk="$(sudo blkid -t LABEL=rootfs -o device | grep /dev/mapper/loop | tail -n 1)"
echo "Target is a file. Trying to find rootfs partition..."
if ! disk="$(sudo blkid -t LABEL=rootfs -o device | grep /dev/mapper/loop | tail -n 1)"
then
echo "Failed to find rootfs partition." >&2
return
fi
disk="${disk%p*}p"
fi

Expand Down

0 comments on commit a2e188d

Please sign in to comment.