Skip to content

Commit

Permalink
Adding workaround for a busybox bug with grep -w.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tails developers authored and daniel-baumann committed Nov 24, 2011
1 parent f495b81 commit f885467
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions scripts/live
Expand Up @@ -399,7 +399,7 @@ Arguments ()
then
PERSISTENT_ENCRYPTION="none"
export PERSISTENT_ENCRYPTION
elif echo ${PERSISTENT_ENCRYPTION} | grep -qw luks
elif echo ${PERSISTENT_ENCRYPTION} | grep -qe "\<luks\>"
then
if ! modprobe dm-crypt
then
Expand Down Expand Up @@ -1403,12 +1403,12 @@ setup_unionfs ()
;;
esac

if echo ${PERSISTENT_METHOD} | grep -qw overlay
if echo ${PERSISTENT_METHOD} | grep -qe "\<overlay\>"
then
overlays="${root_persistence} ${home_persistence}"
fi

if echo ${PERSISTENT_METHOD} | grep -qw snapshot
if echo ${PERSISTENT_METHOD} | grep -qe "\<snapshot\>"
then
snapshots="${root_snapshot_label} ${home_snapshot_label}"
fi
Expand Down
14 changes: 7 additions & 7 deletions scripts/live-helpers
Expand Up @@ -46,9 +46,9 @@ storage_devices()
do
fulldevname=$(sys2dev "${sysblock}")

if echo "${black_listed_devices}" | grep -qw "${fulldevname}" || \
if echo "${black_listed_devices}" | grep -qe "\<${fulldevname}\>" || \
[ -n "${white_listed_devices}" ] && \
echo "${white_listed_devices}" | grep -vqw "${fulldevname}"
echo "${white_listed_devices}" | grep -qve "\<${fulldevname}\>"
then
# skip this device entirely
continue
Expand All @@ -58,7 +58,7 @@ storage_devices()
do
devname=$(sys2dev "${dev}")

if echo "${black_listed_devices}" | grep -qw "${devname}"
if echo "${black_listed_devices}" | grep -qe "\<${devname}\>"
then
# skip this subdevice
continue
Expand Down Expand Up @@ -379,7 +379,7 @@ find_persistent_media ()
luks_device=""

# Checking for a luks device
if echo ${PERSISTENT_ENCRYPTION} | grep -qw luks && \
if echo ${PERSISTENT_ENCRYPTION} | grep -qe "\<luks\>" && \
/sbin/cryptsetup isLuks ${dev}
then
if luks_device=$(open_luks_device "${dev}")
Expand All @@ -389,13 +389,13 @@ find_persistent_media ()
# skip $dev since we failed/chose not to open it
continue
fi
elif echo ${PERSISTENT_ENCRYPTION} | grep -qwv none
elif echo ${PERSISTENT_ENCRYPTION} | grep -qve "\<none\>"
then
# skip $dev since we don't allow unencrypted storage
continue
fi

if echo ${PERSISTENT_STORAGE} | grep -qw filesystem
if echo ${PERSISTENT_STORAGE} | grep -qe "\<filesystem\>"
then
for label in ${overlays} ${snapshots}
do
Expand All @@ -410,7 +410,7 @@ find_persistent_media ()
done
fi

if echo ${PERSISTENT_STORAGE} | grep -qw file
if echo ${PERSISTENT_STORAGE} | grep -qe "\<file\>"
then
devfstype="$(get_fstype ${dev})"
overlay_on_dev=""
Expand Down

0 comments on commit f885467

Please sign in to comment.