pkgsrc-Users archive

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

Re: Can anybody come with a creative solution to the "/bin/sh: bad interpreter" problem?



* On 2017-01-27 at 06:45 GMT, Ottavio Caruso wrote:

> 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.

This will almost certainly require it to be a separate platform,
there are just too many hardcoded assumptions about paths in
mk/platform/Linux.mk and mk/tools/tools.Linux.mk.

If you're able to work on this, it would certainly be a useful
exercise for us to ensure that scripts are always called using ${SH}
rather than directly.  This should already be the case due to
historical Solaris /bin/sh being useless, but it may be that usage has
crept back in as fewer, if any, people are using Solaris 9 or older.

To start with, edit bootstrap and use the set_opsys mechanism to set a
different OPSYS variable, probably "Android" is sensible, and then
work from there adding support for Android.  It'll be a bit of work,
but also a lot of fun :)

Off the top of my head the files and packages you'll need to work on
for starters are:

	bootstrap/bootstrap (ensure OPSYS is set to "Android")
	devel/bmake (handle OPSYS==Android)
	pkgtools/bootstrap-mk-files (write *.Android.mk overrides)
	mk/bsd.prefs.mk (handle OPSYS==Android)
	mk/platform/Android.mk (based on Linux.mk)
	mk/tools/tools.Android.mk (based on tools.Linux.mk)

Looking at changes required to introduce new OPSYS support in the past
will be helpful too (e.g. Haiku) for anything I've forgotten.

Cheers,

-- 
Jonathan Perkin  -  Joyent, Inc.  -  www.joyent.com


Home | Main Index | Thread Index | Old Index