Hello,

attached the two patches that I consider to address the issues - the push of 
mine before
pushed the wrong bits ... one should not Push when what one should do is Rush.

Luca? The data.tar.gz must be some remnant of an earlier aborted installation 
of some
sort. If you don't have other ideas, e.g. an exit 1 added to the ( )s upon 
failure, then I
would perform analogously for the other invocations of (cd /tmp ; ar) .

Many greetings

Steffen

Steffen Moeller wrote:

> I need to rush (1min) for my train. Please be so kind to check if the very 
> latest
> install.sh does fix the issues. I could not test it.
> 
> Luca Capello wrote:
>> Cc:ing the pkg-fso-maint@ mailing list for information, please continue
>> the discussion on the smartphones-userland@ one, I set R-T and M-F-T
>> accordingly, TIA.
>>
>> Another error I experienced while re-installing Debian on my FR [1] is
>> linked to busybox ar:
>> =====
>> om-gta02:~# time ./install.sh all
>> [...]
>>
>> W: tar does not support gzip archives
>> Downloading tar package
>> tar.deb              100% [...]   772k 00:00:00 ETA
>> ar: can't open 'data.tar.gz': File exists
>>  * network running
>> I: System setup looks good
>> Fetching time from ntp.fu-berlin.de with rdate
>> I: Time is now Wed Mar 18 21:24:27 CET 2009
>> [...]
>> =====
>>
>> It seems that busybox and GNU ar work differently if the files to be
>> extracted already exist: busybox ar will exit with code 1, while GNU ar
>> just rewrite them.
>>
>> Is this a busybox bug?  Unfortunately, Debian busybox does not provide
>> ar, so I cannot test with previous busybox versions.
>>
>> For the pkg-fso-maint@ people: since ar exits with code 1, the
>> install.sh script should exit as well, independently of the problem I
>> just described above.
>>
>> Thx, bye,
>> Gismo / Luca
>>
>> Footnotes: 
>> [1] 
>> http://lists.linuxtogo.org/pipermail/smartphones-userland/2009-March/001333.html
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Smartphones-userland mailing list
>> [email protected]
>> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/smartphones-userland
> 
> 
> _______________________________________________
> pkg-fso-maint mailing list
> [email protected]
> http://lists.alioth.debian.org/mailman/listinfo/pkg-fso-maint

>From 31ba24c76056f278a242b344038c5c9f4441ba2b Mon Sep 17 00:00:00 2001
From: Steffen Moeller <[email protected]>
Date: Thu, 19 Mar 2009 17:27:22 +0100
Subject: [PATCH 1/2] Hardening installation of GNU tar

 * already existing / left over data.tar.gz file is removed
 * ( )s removed so an error will not remain unnoticed
---
 install.sh |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/install.sh b/install.sh
index 3129466..896accc 100755
--- a/install.sh
+++ b/install.sh
@@ -464,7 +464,7 @@ action_testing () {
 	fi
 	echo " * microSD card device: $SD_DEVICE present"
 
-	for intern_binary in wget ping fdisk mount umount mkfs.$SD_PART1_FS mkfs.$SD_PART2_FS mkswap gunzip dd sed rdate ar; do
+	for intern_binary in wget ping fdisk mount umount mkfs.$SD_PART1_FS mkfs.$SD_PART2_FS mkswap gunzip dd sed rdate ar pwd; do
 		if ! which $intern_binary > /dev/null; then
 			echo "E: Could not find $intern_binary binary"
 			exit 1
@@ -478,11 +478,20 @@ action_testing () {
 		echo "W: tar does not support gzip archives"
 		echo "Downloading tar package"
 		wget $TAR_PACKAGE -O /tmp/tar.deb
-		( cd /tmp && ar -x tar.deb data.tar.gz )
+		cwd=`pwd`
+		cd /tmp
+		if [ -f data.tar.gz ]; then
+			if [ -n "$VERBOSE" ]; then
+				echo "I: removing previous /tmp/data.tar.gz"
+			fi
+			rm -f data.tar.gz
+		fi
+		ar -x tar.deb data.tar.gz
 		mkdir -p /usr/local
-		gunzip -c /tmp/data.tar.gz | tar -x -C /usr/local/
-		rm -f /tmp/data.tar.gz
-		rm -f /tmp/tar.deb
+		gunzip -c data.tar.gz | tar -x -C /usr/local/
+		rm -f data.tar.gz
+		rm -f tar.deb
+		cd "$cwd"
 	fi
 
 	if [ "$SD_PART1_FS" = "vfat" ]; then
-- 
1.6.2.1

>From 81db5387ef3da45ed9a74373fcf52f7c17f0b6b9 Mon Sep 17 00:00:00 2001
From: Steffen Moeller <[email protected]>
Date: Thu, 19 Mar 2009 17:31:34 +0100
Subject: [PATCH 2/2] tar -> $TAR_APPLICATION

And a new installation of GNU tar will have that variable reset
to /usr/local/bin/tar
---
 install.sh |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/install.sh b/install.sh
index 896accc..0b627a5 100755
--- a/install.sh
+++ b/install.sh
@@ -113,6 +113,7 @@ DOSFSTOOLS_PACKAGE=$INST_MIRROR/pool/main/d/dosfstools/dosfstools_3.0.1-1_armel.
 
 # FSO-MS5 busybox's tar does not support -z
 TAR_PACKAGE=$INST_MIRROR/pool/main/t/tar/tar_1.20-1_armel.deb
+TAR_APPLICATION=tar
 
 
 #
@@ -474,8 +475,8 @@ action_testing () {
 		fi
 	done
 
-	if tar --help 2>&1 | grep "Usage: tar \-\[cxtvO\]" >/dev/null; then
-		echo "W: tar does not support gzip archives"
+	if $TAR_APPLICATION --help 2>&1 | grep "Usage: $TAR_APPLICATION \-\[cxtvO\]" >/dev/null; then
+		echo "W: $TAR_APPLICATION does not support gzip archives"
 		echo "Downloading tar package"
 		wget $TAR_PACKAGE -O /tmp/tar.deb
 		cwd=`pwd`
@@ -489,6 +490,7 @@ action_testing () {
 		ar -x tar.deb data.tar.gz
 		mkdir -p /usr/local
 		gunzip -c data.tar.gz | tar -x -C /usr/local/
+		TAR_APPLICATION=/usr/local/bin/tar
 		rm -f data.tar.gz
 		rm -f tar.deb
 		cd "$cwd"
@@ -502,7 +504,7 @@ action_testing () {
 			echo "Downloading dosfstools package"
 			wget $DOSFSTOOLS_PACKAGE -O /tmp/dosfstools.deb
 			( cd /tmp && ar -x dosfstools.deb data.tar.gz )
-			tar -xz -C / -f /tmp/data.tar.gz
+			$TAR_APPLICATION -xz -C / -f /tmp/data.tar.gz
 			rm -f /tmp/data.tar.gz
 			rm -f /tmp/dosfstools.deb
 		fi
@@ -742,7 +744,7 @@ action_debian () {
 	echo " * Downloading cdebootstrap package"
 	wget $CDEBOOTSTRAP_PACKAGE -O /tmp/cdebootstrap.deb
 	( cd /tmp && ar -x cdebootstrap.deb data.tar.gz )
-	tar -xz -C / -f /tmp/data.tar.gz
+	$TAR_APPLICATION -xz -C / -f /tmp/data.tar.gz
 	rm -f /tmp/data.tar.gz
 	rm -f /tmp/cdebootstrap.deb
 
-- 
1.6.2.1

_______________________________________________
pkg-fso-maint mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/pkg-fso-maint

Reply via email to