[Toybox] FreeBSD porting, removing bashisms

Ed Maste emaste at freebsd.org
Thu Apr 21 19:30:25 PDT 2016


On 22 April 2016 at 01:22, Rob Landley <rob at landley.net> wrote:
>> 3. Add to /etc/rc.conf (assuming vtnet0 interface here):
>>
>> ifconfig_vtnet0="DHCP"
>> sshd_enable="YES"
>
> Editing this file did not cause the interface to magically configure
> itself, but "dhclient em0" worked.

Yes, of course. I've now updated the instructions; there might have
been an extra reboot in there before.

> Yay, "lock order reversal" right after "All buffers synced." in
> vfs_mount.c;1222 and vfs_subr.c:2498, stack trace: witness_debugger,
> witness_checkorder, __lockmgr_args, vop_stdlock, VOP_LOCK1_APV,
> _vn_lock, vget, devfs_allocv, devfs_root, dounmount, vfs_unmountall,
> bufshutdown, kern_reboot, sys_reboot.

Sigh, this one is a known issue, for over 7 years :(.
http://sources.zabbadoz.net/freebsd/lor/280.html
It is not reported in release builds at least.

>> 5. Run pkg install git gcc gmake
>
> You mentioned I could skip gcc, so I just did "pkg install git gmake".
> It's downloading perl, python, curl, cvsps, expat, libffi, cvsps,
> readline, gettext-runtime... This is _sad_.

Indeed. gmake has a reasonable-looking set of 5 dependencies, but git has 74.

>> 6. Run adduser to create a user account
>> 7. Run shutdown -r now to reboot
>> 8. ssh to the VM as your user account
>
> I just logged out and logged back in as my new user, git cloned toybox,
> ran gmake allnoconfig, and it died with scripts/genconfig.sh command not
> found, which i'm guessing means no bash. There's no sudo, but "su -"
> works, to switch to root and install bash...
>
> Bash requires fdescfs mounted on /dev/fd. What? Ok...? Mounting,
> adjusting fstab...

Oh, sigh. The reason for this one is rather silly, and with luck it
will be fixed in a later package version.

> There's still no /bin/bash? It's in /usr/local/bin. Sigh. Ok, as root
> "ln -s /usr/local/bin/bash /bin/bash"
>
> Hey, gmake allnoconfig finished! Woo! Trying the actual build... Died
> telling me to PLEASE submit a bug report to freebsd.org. Well that's
> nice. Lemme see if whatever shell this is understands the 2>&1 | tee
> syntax to capture the log...
>
> Ah, your sed is horked. Right, lemme see what I can do about that...

It does seem that Clang asking to submit a bug report for EPIPE isn't
really desirable.

Anyhow, for my exploration I installed gsed and s/sed/gsed/ in
scripts/make.sh. We'd like to improve compatibility with GNU sed where
feasible though and I'll try to see what is being used here that we
don't implement.


More information about the Toybox mailing list