mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-20 12:00:37 +02:00
remove already in use subvolumes
This commit is contained in:
parent
8580cfa2a7
commit
3f82f6e35b
1 changed files with 19 additions and 5 deletions
|
@ -2019,16 +2019,30 @@ find_btrfs_subvolume() {
|
||||||
[ "$1" ] && echo $1
|
[ "$1" ] && echo $1
|
||||||
done
|
done
|
||||||
umount_btrfs
|
umount_btrfs
|
||||||
else
|
### NOT NEEDED, you will be asked for create new subvolumes then!
|
||||||
# use the one from /tmp/.parts
|
#else
|
||||||
echo $SUBVOLUME
|
# # use the one from /tmp/.parts
|
||||||
[ "$1" ] && echo $1
|
# echo $SUBVOLUME
|
||||||
|
# [ "$1" ] && echo $1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
subvolumes_in_use() {
|
||||||
|
SUBVOLUME_IN_USE=""
|
||||||
|
for i in $(grep $PART[:#] /tmp/.parts); do
|
||||||
|
if [ "$(echo $i | grep ":btrfs:")" ]; then
|
||||||
|
SUBVOLUME_IN_USE="$SUBVOLUME_IN_USE $(echo $i | cut -d: -f 9)"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
choose_btrfs_subvolume () {
|
choose_btrfs_subvolume () {
|
||||||
BTRFS_SUBVOLUME="NONE"
|
BTRFS_SUBVOLUME="NONE"
|
||||||
SUBVOLUMES=$(find_btrfs_subvolume _)
|
SUBVOLUMES=$(find_btrfs_subvolume _)
|
||||||
|
subvolumes_in_use
|
||||||
|
for i in $SUBVOLUME_IN_USE; do
|
||||||
|
SUBVOLUMES=$(echo $SUBVOLUMES | sed -e "s#$i\ _##g")
|
||||||
|
done
|
||||||
if [ -n "$SUBVOLUMES" ] ; then
|
if [ -n "$SUBVOLUMES" ] ; then
|
||||||
DIALOG --menu "Select the subvolume to mount" 21 50 13 $SUBVOLUMES 2>$ANSWER || return 1
|
DIALOG --menu "Select the subvolume to mount" 21 50 13 $SUBVOLUMES 2>$ANSWER || return 1
|
||||||
BTRFS_SUBVOLUME=$(cat $ANSWER)
|
BTRFS_SUBVOLUME=$(cat $ANSWER)
|
||||||
|
@ -2128,7 +2142,7 @@ check_btrfs_filesystem_creation() {
|
||||||
for i in $(grep $PART[:#] /tmp/.parts); do
|
for i in $(grep $PART[:#] /tmp/.parts); do
|
||||||
if [ "$(echo $i | grep ":btrfs:")" ]; then
|
if [ "$(echo $i | grep ":btrfs:")" ]; then
|
||||||
FSTYPE="btrfs"
|
FSTYPE="btrfs"
|
||||||
SUBVOLUME="$SUBVOLUME#$(echo $i | cut -d: -f 9)"
|
SUBVOLUME="$SUBVOLUME $(echo $i | cut -d: -f 9)"
|
||||||
SKIP_FILESYSTEM="yes"
|
SKIP_FILESYSTEM="yes"
|
||||||
# check on filesystem creation, skip subvolume asking then!
|
# check on filesystem creation, skip subvolume asking then!
|
||||||
[ "$(echo $i | cut -d: -f 4 | grep yes)" ] && DETECT_CREATE_FILESYSTEM="yes"
|
[ "$(echo $i | cut -d: -f 4 | grep yes)" ] && DETECT_CREATE_FILESYSTEM="yes"
|
||||||
|
|
Loading…
Reference in a new issue