diff options
author | Darren Hutchinson <dhutchinson@google.com> | 2010-11-04 19:47:50 +0100 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2017-11-28 16:56:41 +0100 |
commit | d30207ecbc012885e40b0e3147a04c6bdae15470 (patch) | |
tree | 5bfd09b2a04cd8cee07afc975ee6db4758fa136c | |
parent | 473cdc70a8713fff5f6e18d0f9191b01fa0efaa6 (diff) | |
download | ptxdist-d30207ecbc012885e40b0e3147a04c6bdae15470.tar.gz ptxdist-d30207ecbc012885e40b0e3147a04c6bdae15470.tar.xz |
ipkg-utils: fix UID-related problem with ar
I had a strange problem when I tried to create an image.
The last part of the error message was:
File
"<path to ptxdist>/projects/<project name>/ \
platform-<project name>/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.
There is no real need to use the actual UID in the ar header, and GNU AR has a
'D' option that uses UID and GID values of zero when creating the ipkg archive.
I have put together a quick patch that tells ptxdist to patch ipkg-build to use
the 'D' option when invoking AR.
Signed-off-by: Darren Hutchinson <dhutchinson@google.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
(cherry picked from commit 6b186e8bfc2e6c394db0de03047c8a81f0690d08)
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-rw-r--r-- | patches/ipkg-utils-050831/0010-ipkg-make-ar-deterministic.patch | 49 | ||||
-rw-r--r-- | patches/ipkg-utils-050831/series | 1 |
2 files changed, 50 insertions, 0 deletions
diff --git a/patches/ipkg-utils-050831/0010-ipkg-make-ar-deterministic.patch b/patches/ipkg-utils-050831/0010-ipkg-make-ar-deterministic.patch new file mode 100644 index 000000000..58990a96d --- /dev/null +++ b/patches/ipkg-utils-050831/0010-ipkg-make-ar-deterministic.patch @@ -0,0 +1,49 @@ +From: Darren Hutchinson <dhutchinson@google.com> +Date: Mon, 8 Nov 2010 13:21:56 +0100 +Subject: [PATCH] ipkg: make ar deterministic + +I had a strange problem when I tried to create an image. +The last part of the error message was: + +File +"<path to ptxdist>/projects/<project name>/ \ +platform-<project name>/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. + +There is no real need to use the actual UID in the ar header, and GNU AR has a +'D' option that uses UID and GID values of zero when creating the ipkg archive. +I have put together a quick patch that tells ptxdist to patch ipkg-build to use +the 'D' option when invoking AR. + +Signed-off-by: Darren Hutchinson <dhutchinson@google.com> +Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> +--- + ipkg-build | 5 ++++- + 1 files changed, 4 insertions(+), 1 deletions(-) + +diff --git a/ipkg-build b/ipkg-build +index 77367ac..27e4868 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 ) ++ # Add 'D' flag to ar. This forces UID 0 to be used when creating ipkg ++ # files. This is needed as high UID values (> 99999) cause problems when ++ # parsing ar file headers ++ ( cd $tmp_dir && ar -crDf $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 +-- +1.7.2.3 + diff --git a/patches/ipkg-utils-050831/series b/patches/ipkg-utils-050831/series index 14f2b6202..8840abe4e 100644 --- a/patches/ipkg-utils-050831/series +++ b/patches/ipkg-utils-050831/series @@ -7,3 +7,4 @@ 0007-ipkg-env.patch 0008-ipkg.py-don-t-use-wildcards.patch 0009-Makefile-add-prefix-to-python-install.patch +0010-ipkg-make-ar-deterministic.patch |