home: hub: mkinitfs

Download patch

ref: 198b8db9fdffc7ecb4b354ff29a963d679166624
parent: 254c00aa7d6a4cbe8b4a0cb02fc2699d72a13cda
author: 7heo <7heo@mail.com>
date: Tue Dec 27 07:13:13 CST 2016

test: better messages

--- a/test.sh
+++ b/test.sh
@@ -2,6 +2,7 @@
 
 set -e
 set -u
+set -x
 
 # Defaults
 operation=full
@@ -82,8 +83,8 @@
 	echo "> Closing the device '/dev/mapper/temp-test'"
 	sudo cryptsetup luksClose temp-test
 
-	echo "> Testing nfplug-findfs (passphrase was '$passphrase')"
-	sudo ./nlplug-findfs ${flags}-c $block -m 'test-device' || true
+	echo "> Testing nlplug-findfs on $block (passphrase was '$passphrase')"
+	echo "$passphrase" | sudo ./nlplug-findfs ${flags}-c $block -m 'test-device'
 
 	echo "> Mounting the device"
 	sudo mount /dev/mapper/test-device local-mount
@@ -97,7 +98,7 @@
 echo "> Cleaning up"
 mountpoint local-mount && sudo umount local-mount
 [ -b /dev/mapper/test-device ] && sudo cryptsetup luksClose test-device
-for i in $(seq 0 $(sudo losetup -f | sed 's:^[a-z/]*\([0-9]*\)$:\1:; s/$/-1/' | bc)); do
+for i in $(seq 0 $(($(sudo losetup -f | sed 's:^[a-z/]*\([0-9]*\)$:\1:; s/$/-1/')))); do
 	sudo losetup -d /dev/loop$i
 done
 [ -d local-mount ] && rmdir local-mount