Skip to content
Snippets Groups Projects
Verified Commit 7c3f1035 authored by Johannes Schauer Marin Rodrigues's avatar Johannes Schauer Marin Rodrigues
Browse files

sbin/reform-migrate: check whether partition for /boot is mounted before proceeding

parent c4025bc3
Branches
Tags
No related merge requests found
...@@ -56,10 +56,12 @@ fi ...@@ -56,10 +56,12 @@ fi
EMMC="" EMMC=""
TARGET="$1" TARGET="$1"
BOOTPART="mmcblk1p1"
if [ "--emmc" = "$1" ]; then if [ "--emmc" = "$1" ]; then
EMMC="--emmc" EMMC="--emmc"
TARGET="$2" TARGET="$2"
BOOTPART="mmcblk0p1"
fi fi
if [ -z "$TARGET" ]; then if [ -z "$TARGET" ]; then
...@@ -78,6 +80,13 @@ if [ -n "$(lsblk --noheadings --output=MOUNTPOINT "$TARGET")" ]; then ...@@ -78,6 +80,13 @@ if [ -n "$(lsblk --noheadings --output=MOUNTPOINT "$TARGET")" ]; then
exit 1 exit 1
fi fi
# check if the new boot is still mounted somewhere
if [ -n "$(lsblk --noheadings --output=MOUNTPOINT /dev/$BOOTPART)" ]; then
echo "/dev/$BOOTPART is still mounted somewhere." >&2
echo "Please unmount before running this script" >&2
exit 1
fi
if [ "$EUID" -ne 0 ] if [ "$EUID" -ne 0 ]
then echo "reform-migrate has to be run as root / using sudo." then echo "reform-migrate has to be run as root / using sudo."
exit exit
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment