summaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorJoerg Schirottke <master@kanotix.com>2020-12-29 18:22:25 +0100
committerHolger Paradies <retabell@gmx.de>2020-12-30 13:22:28 +0100
commit8c67efc87bdf75cc990c8c397a063a51ae7cd0d0 (patch)
tree030afe3730298f8dd81571ffbbfffe5079138273 /backend
parent6261b8418846d9132e3055ea53d1a95b90b35ce4 (diff)
downloadacritoxinstaller-8c67efc87bdf75cc990c8c397a063a51ae7cd0d0.zip
acritoxinstaller-8c67efc87bdf75cc990c8c397a063a51ae7cd0d0.tar.gz
remove ventoy live media
Diffstat (limited to 'backend')
-rw-r--r--backend/modules/partitions7
1 files changed, 5 insertions, 2 deletions
diff --git a/backend/modules/partitions b/backend/modules/partitions
index 0d397c9..bc89012 100644
--- a/backend/modules/partitions
+++ b/backend/modules/partitions
@@ -7,7 +7,10 @@
# /dev/sda
function strip_live_media()
{
- grep -ve '^$' $(awk '{if(($2=="/live/image" || $2=="/lib/live/mount/medium" || $2=="/run/live/medium") && $3=="iso9660"){gsub(/[0-9]*$/,"",$1); print "-e ^"$1; exit 0;}}' < /proc/mounts)
+ VENTOY_DEV=$(dmsetup deps ventoy -o devname 2>/dev/null|awk -F['()'] '{print "/dev/"$2}'|sed 's/[0-9]\+//')
+ VENTOY_GREP=
+ [ "$VENTOY_DEV" ] && VENTOY_GREP="-e $VENTOY_DEV"
+ grep -ve '^$' $(awk '{if(($2=="/live/image" || $2=="/lib/live/mount/medium" || $2=="/run/live/medium") && $3=="iso9660"){gsub(/[0-9]*$/,"",$1); print "-e ^"$1; exit 0;}}' < /proc/mounts) $VENTOY_GREP
}
# Synopsis: list_all_disks
@@ -19,7 +22,7 @@ function strip_live_media()
function list_all_disks()
{
(
- awk -vli="$(awk '{if($2=="sd"||$2=="md"||$2=="mmc"||$2=="nvme") print $1;}' /proc/devices)" 'BEGIN{m=split(li,list," ")}{for(i=1;i<=m;i++) if(($1==list[i]&&$2%16==0)||($1==list[i]&&$2==126||($1==list[i]+8&&$2%16==0))) print "/dev/"$4;}' /proc/partitions
+ awk -vli="$(awk '{if($2=="sd"||$2=="md"||$2=="mmc"||$2=="nvme") print $1;}' /proc/devices)" 'BEGIN{m=split(li,list," ")}{for(i=1;i<=m;i++) if(($1==list[i]&&$2%16==0)||($1==list[i]&&$2==126||($1==list[i]+8&&$2%16==0))) print "/dev/"$4;}' /proc/partitions
) | strip_live_media
}