[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

starnge behaviour of apt-cross in bash script



Good day.

There is a chroot (debootstrap lenny crush-lenny/). I installed there
emdebian-tools emdebian-rootfs as well.

I wrote a simple bash script which parses a dsc file, gets necessary
depends from it, installs it using apt-cross and tries to build crush
arm package.

For tests I use acl source files from crush repository.
There is a build dir in chroot env containing these sources.

-----
cat script.sh

#!/bin/bash
TARG="/tmp/arm-crush-lenny"
DEPENDS="autoconf debhelper gettext libtool libattr1-dev"

echo "====START===="
cd $TARG
LANG=C chroot $TARG apt-cross -i $DEPENDS
LANG=C chroot $TARG apt-cross -l
LANG=C chroot $TARG /bin/bash <<EOF
cd /build
dpkg-source -x acl_2.2.47-2em1.dsc 
cd acl-2.2.47
emdebuild
EOF
echo "======END====="

-----

I opened two terminals. I run 'tail -f log.txt' in the first window and
I run script.sh in the second one.

1. I run 'script.sh 2>&1>>./log.txt'

In the log window:

====START====
Get:1 http://www.emdebian.org stable Release.gpg [197B]
Get:2 http://www.emdebian.org stable Release [4816B]
Get:3 http://ftp.de.debian.org stable Release.gpg [1032B]
Get:4 http://ftp.de.debian.org stable Release [73.6kB]
Get:5 http://ftp.de.debian.org stable/main Packages [5097kB]
Fetched 5177kB in 4s (1184kB/s)
The following packages will be UPGRADED:
 libc6-dev libgcc1 libstdc++6
The following NEW packages will be built and installed:
 autoconf autotools-dev binutils bsdmainutils bsdutils bzip2 cpio cpp
cpp-4.3 debhelper debianutils dpkg dpkg-dev file gcc gcc-4.3
gcc-4.3-base gettext gettext-base groff-base html2text libattr1
libattr1-dev libbz2-1.0 libdb4.6 libgdbm3 libgmp3c2 libgomp1 libmagic1
libmpfr1ldbl libncurses5 libtool linux-libc-dev lzma m4 make man-db
patch perl perl-base zlib1g
3 to be upgraded, 41 to be newly installed.
dpkg-cross: package debianutils doesn't provide any useful files, but
processing it anyway as requested
Building debianutils-arm-cross_2.30_all.deb
Building libattr1-arm-crosNo such file or directory:
acl.old/debian/Makefile at /usr/share/perl5/Emdebian/Tools.pm line 378
dpkg-architecture: warning: Specified GNU system type arm-linux-gnu does
not match gcc system type i486-linux-gnu.
dpkg-genchanges: including full source code in uploads_2.4.43-2_all.deb
Building libstdc++6-arm-cross_4.3.2-1.1_all.deb
Building libgdbm3-arm-cross_1.8.3-3_all.deb
Building libgcc1-arm-cross_4.3.2-1.1_all.deb
...
(we see that apt-cross installs necessary packages normally)
...
...
Files: 
 825a6c733494db36b37697e2e9fe261c 862 utils optional acl_2.2.47-2em1.dsc
 a11e4571a54a0b1ae83010d1e68a64c2 154823 utils optional
acl_2.2.47.orig.tar.gz
 11536c7ec2fc0b353894b1120b441568 116466 utils optional
acl_2.2.47-2em1.diff.gz
 2a0508c8f304e978a06ee7698344dc6c 20942 utils optional
acl_2.2.47-2em1_arm.deb
 2f7091615c486d2f767c745c9ac963ca 19728 libdevel extra
libacl1-dev_2.2.47-2em1_arm.deb
 340abddd2451e0397b8d99718a2e3539 13414 libs required
libacl1_2.2.47-2em1_arm.deb

Successful build.
Build directory: /build/acl-2.2.47/

======END=====

In the terminal window:
The strange thing is that I see some lines even I sent all messages to
log file.

# ./script.sh 2>&1>>./log.txt
Could not open file /root/.apt-cross/status - open (2 No such file or
directory)
The package lists or status file could not be parsed or opened.
You must put some 'source' URIs in your sources.list
Unable to get Terminal Size. The TIOCGWINSZ ioctl didn't work. The
COLUMNS and LINES environment variables didn't work. The resize program
didn't work. at /usr/lib/perl5/Term/ReadKey.pm line 362.
guessing terminal width 50
40 to download: 100% [=================]D 0h00m00sUnable to get Terminal
Size. The TIOCGWINSZ ioctl didn't work. The COLUMNS and LINES
environment variables didn't work. The resize program didn't work.
at /usr/lib/perl5/Term/ReadKey.pm line 362.
guessing terminal width 50
39 to download: 100% [=================]D 0h00m00sUnable to get Terminal
Size. The TIOCGWINSZ ioctl didn't work. The COLUMNS and LINES
environment variables didn't work. The resize program didn't work.
at /usr/lib/perl5/Term/ReadKey.pm line 362.
guessing terminal width 50
...
(we see the downloading status of cross compile libraries)
...
Cannot create empty xcontrol file : No such file or directory
 at /usr/bin/emdebuild line 265
Cannot create empty xcontrol : No such file or directory
 at /usr/bin/emdebuild line 265
No such file or directory: acl.old/debian/xcontrol
at /usr/share/perl5/Emdebian/Tools.pm line 378
Cannot create empty xcontrol file : No such file or directory
 at /usr/bin/emdebuild line 265
...
No such file or directory: acl.old/debian/Makefile
at /usr/share/perl5/Emdebian/Tools.pm line 378
dpkg-architecture: warning: Specified GNU system type arm-linux-gnu does
not match gcc system type i486-linux-gnu.
dpkg-genchanges: including full source code in upload

In this way packages were built successfully.




2. The second way. I run './script.sh 2>&1>>./log.txt & exit 0' (run the
process in the background. In this way I can close the remote console,
but the process keeps on working)

In the log window:

====START====
The following packages will be UPGRADED:
 libc6-dev libgcc1 libstdc++6
The following NEW packages will be built and installed:
 autoconf autotools-dev binutils bsdmainutils bsdutils bzip2 cpio cpp
cpp-4.3 debhelper debianutils dpkg dpkg-dev file gcc gcc-4.3
gcc-4.3-base gettext gettext-base groff-base html2text libattr1
libattr1-dev libbz2-1.0 libdb4.6 libgdbm3 libgmp3c2 libgomp1 libmagic1
libmpfr1ldbl libncurses5 libtool linux-libc-dev lzma m4 make man-db
patch perl perl-base zlib1g
3 to be upgraded, 41 to be newly installed.
(apt-cross -l         the 8th line in the script.sh)
amd64-libs-dev-arm-cross
dvb-dev-arm-cross
gcc-2.95-arm-cross
gettext-arm-cross
glibc-2.7-1-arm-cross
libc-dev-arm-cross
libc6-arm-cross
libc6-dev-arm-cross
libc6.1-dev-arm-cross
libgcc1-arm-cross
libgdbmg1-dev-arm-cross
libstdc++-dev-arm-cross
libstdc++2.10-dev-arm-cross
libstdc++6-4.3-dev-arm-cross
libstdc++6-arm-cross
libterm-readline-gnu-perl-arm-cross
linux-kernel-headers-arm-cross
tzdata-etch-arm-cross
...
(as we can see apt-cross did not install 'autoconf debhelper gettext
libtool libattr1-dev' packages)
...
dpkg-source: extracting acl in acl-2.2.47
dpkg-source: info: unpacking acl_2.2.47.orig.tar.gz
dpkg-source: info: applying acl_2.2.47-2em1.diff.gz
Building 'acl' for arm on i386.
DEB_BUILD_ARCH=i386
DEB_BUILD_ARCH_OS=linux
DEB_BUILD_ARCH_CPU=i386
DEB_BUILD_GNU_CPU=i486
DEB_BUILD_GNU_SYSTEM=linux-gnu
DEB_BUILD_GNU_TYPE=i486-linux-gnu
...
...
FATAL ERROR: attr/xattr.h does not exist.
Install the extended attributes (attr) development package.
Alternatively, run "make install-dev" from the attr source.
make: *** [.census] Error 1
dpkg-buildpackage: failure: debian/rules build gave error exit status 2
Recording that the package failed to build.
======END=====

As a result the package can not be built (all depends packages were not
installed).

Why this happens? why apt-cross does not install packages if the script
is not run from terminal window?




Reply to: