From e688496fdc1baf6cc7d2b01f3752e519e038d975 Mon Sep 17 00:00:00 2001 From: Michael Stummvoll Date: Wed, 27 Mar 2013 16:33:17 +0100 Subject: [PATCH] Using is_live_path() in mount_images_in_directory() to avoid redundant logic. mount_images_in_directory() had is own logic for checking if this is a live path which was redundant, so I used is_live_path(). --- scripts/boot/9990-misc-helpers.sh | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/scripts/boot/9990-misc-helpers.sh b/scripts/boot/9990-misc-helpers.sh index 40e69be..83b822d 100755 --- a/scripts/boot/9990-misc-helpers.sh +++ b/scripts/boot/9990-misc-helpers.sh @@ -62,32 +62,13 @@ get_backing_device () esac } -match_files_in_dir () -{ - # Does any files match pattern ${1} ? - local pattern - pattern="${1}" - - if [ "$(echo ${pattern})" != "${pattern}" ] - then - return 0 - fi - - return 1 -} - mount_images_in_directory () { directory="${1}" rootmnt="${2}" mac="${3}" - if match_files_in_dir "${directory}/${LIVE_MEDIA_PATH}/*.squashfs" || - match_files_in_dir "${directory}/${LIVE_MEDIA_PATH}/*.ext2" || - match_files_in_dir "${directory}/${LIVE_MEDIA_PATH}/*.ext3" || - match_files_in_dir "${directory}/${LIVE_MEDIA_PATH}/*.ext4" || - match_files_in_dir "${directory}/${LIVE_MEDIA_PATH}/*.jffs2" || - match_files_in_dir "${directory}/${LIVE_MEDIA_PATH}/*.dir" + if is_live_path "${directory}" then [ -n "${mac}" ] && adddirectory="${directory}/${LIVE_MEDIA_PATH}/${mac}" setup_unionfs "${directory}/${LIVE_MEDIA_PATH}" "${rootmnt}" "${adddirectory}" -- 2.1.4