Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac OSX - writeimage.sh string indexing error #857

Closed
Mitoflyboy opened this issue Mar 30, 2017 · 3 comments
Closed

Mac OSX - writeimage.sh string indexing error #857

Mitoflyboy opened this issue Mar 30, 2017 · 3 comments

Comments

@Mitoflyboy
Copy link

Mitoflyboy commented Mar 30, 2017

Hi,
I am running OSX 10.12.3, and when I run the 'writeimage.sh' script I get the error:

:: decompressing the gzipped image
./writeimage.sh: line 83: -3: substring expression < 0

After some research it appears that the bash version on OSX doesnt support negative string indexing. The solution is below:

- $gunzip -c $DISK_IMG > ${DISK_IMG::-3}
- DISK_IMG=${DISK_IMG::-3}
+ $gunzip -c $DISK_IMG > ${DISK_IMG::$#-3}
+ DISK_IMG=${DISK_IMG::$#-3}

Thanks

@tommy-rk
Copy link

I was creating a motioneyeos sd card today using https://etcher.io/.
Etcher is also recommended by Raspberry Pi installation guide here: https://www.raspberrypi.org/documentation/installation/installing-images/mac.md

Maybe the documentation should be altered and also recommend etcher?

@bortek
Copy link
Collaborator

bortek commented Jun 1, 2017

thanks I have updated wiki page with this info
https://github.com/ccrisan/motioneyeos/wiki/Installation

@bortek bortek closed this as completed Jun 1, 2017
@Choscura
Copy link

I was having trouble running writeimage.sh on Fedora25, I was getting a few errors and I'm not sure if I'm doing something wrong or what.

sudo ./writeimage.sh -d /dev/sdb1 -i "motioneyeos-raspberrypi-20170710.img.gz" -n 'secret:secret'
[sudo] password for choscura:
:: decompressing the gzipped image
./writeimage.sh: line 83: motioneyeos-raspberrypi-20170710.img: Is a directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants