mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-10-09 12:23:11 +02:00
optimiere die Erkennung der Bootpartition in blitz.data.sh
This commit is contained in:
@@ -927,10 +927,12 @@ if [ "$1" = "kill-boot" ]; then
|
|||||||
|
|
||||||
# get boot partition by checking filesystem type and flags
|
# get boot partition by checking filesystem type and flags
|
||||||
bootPartition=""
|
bootPartition=""
|
||||||
for part in $(lsblk -no NAME "/dev/${device}" | grep "^${device}p\?[0-9]"); do
|
partitionNumber=""
|
||||||
if blkid "/dev/${part}" | grep -q "TYPE=\"vfat\"" && \
|
for partNumber in $(parted -s "/dev/${device}" print | grep "^ *[0-9]" | awk '{print $1}'); do
|
||||||
parted "/dev/${device}" print | grep "^ *[0-9]" | grep -q "boot\|esp"; then
|
if blkid "/dev/${device}${partNumber}" | grep -q "TYPE=\"vfat\"" && \
|
||||||
bootPartition="${part}"
|
parted "/dev/${device}" print | grep "^ *${partNumber}" | grep -q "boot\|esp"; then
|
||||||
|
bootPartition="${device}${partNumber}"
|
||||||
|
partitionNumber="${partNumber}"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -946,13 +948,6 @@ if [ "$1" = "kill-boot" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# get partition number from device name
|
|
||||||
partitionNumber=$(echo "${bootPartition}" | grep -o '[0-9]*$')
|
|
||||||
if [ "${partitionNumber}" = "" ]; then
|
|
||||||
echo "error='partition number not found'"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# make sure boot partition is not mounted
|
# make sure boot partition is not mounted
|
||||||
echo "# unmounting boot partition (${bootPartition}) (${partitionNumber})"
|
echo "# unmounting boot partition (${bootPartition}) (${partitionNumber})"
|
||||||
exit 1
|
exit 1
|
||||||
|
Reference in New Issue
Block a user