Diff
Not logged in

Differences From Artifact [81b3439551]:

To Artifact [ea0eef9cd3]:


69
70
71
72
73
74
75

76
77

78
79
80
81
82

83
84
85
86
87
88
89
90
91
92
93
94
95
96




97


98
99
100
101
102
103
104
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103

104
105
106
107
108
109
110
111
112







+


+





+














+
+
+
+
-
+
+







	[ -f "$x" ] || error 1 "No file '$x'."
done
for x in files/*.bin; do
	[ "$x" = 'files/*.bin' ] && error 1 "No 'files/*.bin' here."
done

ls_usb_interfaces() {
	local -i n=0
	for i in `find -H /sys/bus/usb/devices/usb* -name interface`; do
		u=$(dirname $i)
		let n+=1
		(cd $u && echo -n "$u" &&
		 echo -n "|$(<../manufacturer)|$(<../product)|$(<interface)" &&
		 echo -n "|$(<../idVendor):$(<../idProduct)" &&
		 echo '')
	done
	(( n == 0 )) && echo "!!!   No USB *interfaces* found   !!!"
}

get_port() {
	local prompt="$*"
	local port=''
	{ lsusb; ls -l /dev/ttyUSB*; } >/dev/tty
	while [ -z "$port" ]; do
		read -r -p "${prompt}: " port </dev/tty
		[ -e "$port" ] && break
		[ -e "/dev/$port" ] && { port="/dev/$port"; break; }
		[ -e "/dev/tty$port" ] && { port="/dev/tty$port"; break; }
		echo "No port '$port'!"
		port=''
	done >/dev/tty
	local w=q r=q
	[ -r "$port" ] && r=readable || r=non-readable
	[ -w "$port" ] && w=writable || w=non-writable
	ls -l "$port" > /dev/tty
	echo "$prompt is '$port'." > /dev/tty
	echo "$prompt is '$port', $w, $r." > /dev/tty
	read -r -p 'Press <RETURN> to continue...' w < /dev/tty
	echo "$port"
}

get_partition() {
	local partn=''
	select partn in $(awk 'NF == 4 {print $2}' partitions.txt); do
		if grep -q " $partn " partitions.txt; then