oasislinux / oasis

a small statically-linked linux system
Other
2.75k stars 84 forks source link

Any Way to Install with Toybox Instead of Sbase and Ubase #108

Closed VehementHam closed 2 months ago

VehementHam commented 2 months ago

If so, how, and this is a package request.

apprehensions commented 2 months ago

No, Toybox requires a heavily complicated build script (which not only compiles programs, it literally builds the programs code) which uses Bash, and is very difficult to port to POSIX sh.

VehementHam commented 2 months ago

What about Busybox?

michaelforney commented 2 months ago

That all could be worked around with gen.lua and writing our own scripts.

The bigger problem is that toybox is written in GNU C, not ISO C, and makes heavy use of GNU C extensions. This means it'd be very difficult to build with cproc and you'd likely have to maintain your own fork since the these changes would almost certainly be rejected upstream.

Here's some of the errors when building with cproc:

lib/args.c:181:57: error: expected ';' after 'return' statement, saw identifier 'forget_arg'
lib/dirtree.c:97:22: error: pointer operand to '+' must be to complete object type
lib/lib.c:23:63: error: expected primary expression
lib/portability.c:45:14: error: pointer operand to '+' must be to complete object type
lib/tty.c:70:13: error: invalid escape sequence
lib/utf8.c:59:12: error: invalid escape sequence
generated/newtoys.h:175:17: error: string literal contains invalid UTF-8
toys/lsb/dmesg.c:44:38: error: invalid escape sequence
toys/lsb/gzip.c:126:48: error: expected ';' after 'return' statement, saw identifier 'error_msg'
toys/lsb/md5sum.c:99:42: error: expected ';' after 'return' statement, saw identifier 'error_msg'
toys/lsb/seq.c:49:35: error: expected primary expression
toys/lsb/mount.c:171:49: error: expected ';' after 'return' statement, saw identifier 'error_msg'
toys/lsb/su.c:78:25: error: expected primary expression
toys/net/host.c:48:27: error: base types of pointer assignment must be compatible or void
toys/net/httpd.c:109:42: error: base types of pointer assignment must be compatible or void
toys/net/microcom.c:55:19: error: invalid escape sequence
toys/net/wget.c:249:79: error: expected primary expression
toys/other/ascii.c:49:56: error: pointer operand to '+' must be to complete object type
toys/other/blkid.c:72:22: error: expected ';' after 'return' statement, saw identifier 'xputsn'
toys/other/bzcat.c:701:14: error: expected ';' after 'return' statement, saw identifier 'error_msg'
toys/other/count.c:28:50: error: expected primary expression
toys/other/clear.c:17:12: error: invalid escape sequence
toys/other/devmem.c:63:13: error: pointer operand to '+' must be to complete object type
toys/other/eject.c:59:34: error: expected primary expression
toys/other/fmt.c:47:22: error: expected ';' after 'return' statement, saw identifier 'newline'
toys/other/getopt.c:81:31: error: expected primary expression
toys/other/help.c:63:20: error: expected ';' after 'return' statement, saw identifier 'do_help'
toys/other/hexedit.c:45:12: error: invalid escape sequence
toys/other/login.c:100:65: error: expected primary expression
toys/other/lsusb.c:219:102: error: expected primary expression
toys/other/mcookie.c:30:44: error: expected ';' after 'return' statement, saw '('
toys/other/mkpasswd.c:40:46: error: expected primary expression
toys/other/oneit.c:91:30: error: expected primary expression
toys/other/readelf.c:333:12: error: expected ';' after 'return' statement, saw identifier 'error_msg'
toys/other/reset.c:28:16: error: invalid escape sequence
toys/other/taskset.c:137:27: error: expected primary expression
toys/other/ts.c:51:57: error: expected primary expression
toys/other/xxd.c:45:45: error: expected primary expression
toys/other/yes.c:25:28: error: expected primary expression
toys/posix/cmp.c:53:61: error: expected primary expression
toys/posix/cp.c:367:22: error: expected primary expression
toys/posix/dd.c:67:56: error: expected primary expression
toys/posix/df.c:43:45: error: expected primary expression
toys/posix/env.c:55:31: error: expected primary expression
toys/posix/file.c:237:41: error: expected primary expression
toys/posix/grep.c:145:41: error: expected ';' after 'return' statement, saw identifier 'perror_msg_raw'
toys/posix/ls.c:93:44: error: invalid escape sequence
cproc-qbe: long double is not yet supported
toys/posix/patch.c:169:40: error: expected primary expression
cproc-qbe: long double is not yet supported
toys/posix/ps.c:984:36: error: expected primary expression
toys/posix/sed.c:671:21: error: expected ';' after 'return' statement, saw identifier 'error_msg'
toys/posix/sort.c:256:26: error: expected primary expression
toys/posix/split.c:47:74: error: expected ';' after 'return' statement, saw identifier 'error_msg'
toys/posix/tar.c:426:43: error: expected primary expression
toys/posix/tty.c:27:34: error: expected primary expression
toys/posix/wc.c:54:36: error: expected primary expression

These include:

busybox is pretty much the same.

If you want to use these, your best bet is to build and install them manually, then deselect sbase and ubase from your oasis config.