fix update-grub2

This commit is contained in:
Aiden McClelland
2023-06-16 18:03:50 -06:00
committed by Aiden McClelland
parent 90424e8329
commit e95d56a5d0
4 changed files with 17 additions and 24 deletions

View File

@@ -25,6 +25,7 @@ libavahi-client3
lm-sensors
lvm2
magic-wormhole
man-db
ncdu
net-tools
network-manager

View File

@@ -3,30 +3,10 @@
ARGS=
for ARG in $@; do
if [ "${ARG%%[!/]*}" = "/" ]; then
OPTIONS=
path="$ARG"
while true; do
if FSTYPE=$( findmnt -n -o FSTYPE "$path" ); then
if [ "$FSTYPE" = "overlay" ]; then
OPTIONS=$(findmnt -n -o OPTIONS "$path")
break
else
break
fi
fi
if [ "$path" = "/" ]; then break; fi
path=$(dirname "$path")
done
if LOWERDIR=$(echo "$OPTIONS" | grep -m 1 -oP 'lowerdir=\K[^,]+'); then
#echo "[DEBUG] Overlay filesystem detected ${ARG} --> ${LOWERDIR}${ARG%*/}" 1>&2
ARG=/media/embassy/embassyfs"${ARG%*/}"
if [ -d "/media/embassy/embassyfs" ] && [ "$ARG" = "/" ]; then
ARG=/media/embassy/embassyfs
fi
fi
ARGS="$ARGS $ARG"
ARGS="$ARGS $ARG"
done
grub-probe-default $ARGS