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 Monday, 30 January 2017, Mateusz Poszwa <old4%o2.pl@localhost> wrote:
On Fri, Jan 27, 2017 at 11:48:16PM +0000, Ottavio Caruso wrote:
> On Thursday, 26 January 2017, Ottavio Caruso <ottavio2006-netbsd%yahoo.com@localhost>
> wrote:
>
> > Hi all,
> >
> > I've been away from pkgsrc and all things Netbsd for a while.
> >
> > I've always toyed with the idea of bootstrapping pkgsrc on my Nexus 7
> > (Android 6.1) and I decided to give it a go.
> >
> > Ive installed the excellent Termux app:
> > https://termux.com/
> >
> > Installed a bunch of packages from the built in package manager apt,
> > finally downloaded pkgsrc via CVS and then proceeded to bootstrap.
> >
> > This is where problems start.
> >
> > Most, if not all, pkgsrc scripta are simple shell scripts that start with
> > the canonical shebang:
> > #! /bin/sh
> >
> > The Android filesystem is a non standard Linux-like filesystem where most
> > executables reside in /system/bin.
> >
> > Termux adds a bunch of its own executables in
> > /data/data/com.termux/files/usr/bin.
> >
> > The /bin directory does not exist and cannot be created unless one roots
> > the device, which I'm not willing to do yet. As a consequence one cannot
> > create a link to /bin/sh.
> >
> >
> >
> OK, a little update.
>
> I'm getting a partial positive result to the above mentioned problem.
>
> What I have done is:
>
> export CONFIG_SHELL=/data/data/com.termux/files/usr/bin/bash
> export SH=/data/data/com.termux/files/usr/bin/bash
> bash bootstrap --unprivileged
>
> I'm not sure which one of the lines have done the job, probably $
> CONFIG_SHELL.

In my case, both were required, although I’ve set them to /system/bin/sh.

> So, now configure starts and it fails at:
>
> configure: creating cache config.cache
> checking build system type... mkdir: cannot create directory
> '/tmp/cg8478-32379': No such file or directory
> mkdir: cannot create directory '/tmp/cg-8478': No such file or directory
> config.guess: cannot create a temporary directory in /tmp
> configure: error: cannot guess build type; you must specify one
> ===> exited with status 1
> aborted.
>
> So, probably I'd have to create a variable pointing to a temp directory
> within my permissions.
>
> Any help is appreciated.

For me, the following has helped:
export TMPDIR="$(dirname "$(mktemp -u)")"


I did sort that issue eventually.

The problem remains with the hard coded "/bin/sh"

I was thinking of installing Lineage OS on the Nexus. That would give me root access. But I'm not really motivated to spend any more time on this project.

You're welcome to catch up from here and post results. 


--
Ottavio Caruso


Home | Main Index | Thread Index | Old Index