1
0

- added error managing on umounting dev, sys, proc

- corrected a bug in copyingsystem
- corrected fstab
- corrected a bug in copying tools
This commit is contained in:
Daniel Tartavel 2018-07-26 07:37:59 +02:00
parent 347ced325f
commit 27534ed173

View File

@ -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' /sbin/chroot --userspec root:root "$BUILD_PATH" /bin/bash -v -c 'sh /second_stage_install.sh'
RET=$? RET=$?
if [ $RET -ne 0 ];then 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 fi
info "unmounting dev, sys, proc" info "unmounting dev, sys, proc"
/bin/umount "$BUILD_PATH/dev" /bin/umount "$BUILD_PATH/dev"
if [ $? -ne 0 ];then if [ $? -ne 0 ];then
warning "line $LINENO Warning : error unmounting $BUILD_PATH/dev, continuing anyway" warning "line $LINENO Warning : error unmounting $BUILD_PATH/dev, continuing anyway"
ERRORN=$((ERRORN++))
fi fi
/bin/umount "$BUILD_PATH/sys" /bin/umount "$BUILD_PATH/sys"
if [ $? -ne 0 ];then if [ $? -ne 0 ];then
warning "line $LINENO Warning : error unmounting $BUILD_PATH/sys, continuing anyway" warning "line $LINENO Warning : error unmounting $BUILD_PATH/sys, continuing anyway"
ERRORN=$((ERRORN++))
fi fi
/bin/umount "$BUILD_PATH/proc" /bin/umount "$BUILD_PATH/proc"
if [ $? -ne 0 ];then if [ $? -ne 0 ];then
warning "line $LINENO Warning : error unmounting $BUILD_PATH/proc, continuing anyway" warning "line $LINENO Warning : error unmounting $BUILD_PATH/proc, continuing anyway"
ERRORN=$((ERRORN++))
fi fi
} }
@ -466,14 +470,10 @@ copyingsystem()
info "making /etc/fstab" info "making /etc/fstab"
echo "proc /proc proc defaults 0 0 echo "proc /proc proc defaults 0 0
$BOOT_UUID /boot vfat defaults 0 0 UUID=$BOOT_UUID /boot vfat defaults 0 0
$ROOT_UUID / ext4 defaults 0 0" > "$BUILD_PATH"/etc/fstab UUID=$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"
case $TARGET in case $TARGET in
rpi) rpi)
info "copying raspberry firmware in /boot" info "copying raspberry firmware in /boot"
@ -508,11 +508,21 @@ brcmfmac" >> "$BUILD_PATH"/etc/modules
exit 1 exit 1
fi fi
info "copying tools in /usr/local/" 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) xu3-4)
;; ;;
esac 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 copyingcommon
/usr/bin/sync /usr/bin/sync
/usr/bin/umount "$BOOT" "$ROOT" /usr/bin/umount "$BOOT" "$ROOT"
@ -767,3 +777,5 @@ case $OPT in
installbasesystem installbasesystem
;; ;;
esac esac
warning "Some errors occurs : $ERRORN errors"