summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorcsk <csk@ableton.com>2017-06-29 16:33:38 +0200
committerdir <dir@ableton.com>2017-06-29 17:04:36 +0200
commitb6f35aea5a1cf351fc78b0a1f679c44c379d901a (patch)
tree2c97a011bfab131adec84e61dbba0d90ca09014a /scripts
parenta3f229e318911055a745016bede9e474e85b6cba (diff)
Make install.sh support installing on a loop device
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/install.sh18
1 files changed, 12 insertions, 6 deletions
diff --git a/scripts/install.sh b/scripts/install.sh
index dbdcfa6ad..04ae46989 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -192,15 +192,21 @@ case $ostype {
;;
(Linux)
basedev=$tgt
- rootpart=${basedev}1
- datapart=${basedev}2
+ partitionsep=""
+ if [[ $basedev = /dev/loop* ]]; then
+ (( quiet )) || print "${tgt} is a loop device"
+ partitionsep=p
+ fi
+
+ rootpart=${basedev}${partitionsep}1
+ datapart=${basedev}${partitionsep}2
if [[ $target = raspberry-pi || $target = raspberry-pi2 || $target = raspberry-pi3 || $target = raspberry-pi3-64 ]]; then
- bootpart=${basedev}1
- rootpart=${basedev}2
- datapart=${basedev}3
+ bootpart=${basedev}${partitionsep}1
+ rootpart=${basedev}${partitionsep}2
+ datapart=${basedev}${partitionsep}3
fi
- match=\'${basedev}\''+([0-9])'
+ match=\'${basedev}${partitionsep}\''+([0-9])'
function mount_fs {
mount -t "$3" "$1" "$2"
}