C Building bsdbox

I'm attempting to build bsdbox (/usr/src/tools/bsdbox) and get the following error after run make in that directory:-
Code:
cc  -O2 -pipe -fno-common   -I/usr/src/lib/libifconfig -I/usr/obj/usr/src/amd64.amd64/tools/bsdbox/usr/src/lib/libifconfig -DINET6 -DINET -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wnested-externs -fPIE -I/usr
In file included from /usr/src/sbin/ifconfig/sfp.c:53:
^[[1m/usr/src/lib/libifconfig/libifconfig_sfp.h:35:10: ^[[0m^[[0;1;31mfatal error: ^[[0m^[[1m'libifconfig_sfp_tables.h' file not found^[[0m
#include <libifconfig_sfp_tables.h>
^[[0;1;32m         ^~~~~~~~~~~~~~~~~~~~~~~~~~
^[[0m1 error generated.
*** Error code 1

Stop.
make[2]: stopped in /usr/src/sbin/ifconfig
*** Error code 1

Stop.
make[1]: stopped in /usr/obj/usr/src/amd64.amd64/tools/bsdbox
*** Error code 1

Stop.
make: stopped in /usr/src/tools/bsdbox

Command exit status: 1


Any suggestions about I should do to resolve this error?
 
goto /usr/src/lib/libifconfig and type make depend all
goto /usr/src/tools/bsdbox and edit Makefile and comment out .include "Makefile.hostapd"
make MK_PIE=no

this should work
 
it will build /usr/obj/usr/src/amd64.amd64/tools/bsdbox/bsdbox
this is something like you have in /rescue
you just ln(1) it do different names and have different commands
it's not statically linked so it needs a bunch of shared libs
Code:
[21:50:08] [linsux!titus]~$ln -s /usr/obj/usr/src/amd64.amd64/tools/bsdbox/bsdbox /tmp/ps
[21:50:11] [linsux!titus]~$/tmp/ps x
  PID TT  STAT    TIME COMMAND
26116  -  S    0:00.02 sshd: titus@pts/0 (sshd)
26117  0  Ss   0:00.03 -bash (bash)
26152  0  R+   0:00.00 /tmp/ps x (bsdbox)
[21:50:15] [linsux!titus]~$ldd /usr/obj/usr/src/amd64.amd64/tools/bsdbox/bsdbox
/usr/obj/usr/src/amd64.amd64/tools/bsdbox/bsdbox:
    libc.so.7 => /lib/libc.so.7 (0xda812ac1000)
    libutil.so.9 => /lib/libutil.so.9 (0xda811718000)
    libcrypt.so.5 => /lib/libcrypt.so.5 (0xda8120f8000)
    libxo.so.0 => /lib/libxo.so.0 (0xda81349a000)
    libgpio.so.0 => /usr/lib/libgpio.so.0 (0xda813ef6000)
    libpam.so.6 => /usr/lib/libpam.so.6 (0xda815793000)
    libbsm.so.3 => /usr/lib/libbsm.so.3 (0xda814d59000)
    lib80211.so.1 => /lib/lib80211.so.1 (0xda8162fc000)
    libsbuf.so.6 => /lib/libsbuf.so.6 (0xda817a83000)
    libbsdxml.so.4 => /lib/libbsdxml.so.4 (0xda816dc7000)
    [vdso] (0x7ffffffff5d0)
[21:50:25] [linsux!titus]~$
 
its probably intended to be used as a minimal userland
Code:
usage: bsdbox <prog> <args> ..., where <prog> is one of:
 ls cat dd df cp hostname kill mkdir sleep ps ln rm kenv mv expr sh -sh dmesg
 sysctl init reboot mount umount route ping ifconfig kldload kldunload kldstat
 mdmfs mount_mfs mdconfig newfs true false hexdump tail nc w uptime head uname
 tset reset vmstat cpio tput passwd gzip gunzip gzcat zcat netstat cap_mkdb
 gpioctl chown chgrp arp inetd wlandebug tcpdump pwd_mkdb getty bsdbox

so you can create a small rescue media with a kernel and bsdbox which will provide the above functionality
just link it to all that names above and it does that
 
Back
Top