aboutsummaryrefslogtreecommitdiffstats
path: root/create_arm_img_urpmi.sh
diff options
context:
space:
mode:
authorDaniel Tartavel <contact@librepc.com>2018-07-16 09:58:28 +0200
committerDaniel Tartavel <contact@librepc.com>2018-07-16 09:58:28 +0200
commit2741c53da16ef8b32013ff12107e6ee8cb3c4446 (patch)
treeb5c2fb0e4cff153b50143c03873df084435a3447 /create_arm_img_urpmi.sh
parentec5799d4b9a53d24ef090afb1b884d0b777688ec (diff)
downloadmageia4arm-2741c53da16ef8b32013ff12107e6ee8cb3c4446.tar
mageia4arm-2741c53da16ef8b32013ff12107e6ee8cb3c4446.tar.gz
mageia4arm-2741c53da16ef8b32013ff12107e6ee8cb3c4446.tar.bz2
mageia4arm-2741c53da16ef8b32013ff12107e6ee8cb3c4446.tar.xz
mageia4arm-2741c53da16ef8b32013ff12107e6ee8cb3c4446.zip
- some bugs
Diffstat (limited to 'create_arm_img_urpmi.sh')
-rwxr-xr-x[-rw-r--r--]create_arm_img_urpmi.sh69
1 files changed, 33 insertions, 36 deletions
diff --git a/create_arm_img_urpmi.sh b/create_arm_img_urpmi.sh
index 2f2401e..c16cb9d 100644..100755
--- a/create_arm_img_urpmi.sh
+++ b/create_arm_img_urpmi.sh
@@ -37,7 +37,7 @@ function error()
}
SOURCE_PATH="`/bin/dirname \"$(readlink -f \"$0\")\"`"
-INSTALL_PATH="$SOURCE_PATH/raspi"
+INSTALL_PATH="$SOURCE_PATH/arm"
FILES_PATH="$SOURCE_PATH/files"
CMDNAME=`/bin/basename -z "$0"`
@@ -248,20 +248,20 @@ function jumpchroot()
echo "$HOSTNAME" > "$BUILD_PATH"/etc/hostname
info "copying second stage script in $BUILD_PATH"
- echo "/bin/cp $SOURCE_PATH/second_stage_install.sh $BUILD_PATH/"
- cp "$SOURCE_PATH/second_stage_install.sh" "$BUILD_PATH/second_stage_install.sh"
+ echo "/bin/cp $SOURCE_PATH/$CONFIG_PATH/second_stage_install.sh $BUILD_PATH/"
+ cp "$SOURCE_PATH/$CONFIG_PATH/second_stage_install.sh" "$BUILD_PATH/second_stage_install.sh"
if [ $? -ne 0 ];then
- error "line $LINENO error copying $SOURCE_PATH/second_stage_install.sh : exiting"
+ error "line $LINENO error copying $SOURCE_PATH/$CONFIG_PATH/second_stage_install.sh : exiting"
exit 1
fi
- info "copying kernel-odroid rpm in $BUILD_PATH"
- echo "/bin/cp $SOURCE_PATH/kernel-odroid-4.14.y-1.armv7hl.rpm $BUILD_PATH/"
- /usr/bin/cp "$SOURCE_PATH/kernel-odroid-4.14.y-1.armv7hl.rpm" "$BUILD_PATH/"
- if [ $? -ne 0 ];then
- error "line $LINENO error copying $SOURCE_PATH/kernel-odroid-4.14.y-1.armv7hl.rpm : exiting"
- exit 1
- fi
+# info "copying kernel-odroid rpm in $BUILD_PATH"
+# echo "/bin/cp $SOURCE_PATH/kernel-odroid-4.14.y-1.armv7hl.rpm $BUILD_PATH/"
+# /usr/bin/cp "$SOURCE_PATH/kernel-odroid-4.14.y-1.armv7hl.rpm" "$BUILD_PATH/"
+# if [ $? -ne 0 ];then
+# error "line $LINENO error copying $SOURCE_PATH/kernel-odroid-4.14.y-1.armv7hl.rpm : exiting"
+# exit 1
+# fi
info "creation of user account"
echo "/bin/passwd << EOF
@@ -280,11 +280,11 @@ EOF" >>"$BUILD_PATH/second_stage_install.sh"
/bin/rsync -a /etc/skel/ "$BUILD_PATH/root/"
title "chrooting to $BUILD_PATH"
- /sbin/chroot --userspec root:root "$BUILD_PATH" /bin/bash -v -c '/second_stage_install.sh'
- if [ $? -ne 0 ];then
- warning "line $LINENO Warning : chrooting to $BUILD_PATH"
+ /sbin/chroot --userspec root:root "$BUILD_PATH" /bin/bash -v -c 'sh /second_stage_install.sh'
+ RET=$?
+ if [ $RET -ne 0 ];then
+ warning "line $LINENO Warning : chrooting to $BUILD_PATH retrurn an error $RET "
fi
-
info "unmounting dev, sys, proc"
/bin/umount "$BUILD_PATH/dev"
if [ $? -ne 0 ];then
@@ -545,9 +545,7 @@ do
shift 1
;;
--clean)
- if [ -z $OPT ];then
- OPT="clean"
- fi
+ OPT="clean"
shift
;;
--size)
@@ -627,52 +625,51 @@ ARM_VERSION="armv7hl"
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
+if [ -z $SOURCE_PATH/$CONFIG_PATH ];then
info " Config path do not exists, defaulting to ./$TARGET"
- CONFIG_PATH="./$TARGET"
+ CONFIG_PATH="$SOURCE_PATH/$TARGET"
fi
-if [ -d "./$CONFIG_PATH" ];then
- if [ -e "./$CONFIG_PATH/config.txt" ];then
- info "using $CONFIG_PATH/config.txt as config"
- . "./$CONFIG_PATH/config.txt"
+if [ -d "$SOURCE_PATH/$CONFIG_PATH" ];then
+ if [ -e "$SOURCE_PATH/$CONFIG_PATH/config.txt" ];then
+ info "using $SOURCE_PATH/$CONFIG_PATH/config.txt as config"
+ . "$SOURCE_PATH/$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 = "Y" ] || [ $yn = "y" ];then
- /usr/bin/cp ./config.template "./$CONFIG_PATH/config.txt"
+ /usr/bin/cp $SOURCE_PATH/config.template "$SOURCE_PATH/$CONFIG_PATH/config.txt"
fi
- /usr/bin/cp ./config.template "./$CONFIG_PATH/config.txt"
- warning "You need now to modify the config file (./$CONFIG_PATH/config.txt) and relaunch the script"
+ /usr/bin/cp $SOURCE_PATH/config.template "$SOURCE_PATH/$CONFIG_PATH/config.txt"
+ warning "You need now to modify the config file ($SOURCE_PATH/$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 = "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 (./$CONFIG_PATH/config.txt) and relaunch the script"
+ /usr/bin/mkdir $SOURCE_PATH/$CONFIG_PATH/
+ /usr/bin/cp $SOURCE_PATH/config.template "$SOURCE_PATH/$CONFIG_PATH/config.txt"
+ warning "You need now to modify the config file ($SOURCE_PATH/$CONFIG_PATH/config.txt) and relaunch the script"
+ exit
fi
fi
-
-
+info "target : $TARGET"
info "source path: $SOURCE_PATH"
info "Install path: $INSTALL_PATH"
info "Build path: $BUILD_PATH"