[Toybox] [PATCH] Pass cflags and hostcc in mkroot.

Rob Landley rob at landley.net
Sun Oct 27 23:37:57 PDT 2019


On 10/27/19 10:08 AM, Denys Nykula wrote:
> On Sat, Oct 26, 2019 at 07:06:54PM -0500, Rob Landley wrote:
>> On 10/16/19 6:19 PM, Denys Nykula wrote:
>>> Yes, NetBSD package repository appears to be easier to bootstrap on Linux than
>>> those of GNU/distros. Package recipes are an independent layer from toolchain and
>>> core utils flavor, no init system enforced etc.
>>
>> Is there a walkthrough on doing this or a URL I could follow it at? More build
>> environments to test against is good...
> 
> Script master is acme.js.org/world, comment at the beginning is example
> how to run.

This is usually the kind of thing people have a repo for somewhere. :)

(It's long and complicated enough it might be nice if it were versioned...)

This is... dense.

This is probably the most immediately interesting line of it to me:

for i in BC DIFF EXPR GROUPADD GZIP ROUTE SH TR USERADD VI WGET

hmmmm....

  sed -i "s/<(.*)/:/" s*/*

The script you're running this on can't handle bash syntax? Except why are you
doing that _after_ running defconfig?

Why do you do:

  mv root/*/*/usr/src/distfiles/* ../pkgsrc/distfiles

_before_ running "make root"? And what context does:

  cd ../../../../*x-*

run in? (It looks like you're in the toybox source dir? From the start of the
script you cloned some repos off of github and cd'd into toybox, and now you're
cd-ing three levels above that?)

I haz a confused.

> In empty dir, drop a musl.cc native toolchain tgz for your
> arch, and run the script. After hours, in $PWD/toybox/root/*/*-fs there's
> complete root. Chroot there /bin/su -, for a login shell. To list which of
> my top netbook packages you built successfully, pkg_info -u. See complete
> pkgsrc doc with lynx /usr/src/doc/pkgsrc.html, and just ls /usr/src and
> generally ls around to learn what's available or not. Export
> MANPATH=/usr/pkg/man if my profile fails to set it.

I'm still working my way through to the end of "make root in toybox". Have to
look at what you did _in_ that root in the morning...

> Presence of /usr/src/*/*/work/ means its parent dir package failed. One
> such package, xinit, I expect to err. Others mean I need to debug and
> don't know that yet.
> 
> Please run only in virtual machine, as root from some livecd.

My build systems have all run as a normal user (NOT requiring root on the host)
since about 2004. (Point of pride. :)

> I stay in
> $PWD but I assume git clone, gmake root, cd, tar x, rm -r, chroot and
> mount succeed, and then I do ln and mv with relative paths. Tested on
> arch, gentoo and itself; with glibc and musl; bash and mksh; coreutils,
> busybox and toybox; armv7l and x86_64.
> 
> Both make and gmake in your path have to point at gmake, mkroot-specific.

This is what "alias" is for. :)

> Packages mostly accept a MAKE argument with a path to make or explicit
> the g prefix. Base system doesn't ln unprefixed make in path here. There
> exists after all a variable I'd like mkroot to use (:
> 
> This should be enough to see how to automate a pkgsrc build for use as a
> regressive integration test for toybox.

It looks like the pieces are here, I just have to do some squinting. Thanks.

Rob



More information about the Toybox mailing list