2015-06-11 21:50:18 +02:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; version 2 of the License.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
|
|
|
# $1: new branch
|
2016-02-25 15:51:25 +01:00
|
|
|
mount_image(){
|
|
|
|
msg2 "%s mount: %s" "${iso_fs}" "${1##*/}"
|
2015-06-11 21:50:18 +02:00
|
|
|
mount -t aufs -o br="$1":${work_dir}/root-image=ro none "$1"
|
|
|
|
}
|
|
|
|
|
2016-02-25 15:51:25 +01:00
|
|
|
mount_image_custom(){
|
|
|
|
msg2 "%s mount: %s" "${iso_fs}" "${1##*/}"
|
2016-02-25 18:37:29 +01:00
|
|
|
mount -t aufs -o br="$1":${work_dir}/${profile}-image=ro:${work_dir}/root-image=ro none "$1"
|
2015-06-11 21:50:18 +02:00
|
|
|
}
|
|
|
|
|
2015-06-25 09:59:35 +02:00
|
|
|
# $1: image path
|
|
|
|
umount_image(){
|
2015-06-11 21:50:18 +02:00
|
|
|
if mountpoint -q "$1";then
|
2016-02-25 15:51:25 +01:00
|
|
|
msg2 "%s umount: %s" "${iso_fs}" "${1##*/}"
|
2015-06-11 21:50:18 +02:00
|
|
|
umount $1
|
|
|
|
fi
|
2015-06-25 00:16:18 +02:00
|
|
|
find $1 -name '.wh.*' -delete &> /dev/null
|
|
|
|
}
|