diff options
author | Michael Stummvoll <michael@stummi.org> | 2013-03-27 16:33:17 +0100 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2013-05-06 13:54:16 +0200 |
commit | e688496fdc1baf6cc7d2b01f3752e519e038d975 (patch) | |
tree | 904f0d71f97db8e92a61f8d3adce729c30e900aa | |
parent | d93e867ac670b8345d154ccbd04b28d1c0291da1 (diff) | |
download | live-boot-e688496fdc1baf6cc7d2b01f3752e519e038d975.tar.gz live-boot-e688496fdc1baf6cc7d2b01f3752e519e038d975.zip |
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().
-rwxr-xr-x | scripts/boot/9990-misc-helpers.sh | 21 |
1 files changed, 1 insertions, 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}" |