diff --git a/create_arm_img_urpmi.sh b/create_arm_img_urpmi.sh index eb4aa37..37ab33a 100755 --- a/create_arm_img_urpmi.sh +++ b/create_arm_img_urpmi.sh @@ -68,7 +68,7 @@ function help() echo "--build-path Path to the build directory of the image of Mageia $MAGEIA_VERSION" echo "--target target system (for now rpi, odroid)" echo "--target-version version of the target (0, 1, 2, 3 for rpi, 3 or 4 for odroid)" - echo "--config Path to config files" + echo "--config Path to config files (rpi1 rpi2 rpi3 rpi3+ xu4)" echo "--bootfs filesystem of boot partition (ext4 or vfat) default: ext4" echo "--nonfree activate nonfree repos" echo "--tainted activate tainted repos" @@ -780,9 +780,11 @@ do ;; --nonfree) NONFREE_P=1 + shift ;; --tainted) TAINTED_P=1 + shift ;; --) shift @@ -806,25 +808,22 @@ if ! [ -d "$CONFIG_PATH" ];then warning "You need now to modify the config file ($CONFIG_PATH/mageia4arm.cfg) and relaunch the script" exit 2 else - error( "Error: Can't continue without config file, exiting" ) + error "Error: Can't continue without config file, exiting" exit 3 fi fi - if [ -e "$CONFIG_PATH/mageia4arm.cfg" ];then - info "using $CONFIG_PATH/mageia4arm.cfg as config" - . "$CONFIG_PATH/mageia4arm.cfg" - else - warning "Config file does not exists, do you want i copy template ? [Y|n] " - read yn - if [ -z $yn ] || [ $yn = "Y" ] || [ $yn = "y" ];then - /usr/bin/cp --preserve=mode "$SOURCE_PATH/mageia4arm.cfg.template" "$CONFIG_PATH/mageia4arm.cfg" - warning "You need now to modify the config file ($CONFIG_PATH/mageia4arm.cfg) and relaunch the script" - exit 2 - fi - fi +if [ -e "$CONFIG_PATH/mageia4arm.cfg" ];then + info "using $CONFIG_PATH/mageia4arm.cfg as config" + . "$CONFIG_PATH/mageia4arm.cfg" else - + warning "Config file does not exists, do you want i copy template ? [Y|n] " + read yn + if [ -z $yn ] || [ $yn = "Y" ] || [ $yn = "y" ];then + /usr/bin/cp --preserve=mode "$SOURCE_PATH/mageia4arm.cfg.template" "$CONFIG_PATH/mageia4arm.cfg" + warning "You need now to modify the config file ($CONFIG_PATH/mageia4arm.cfg) and relaunch the script" + exit 2 + fi fi if ! [ -z "$IMAGE_SIZE_P" ];then