pkgsrc-Users archive

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

Re: Bootstrapping pkgsrc on Android, was: Can anybody come with a creative solution to the "/bin/sh: bad interpreter" problem?





On Thursday, 2 February 2017, Ottavio Caruso <ottavio2006-netbsd%yahoo.com@localhost> wrote:


On Thursday, 2 February 2017, <coypu%sdf.org@localhost> wrote:
easiest - chroot.

Maybe, but see below [1]
 
you can also attempt to set up a useful /bin by linking
the right stuff.
e.g. bind mount /system/bin to /bin.

I've tried 

$ mount -o bind ../usr/bin /bin
mount: No such file or directory

I believe /bin must be created first and I have no root access.

[1]
I did mention in one of my earlier posts that I had installed Proot 

https://github.com/proot-me/PRoot/blob/master/doc/proot/manual.txt

and used this script:

https://raw.githubusercontent.com/termux/termux-packages/master/packages/proot/termux-chroot

Then:

$ export SU=$BASH

$ ./bootstrap --unpriviled

This will not choke on finding a suitable shell, but it runs for about 4 hours and then exits while trying to find specific files starting with Android.*

In other words, when run as  fake root, it appears to expect Android specific files.

This seems to validate what Jonathan Perkin suggested earlier, that is, creating a new port for Android, which is beyond my skills and time available.

I can try to run the script again and post a log, if anybody is interested. 




Update:

This is what I've done so far:

Install Termux apk

apt update
apt install coreutils clang proot

termux-setup-storage. 


Point browser to http://ftp.netbsd.org/pub/pkgsrc/current/

Right click pkgsrc.tar.gz

Download

Back to Termux shell


tar -xvfz storage/downloads/pkgsrc.tar.gz -C ../usr/

cd ../usr/pkgsrc/bootstrap/

proot -b /data/data/com.termux/files/usr/bin/bash:/bin/sh

export TMPDIR=/data/data/com.termux/files/usr/tmp

./bootstrap --unprivileged


Fails at:


===> Bootstrapping pkgtools
===> running: /data/data/com.termux/files/usr/bin/sh /data/data/com.termux/files/usr/pkgsrc/bootstrap/work/bin/install-sh -d -o u0_a115 -g u0_a115 /data/data/com.termux/files/usr/pkgsrc/bootstrap/work/libarchive
===> running: (cd /data/data/com.termux/files/usr/pkgsrc/bootstrap/work/libarchive; env  /data/data/com.termux/files/usr/bin/sh ./configure  --enable-static --disable-shared --disable-bsdtar --disable-bsdcpio --disable-posix-regex-lib --disable-xattr --disable-maintainer-mode --disable-acl --without-zlib --without-bz2lib --without-lzmadec --without-iconv --without-lzma --without-lzo2 --without-lz4 --without-nettle --without-openssl --without-xml2 --without-expat MAKE=/data/data/com.termux/files/usr/pkgsrc/bootstrap/work/bin/bmake && /data/data/com.termux/files/usr/pkgsrc/bootstrap/work/bin/bmake  -j1)
checking for a BSD-compatible install... /data/data/com.termux/files/usr/bin/install -c

< Skip .. >
config.status: creating Makefile
config.status: creating build/pkgconfig/libarchive.pc
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing mkdirs commands
/data/data/com.termux/files/usr/bin/mkdir -p libarchive/test
cat ./libarchive/test/test_*.c | grep '^DEFINE_TEST' > libarchive/test/list.h
/data/data/com.termux/files/usr/bin/mkdir -p tar/test
cat ./tar/test/test_*.c | grep '^DEFINE_TEST' > tar/test/list.h
/data/data/com.termux/files/usr/bin/mkdir -p cpio/test
cat ./cpio/test/test_*.c | grep '^DEFINE_TEST' > cpio/test/list.h
cat ./cat/test/test_*.c | grep '^DEFINE_TEST' > cat/test/list.h
/data/data/com.termux/files/usr/pkgsrc/bootstrap/work/bin/bmake  all-am
  CC       libarchive/archive_acl.lo
rm: cannot remove 'libarchive/.libs/archive_acl.o': Bad file descriptor
In file included from libarchive/archive_acl.c:39:
In file included from libarchive/archive_acl_private.h:35:
In file included from libarchive/archive_string.h:49:
libarchive/archive.h:101:10: fatal error: 'android_lf.h' file not found
#include "android_lf.h"
         ^
1 error generated.
rm: cannot remove 'libarchive/.libs/archive_acl.o': Bad file descriptor
*** [libarchive/archive_acl.lo] Error code 1

bmake[1]: stopped in /data/data/com.termux/files/usr/pkgsrc/bootstrap/work/libarchive
1 error

bmake[1]: stopped in /data/data/com.termux/files/usr/pkgsrc/bootstrap/work/libarchive
*** [all] Error code 2

bmake: stopped in /data/data/com.termux/files/usr/pkgsrc/bootstrap/work/libarchive
1 error

bmake: stopped in /data/data/com.termux/files/usr/pkgsrc/bootstrap/work/libarchive
===> exited with status 2
aborted.
$ 




Full bootstrap log is here:



http://pastebin.ca/raw/3763036




--
Ottavio Caruso


Home | Main Index | Thread Index | Old Index