From 8bdc8e1724659ef7e2226c801af0e486ce289125 Mon Sep 17 00:00:00 2001 From: Daniel Tartavel Date: Sat, 9 Jun 2018 16:15:50 +0200 Subject: [PATCH] In progress modifications --- create_arm_img_urpmi.sh | 65 ++++++++++++++++++++--------------------- xu4/config.txt | 6 ++-- 2 files changed, 35 insertions(+), 36 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 - diff --git a/xu4/config.txt b/xu4/config.txt index 554aa55..178b1fa 100644 --- a/xu4/config.txt +++ b/xu4/config.txt @@ -15,9 +15,9 @@ # along with this program. If not, see . -MAGEIA_VERSION="6" +MAGEIA_VERSION="cauldron" ARM_VERSION="armv7hl" -TARGET="xu3-4" +TARGET="xu4" # URL of the Mageia mirror used to install ( see mirrors.mageia.org ) MIRROR="http://ftp.free.fr/mirrors/mageia.org/distrib/$MAGEIA_VERSION/$ARM_VERSION" @@ -46,7 +46,7 @@ ROOT_PWD="odroid" HOSTNAME="xu4.odroid" #Filesystem of boot partitions (default ext4) -#BOOTFS=ext4 +BOOTFS=ext4 #kernel package to install KERNEL=kernel-odroid