From a30406b8fc802c5889bffba4332b848bc0ce59d9 Mon Sep 17 00:00:00 2001 From: Jybz Date: Thu, 10 Sep 2020 14:29:48 +0200 Subject: Add alternative for --config between a name in ./platform or a path to another place. Preparing the mageia4arm spec for RPM. --- create_arm_image.sh | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'create_arm_image.sh') diff --git a/create_arm_image.sh b/create_arm_image.sh index a0d285c..2649bc0 100755 --- a/create_arm_image.sh +++ b/create_arm_image.sh @@ -55,10 +55,10 @@ info ${0} # error "qemu-user-static package is needed." # exit ${ERR_DEPENDENCY_MISSING} #fi -if [ 0 -ne $(id -u) ]; then - error "Script need to be run as root." - exit ${ERR_NOT_ROOT} -fi +# if [ 0 -ne $(id -u) ]; then +# error "Script need to be run as root." +# exit ${ERR_NOT_ROOT} +# fi SOURCE_PATH="$(/usr/bin/dirname "$(readlink -f "${0}")")" INSTALL_PATH="$(pwd)/build" @@ -119,7 +119,12 @@ while true; do shift ;; --config) - CONFIG_PATH="${PLATFORMS_PATH}/${2}" + PATH_NOT_NAME=$(echo "${2}" | grep '/' 2>&1 1>/dev/null && echo "true" || echo "false" ) + if [ $PATH_NOT_NAME == true ] ; then + CONFIG_PATH="${2}" + else + CONFIG_PATH="${PLATFORMS_PATH}/${2}" + fi shift 2 ;; --create-chroot) @@ -186,9 +191,9 @@ while true; do fi shift ;; -# --) -# shift -# break;; + --) + shift + break;; *) error "Parameter ${1} does not exists " exit ${ERR_1};; @@ -298,6 +303,7 @@ case ${OPT} in fi fi createImageWrap #Create the empty .img + mountPartitions createchroot #Check qemu and activate it if [ ${INSTALL_METHOD} = "urpmi" ]; then addurpmimedia @@ -308,7 +314,6 @@ case ${OPT} in mkfstab preparechroot jumpchroot - mountPartitions copyingsystem bunrningBootloader unmountingPartitions -- cgit v1.2.1