diff options
-rwxr-xr-x | create_arm_image.sh | 2 | ||||
-rwxr-xr-x | functions.sh | 15 |
2 files changed, 17 insertions, 0 deletions
diff --git a/create_arm_image.sh b/create_arm_image.sh index 5a46a69..75b243c 100755 --- a/create_arm_image.sh +++ b/create_arm_image.sh @@ -321,6 +321,8 @@ print_info "Firmware path : ${FIRMWARE_PATH}" print_info "Firmware dir : ${FIRMWARE_DIR}" print_info "Installation method : ${INSTALL_METHOD}" +check_environment + # change dir to install path and create it if not existing if [ "${OPT}" != "clean" ]; then print_info "cd ${INSTALL_PATH}" diff --git a/functions.sh b/functions.sh index ceb848a..5d331e4 100755 --- a/functions.sh +++ b/functions.sh @@ -59,6 +59,21 @@ function error() { } +function check_environment() { + if [ "x${INSTALL_METHOD}" == "xurpmi" ]; then + hash /usr/sbin/urpmi + if [ 0 -ne ${?} ]; then + error "urpmi is missing." + fi + elif [ "x${INSTALL_METHOD}" == "xurpmi" ]; then + hash /usr/bin/dnf + if [ 0 -ne ${?} ]; then + error "dnf is missing." + fi + fi + ### TODO add other environmnet things, like : from function createchroot() +} + function verify_disk_space() { title "Verifying if there is enough space on disk to make the image" DISK_SPACE=$(/usr/bin/df -BG --output=avail "${INSTALL_PATH}" | sed '1d;s/[^0-9]//g') |