diff options
Diffstat (limited to 'backend/modules/partitions')
-rw-r--r-- | backend/modules/partitions | 7 |
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 } |