From: Michael Olbrich Date: Tue, 24 May 2011 07:56:53 +0200 Subject: [PATCH] ipkg: make ar deterministic Based on a patch from Darren Hutchinson From the original description: I had a strange problem when I tried to create an image. The last part of the error message was: File "/projects// \ platform-/sysroot-host/lib/python2.6/site-packages/arfile.py", line 79, in _scan size = int(descriptor[5]) ValueError: invalid literal for int() with base 10: '`' The problem eventually turned out to be that arfile.py has trouble parsing AR files created with a UID >99999 - it relies on the (ascii) AR header fields using one digit less than their allocated sizes so it can the padding space to split() them. The original patch added the option 'D' to ar to set the UID and GID to zero. This option is not available in older versions of ar. chown to 0:0 instead. This is possible because the everything is run in fakeroot. Not for upstream! Signed-off-by: Michael Olbrich --- ipkg-build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ipkg-build b/ipkg-build index 77367ac..7234e64 100755 --- a/ipkg-build +++ b/ipkg-build @@ -235,7 +235,10 @@ echo "2.0" > $tmp_dir/debian-binary pkg_file=$dest_dir/${pkg}_${version}_${arch}.ipk rm -f $pkg_file if [ "$outer" = "ar" ] ; then - ( cd $tmp_dir && ar -crf $pkg_file ./debian-binary ./data.tar.gz ./control.tar.gz ) + # chown the content to "0:0". files. This is needed as high UID values (> + # 99999) cause problems when parsing ar file headers + ( cd $tmp_dir && chown 0:0 ./debian-binary ./data.tar.gz ./control.tar.gz && + ar -crf $pkg_file ./debian-binary ./data.tar.gz ./control.tar.gz ) else ( cd $tmp_dir && tar -zcf $pkg_file ./debian-binary ./data.tar.gz ./control.tar.gz ) fi