From e053cb083759d6d3ffa4febac92b4d172e7a7162 Mon Sep 17 00:00:00 2001 From: Daniel Tartavel Date: Tue, 17 Jul 2018 11:18:06 +0200 Subject: [PATCH] - some bugs corrected --- create_arm_img_urpmi.sh | 50 +++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/create_arm_img_urpmi.sh b/create_arm_img_urpmi.sh index c16cb9d..59b3fb0 100755 --- a/create_arm_img_urpmi.sh +++ b/create_arm_img_urpmi.sh @@ -114,6 +114,7 @@ function clean() else warning "$IMAGE does not exists" fi + if [ -d "$BOOT" ];then info "Removing $BOOT" /bin/rmdir $BOOT @@ -481,7 +482,7 @@ brcmfmac bcm2835-nrg" >> "$BUILD_PATH"/etc/modules info "copying modprobe.conf" - /bin/cp -a $SOURCE_PATH/modprobe.conf $BUILD_PATH/etc/ + /bin/cp -a $SOURCE_PATH/$CONFIG_PATH/modprobe.conf $BUILD_PATH/etc/ chown root:root $BUILD_PATH/etc/modprobe.conf info "making /boot/cmdline.txt" @@ -494,7 +495,7 @@ bcm2835-nrg" >> "$BUILD_PATH"/etc/modules info "copying wifi firmware file missing in Mageia" /bin/mkdir -p "$ROOT/usr/lib/firmware/brcm/" - cp "$SOURCE_PATH/brcmfmac43430-sdio.txt" "$ROOT/usr/lib/firmware/brcm/" + cp "$SOURCE_PATH/$CONFIG_PATH/brcmfmac43430-sdio.txt" "$ROOT/usr/lib/firmware/brcm/" if [ $? -ne 0 ];then error "line $LINENO error copying wifi firmware in $ROOTP/usr/lib/firmware/brcm/ : exiting" exit 1 @@ -502,9 +503,10 @@ bcm2835-nrg" >> "$BUILD_PATH"/etc/modules ;; xu3-4) ;; - esac - - /bin/umount "$BOOT" "$ROOT" + esac + + /usr/bin/sync + /usr/bin/umount "$BOOT" "$ROOT" if [ $? -eq 0 ];then /bin/rmdir "$BOOT" "$ROOT" else @@ -512,7 +514,7 @@ bcm2835-nrg" >> "$BUILD_PATH"/etc/modules exit 1 fi - /sbin/partx -d "$DEVICE" + /usr/sbin/partx -d "$DEVICE" if [ $? -ne 0 ];then error "line $LINENO warning : error unmounting $DEVICE " exit 1 @@ -621,24 +623,6 @@ 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" - ;; -rpi) - CREATEIMG="createrpiimage" - FIRMWARE_PATH="$SOURCE_PATH/.." - FIRMWARE_DOWNLOAD_URL="https://github.com/raspberrypi/firmware/archive/stable.zip" - FIRMWARE_DIR="firmware-stable" - ;; -*) - CREATEIMG="createxu3-4image" - TARGET="xu4" - ;; -esac - - # path of config file if [ -z $SOURCE_PATH/$CONFIG_PATH ];then info " Config path do not exists, defaulting to ./$TARGET" @@ -669,6 +653,24 @@ else exit fi fi + +# assign TARGET ( rpi or xu3-4 ) +case $TARGET in +xu3 | xu4) + CREATEIMG="createxu3image" + ;; +rpi) + CREATEIMG="createrpiimage" + FIRMWARE_PATH="$SOURCE_PATH/.." + FIRMWARE_DOWNLOAD_URL="https://github.com/raspberrypi/firmware/archive/stable.zip" + FIRMWARE_DIR="firmware-stable" + ;; +*) + error "No Target : $TARGET" + exit 1 + ;; +esac + info "target : $TARGET" info "source path: $SOURCE_PATH" info "Install path: $INSTALL_PATH"