aboutsummaryrefslogtreecommitdiffstats
path: root/create_arm_img_urpmi.sh
diff options
context:
space:
mode:
authorDaniel Tartavel <contact@librepc.com>2018-07-26 07:37:59 +0200
committerDaniel Tartavel <contact@librepc.com>2018-07-26 07:37:59 +0200
commit27534ed173c612560ce7a2addcc7a6eca3b18402 (patch)
tree4d00d1820b838fa8160246590fa40a6320636797 /create_arm_img_urpmi.sh
parent347ced325ff1fbad8b1eeb4d199b12df284efe6a (diff)
downloadmageia4arm-27534ed173c612560ce7a2addcc7a6eca3b18402.tar
mageia4arm-27534ed173c612560ce7a2addcc7a6eca3b18402.tar.gz
mageia4arm-27534ed173c612560ce7a2addcc7a6eca3b18402.tar.bz2
mageia4arm-27534ed173c612560ce7a2addcc7a6eca3b18402.tar.xz
mageia4arm-27534ed173c612560ce7a2addcc7a6eca3b18402.zip
- added error managing on umounting dev, sys, proc
- corrected a bug in copyingsystem - corrected fstab - corrected a bug in copying tools
Diffstat (limited to 'create_arm_img_urpmi.sh')
-rwxr-xr-xcreate_arm_img_urpmi.sh30
1 files changed, 21 insertions, 9 deletions
diff --git a/create_arm_img_urpmi.sh b/create_arm_img_urpmi.sh
index a859213..263a9a7 100755
--- a/create_arm_img_urpmi.sh
+++ b/create_arm_img_urpmi.sh
@@ -292,20 +292,24 @@ EOF" >>"$BUILD_PATH/second_stage_install.sh"
/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 "
+ error "line $LINENO Warning : chrooting to $BUILD_PATH retrurn an error $RET"
+ ERRORN=$((ERRORN++))
fi
info "unmounting dev, sys, proc"
/bin/umount "$BUILD_PATH/dev"
if [ $? -ne 0 ];then
warning "line $LINENO Warning : error unmounting $BUILD_PATH/dev, continuing anyway"
+ ERRORN=$((ERRORN++))
fi
/bin/umount "$BUILD_PATH/sys"
if [ $? -ne 0 ];then
warning "line $LINENO Warning : error unmounting $BUILD_PATH/sys, continuing anyway"
+ ERRORN=$((ERRORN++))
fi
/bin/umount "$BUILD_PATH/proc"
if [ $? -ne 0 ];then
warning "line $LINENO Warning : error unmounting $BUILD_PATH/proc, continuing anyway"
+ ERRORN=$((ERRORN++))
fi
}
@@ -466,14 +470,10 @@ copyingsystem()
info "making /etc/fstab"
echo "proc /proc proc defaults 0 0
-$BOOT_UUID /boot vfat defaults 0 0
-$ROOT_UUID / ext4 defaults 0 0" > "$BUILD_PATH"/etc/fstab
-
- info "copying Mageia image to root partition"
- /bin/rsync -a --exclude "boot/" --exclude "qemu-arm-static*" "$BUILD_PATH/" "$ROOT/"
- /bin/rsync -a "$BUILD_PATH/boot/" "$BOOT/"
- /bin/mkdir "$ROOT/boot"
+UUID=$BOOT_UUID /boot vfat defaults 0 0
+UUID=$ROOT_UUID / ext4 defaults 0 0" > "$BUILD_PATH"/etc/fstab
+
case $TARGET in
rpi)
info "copying raspberry firmware in /boot"
@@ -508,11 +508,21 @@ brcmfmac" >> "$BUILD_PATH"/etc/modules
exit 1
fi
info "copying tools in /usr/local/"
- /bin/cp -a "$SOURCE_PATH/tools" "/usr/local"
+ /bin/cp -a "$SOURCE_PATH/tools" "$BUILD_PATH/usr/local"
+ if ! [ $? -eq 0 ];then
+ error "line $LINENO error copying tools"
+ ERRORN=$((ERRORN++))
+ fi
;;
xu3-4)
;;
esac
+
+ info "copying Mageia image to root partition"
+ /bin/rsync -a --exclude "boot/" --exclude "qemu-arm-static*" "$BUILD_PATH/" "$ROOT/"
+ /bin/rsync -a "$BUILD_PATH/boot/" "$BOOT/"
+ /bin/mkdir "$ROOT/boot"
+
copyingcommon
/usr/bin/sync
/usr/bin/umount "$BOOT" "$ROOT"
@@ -767,3 +777,5 @@ case $OPT in
installbasesystem
;;
esac
+
+warning "Some errors occurs : $ERRORN errors"