[pkg-fso-maint] install.sh: partition Re: [Fwd: patches against install.sh]

Luca Capello luca at pca.it
Wed Feb 4 00:19:01 UTC 2009


Hi there!

I cc:ed Karl, AFAIK he is not subscribed to the list.

On Tue, 13 Jan 2009 16:24:42 +0100, Joachim Breitner wrote:
> I didn’t have a closer look yet, but I guess you should see this too.

I am sorry for the delay, I read both Karl's direct mail as well as this
one on the list, but since at my first look everything seemed OK and
Joachim took care of it, I just forgot it :-)

> From: "Karl Goetz" <karl at kgoetz.id.au>
[...]
> install.sh-partitioningbug-unmountbug.diff
> - Replace broken while() in partitioning section with an if+while

IMHO the new solution if+while is wrong [1]:

--8<---------------cut here---------------start------------->8---
echo " * Waiting for partitions to appear"
SLEEP_SECONDS=3
if [ "$SINGLE_PART" = "true" ]; then
	DEVTEST="test -e ${SD_DEVICE}p1"
else
	DEVTEST="test -e ${SD_DEVICE}p1 -a -e ${SD_DEVICE}p2"
fi
while $DEVTEST ; do
	if [ "$SLEEP_SECONDS" = 15 ]; then
		echo "E: Partitioning has failed, partitions have not been created"
		exit 1
	fi
	sleep 3
	SLEEP_SECONDS=`expr $SLEEP_SECONDS + 3`
done
--8<---------------cut here---------------end--------------->8---

We test for the presence of the device(s), while we should do the
opposite:

--8<---------------cut here---------------start------------->8---
diff --git a/install.sh b/install.sh
index 8e48c12..4d778ca 100755
--- a/install.sh
+++ b/install.sh
@@ -410,7 +410,7 @@ if [ "$SINGLE_PART" = "true" ]; then
 else
 	DEVTEST="test -e ${SD_DEVICE}p1 -a -e ${SD_DEVICE}p2"
 fi
-while $DEVTEST ; do
+while ! $DEVTEST ; do
 	if [ "$SLEEP_SECONDS" = 15 ]; then
 		echo "E: Partitioning has failed, partitions have not been created"
 		exit 1
--8<---------------cut here---------------end--------------->8---

Can anyone confirm my feelings, please?  Since I do not have a faulty
microSD I cannot test for the while loop :-(

Thx, bye,
Gismo / Luca

Footnotes: 
[1] http://git.debian.org/?p=pkg-fso/files.git;a=commitdiff;h=d55f309cd6a94e77b00d86621091b2ef842e333e
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 314 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-fso-maint/attachments/20090204/e05ab75e/attachment.pgp 


More information about the pkg-fso-maint mailing list