aboutsummaryrefslogtreecommitdiffstats
path: root/create_arm_img_urpmi.sh
diff options
context:
space:
mode:
authorDaniel Tartavel <contact@librepc.com>2018-06-09 16:15:50 +0200
committerDaniel Tartavel <contact@librepc.com>2018-06-09 16:15:50 +0200
commit8bdc8e1724659ef7e2226c801af0e486ce289125 (patch)
treeb794e1d09444a53b68cb0c9880e3ab95eaff2e36 /create_arm_img_urpmi.sh
parent074e6a5e034651f9d0884a7b20711bd686c7e217 (diff)
downloadmageia4arm-8bdc8e1724659ef7e2226c801af0e486ce289125.tar
mageia4arm-8bdc8e1724659ef7e2226c801af0e486ce289125.tar.gz
mageia4arm-8bdc8e1724659ef7e2226c801af0e486ce289125.tar.bz2
mageia4arm-8bdc8e1724659ef7e2226c801af0e486ce289125.tar.xz
mageia4arm-8bdc8e1724659ef7e2226c801af0e486ce289125.zip
In progress modifications
Diffstat (limited to 'create_arm_img_urpmi.sh')
-rw-r--r--create_arm_img_urpmi.sh65
1 files changed, 32 insertions, 33 deletions
diff --git a/create_arm_img_urpmi.sh b/create_arm_img_urpmi.sh
index d0014eb..2f2401e 100644
--- a/create_arm_img_urpmi.sh
+++ b/create_arm_img_urpmi.sh
@@ -428,7 +428,7 @@ formatpartitions()
copyingsystem()
{
-# getting UUID of root partition
+ #getting UUID of root partition
#ROOT_ID=`/sbin/blkid -s UUID -o value "${DEVICE}p2"`
#info "blkid -s UUID -o value ${DEVICE}p2"
#info "root partition ID: $ROOT_ID"
@@ -623,59 +623,63 @@ ROOT="/mnt/root"
BUILD_PATH="$INSTALL_PATH/build"
ARM_VERSION="armv7hl"
+# assign TARGET ( rpi or xu3-4 )
+case $TARGET in
+xu3 | xu4)
+ CREATEIMG="createxu3-4image"
+ break;;
+rpi)
+ CREATEIMG="createrpiimage"
+ FIRMWARE_PATH="$SOURCE_PATH/.."
+ FIRMWARE_DOWNLOAD_URL="https://github.com/raspberrypi/firmware/archive/stable.zip"
+ FIRMWARE_DIR="firmware-stable"
+ break;;
+*)
+ CREATEIMG="createxu3-4image"
+ TARGET="xu4"
+ break;;
+esac
+
+info "target : $TARGET"
+
+# path of config file
if [ -z $CONFIG_PATH ];then
+ info " Config path do not exists, defaulting to ./$TARGET"
CONFIG_PATH="./$TARGET"
fi
if [ -d "./$CONFIG_PATH" ];then
- if [-e "./$CONFIG_PATH/config.txt" ]
+ if [ -e "./$CONFIG_PATH/config.txt" ];then
info "using $CONFIG_PATH/config.txt as config"
. "./$CONFIG_PATH/config.txt"
else
warning "Config file does not exists, do you want i copy template ? [Y|n] "
read yn
- if [ -z $yn || $yn -eq "Y" || $yn -eq "y" ];then
+ if [ -z $yn ] || [ $yn = "Y" ] || [ $yn = "y" ];then
/usr/bin/cp ./config.template "./$CONFIG_PATH/config.txt"
fi
/usr/bin/cp ./config.template "./$CONFIG_PATH/config.txt"
- warning "You need now to modify the config file and relaunch the script"
+ warning "You need now to modify the config file (./$CONFIG_PATH/config.txt) and relaunch the script"
exit 1
fi
else
warning "Config directory does not exists, do you want i make it and copy the template file in? [Y|n] "
read yn
- if [ -z $yn || $yn -eq "Y" || $yn -eq "y" ];then
+ if [ -z $yn || $yn = "Y" || $yn = "y" ];then
/usr/bin/mkdir ./$CONFIG_PATH/
/usr/bin/cp ./config.template "./$CONFIG_PATH/config.txt"
- warning "You need now to modify the config file and relaunch the script"
+ warning "You need now to modify the config file (./$CONFIG_PATH/config.txt) and relaunch the script"
fi
fi
-# assign TARGET ( rpi or xu3-4 )
-if [ $CREATEIMAGE ];then
- case $TARGET in
- xu3||xu4)
- CREATEIMG="createxu3-4image"
- break;;
- rpi)
- CREATEIMG="createrpiimage"
- FIRMWARE_PATH="$SOURCE_PATH/.."
- FIRMWARE_DOWNLOAD_URL="https://github.com/raspberrypi/firmware/archive/stable.zip"
- FIRMWARE_DIR="firmware-stable"
- break;;
- *)
- CREATEIMG="createxu3-4image"
- TARGET="xu4"
- break;;
- esac
-fi
+
info "source path: $SOURCE_PATH"
info "Install path: $INSTALL_PATH"
info "Build path: $BUILD_PATH"
info "Commande : $CMDNAME"
info "Firmware path : $FIRMWARE_PATH"
info "Firmware dir : $FIRMWARE_DIR"
-info "target : $TARGET"
+
if [[ "$IMAGE_SIZE" -lt 7 ]] || [[ "$IMAGE_SIZE" -gt 128 ]];then
IMAGE_SIZE=7
@@ -715,13 +719,9 @@ case $OPT in
all)
verify_disk_space
if [ $? -eq 1 ];then
- warning "Not enough space on disk"
- if ! [ -e /usr/bin/dialog ];then
- warning "installing cdialog"
- urpmi --auto --force cdialog
- fi
- dialog --yesno "Not enough space on disk\nDo you want to continue anyway ?" 7 40
- if [ $? -eq 1 ];then
+ echo "Not enough space on disk\nDo you want to continue anyway ? [Y,n]"
+ read yn
+ if [ $yn = "n" ];then
exit 6
fi
fi
@@ -756,4 +756,3 @@ case $OPT in
installbasesystem
;;
esac
-