Changeset - 4d7f924adca6
[Approved]
0 1 0
Dennis Fink - 2 years ago 2022-06-08 22:22:40
dennis.fink@c3l.lu
Use cd ... || exit in case cd fails.

https://www.shellcheck.net/wiki/SC2164
1 file changed with 3 insertions and 3 deletions:
2 comments (0 inline, 2 general)
flashEMMC.sh
Show inline comments
 
@@ -49,27 +49,27 @@ p
 

	
 

	
 
w
 
EOF
 
}
 

	
 
createEXT4fs() {
 
	mkfs.ext4 -O ^metadata_csum,^64bit /dev/"${DEV}"1
 
}
 

	
 
cdToScript() {
 
	TMP=$(dirname "$0")
 
	cd "$TMP"
 
	cd "$TMP" || exit
 
	mkdir flashEMMC
 
	cd flashEMMC
 
	cd flashEMMC || exit
 
}
 

	
 
unmountFS() {
 
	umount root
 
}
 

	
 
panic() {
 
	cdToScript
 
	unmountFS
 
	exit 1
 
}
 

	
 
@@ -82,25 +82,25 @@ downloadImage() {
 

	
 
extractImage() {
 
	bsdtar -xpf ArchLinuxARM-odroid-c2-latest.tar.gz -C root
 
}
 

	
 
mountFS() {
 
	mkdir root
 
	mount /dev/"${DEV}"1 root
 
	[ -e ${IMAGE_NAME}.md5 ] && md5sum -c ${IMAGE_NAME}.md5 || downloadImage && extractImage
 
}
 

	
 
flashBootloader() {
 
	cd root/boot
 
	cd root/boot || exit
 
	./sd_fusing.sh /dev/"${DEV}"
 
	cd ../..
 
}
 

	
 

	
 
main() {
 
	checkRoot
 
	diskInfo
 
	verifyRightDrive
 
	umountInitially
 
	zeroBeginning
 
	partitionEMMC
Dennis Fink (metalgamer) 2 years ago comment on pull request "Fixed some shellcheck warnings"

Status change: Under review

x 2 years ago comment on pull request "Fixed some shellcheck warnings"

Status change: Approved

Answer is "ok" (via Matrix chat)
2 comments (0 inline, 2 general)