Skip to content

Commit

Permalink
Merge pull request #9 from sailfish-on-dontbeevil/glob-expansion-failure
Browse files Browse the repository at this point in the history
Fix glob expansion which resulted in some boot failures
  • Loading branch information
DylanVanAssche authored May 5, 2020
2 parents 51baade + 1bd68e9 commit 9cf68b7
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions flash-it.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

VERSION="0.3.1"
VERSION="0.3.2"
BRANCH=master
CUSTOM=""
UBOOT_JOB=u-boot
Expand Down Expand Up @@ -223,11 +223,11 @@ sync
echo -e "\e[1mFlashing rootFS...\e[0m"
mkdir "$MOUNT_DATA"
if [ "$CUSTOM" != "" ]; then
TEMP="${CUSTOM}/rootfs.tar.bz2"
TEMP="${CUSTOM}/rootfs.tar.bz2"
else
unzip "${ROOTFS_JOB}.zip"
TEMP=`ls $ROOTFS_DIR/*/*.tar.bz2`
echo "$TEMP"
unzip "${ROOTFS_JOB}.zip"
TEMP=`ls $ROOTFS_DIR/*/*.tar.bz2`
echo "$TEMP"
fi
sudo mount $DATAPART "$MOUNT_DATA" # Mount data partition
sudo tar -xpf "$TEMP" -C "$MOUNT_DATA"
Expand All @@ -237,11 +237,15 @@ sync
echo -e "\e[1mCopying kernel to boot partition...\e[0m"
mkdir "$MOUNT_BOOT"
sudo mount $BOOTPART "$MOUNT_BOOT" # Mount boot partition
sudo cp $MOUNT_DATA/boot/* $MOUNT_BOOT
echo "Boot partition mount: $MOUNT_BOOT"
sudo sh -c "cp $MOUNT_DATA/boot/Image $MOUNT_BOOT"
sudo sh -c "cp $MOUNT_DATA/boot/*.dtb $MOUNT_BOOT"
sudo sh -c "cp $MOUNT_DATA/boot/*.dts $MOUNT_BOOT"
echo `ls $MOUNT_BOOT`
if [ "$CUSTOM" != "" ]; then
sudo cp "${CUSTOM}/boot.scr" "$MOUNT_BOOT/boot.scr"
sudo sh -c "cp '${CUSTOM}/boot.scr' '$MOUNT_BOOT/boot.scr'"
else
sudo cp "./u-boot-bootloader/$ROOTFS_DIR/boot.scr" "$MOUNT_BOOT/boot.scr"
sudo sh -c "cp './u-boot-bootloader/$ROOTFS_DIR/boot.scr' '$MOUNT_BOOT/boot.scr'"
fi
sync

Expand All @@ -256,10 +260,10 @@ done
sudo losetup -D

if [ "$CUSTOM" == "" ]; then
rm "${UBOOT_JOB}.zip"
rm -r "$UBOOT_DIR"
rm "${ROOTFS_JOB}.zip"
rm -r "$ROOTFS_DIR"
rm "${UBOOT_JOB}.zip"
rm -r "$UBOOT_DIR"
rm "${ROOTFS_JOB}.zip"
rm -r "$ROOTFS_DIR"
fi
sudo rm -rf "$MOUNT_DATA"
sudo rm -rf "$MOUNT_BOOT"
Expand Down

0 comments on commit 9cf68b7

Please sign in to comment.