From 386dfc194b2a8b0f96197650cc6684ef40f6d192 Mon Sep 17 00:00:00 2001 From: Bruno Cornec Date: Sun, 20 Oct 2019 19:48:05 +0200 Subject: [PATCH 1/4] Fix usage of nonfree or tainted --- create_arm_img_urpmi.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/create_arm_img_urpmi.sh b/create_arm_img_urpmi.sh index eb4aa37..a7e5faa 100755 --- a/create_arm_img_urpmi.sh +++ b/create_arm_img_urpmi.sh @@ -780,9 +780,11 @@ do ;; --nonfree) NONFREE_P=1 + shift ;; --tainted) TAINTED_P=1 + shift ;; --) shift From 4cdccda8cb1af3eb6369a20d34276e7f51a000a5 Mon Sep 17 00:00:00 2001 From: Bruno Cornec Date: Sun, 20 Oct 2019 19:52:20 +0200 Subject: [PATCH 2/4] Fix call to error function --- create_arm_img_urpmi.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/create_arm_img_urpmi.sh b/create_arm_img_urpmi.sh index a7e5faa..14ed117 100755 --- a/create_arm_img_urpmi.sh +++ b/create_arm_img_urpmi.sh @@ -808,7 +808,7 @@ 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 From e349d47c90ab9422996a41e178c1a31c80958313 Mon Sep 17 00:00:00 2001 From: Bruno Cornec Date: Sun, 20 Oct 2019 20:00:10 +0200 Subject: [PATCH 3/4] Improve config help description --- create_arm_img_urpmi.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/create_arm_img_urpmi.sh b/create_arm_img_urpmi.sh index 14ed117..b16d9eb 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" From 1c25a157600ac79236272c71aa0dafb100444b25 Mon Sep 17 00:00:00 2001 From: Bruno Cornec Date: Sun, 20 Oct 2019 20:06:09 +0200 Subject: [PATCH 4/4] Fix an unbalanced if then else --- create_arm_img_urpmi.sh | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/create_arm_img_urpmi.sh b/create_arm_img_urpmi.sh index b16d9eb..37ab33a 100755 --- a/create_arm_img_urpmi.sh +++ b/create_arm_img_urpmi.sh @@ -813,20 +813,17 @@ if ! [ -d "$CONFIG_PATH" ];then 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