shitbox/README.md

118 lines
2.7 KiB
Markdown
Raw Permalink Normal View History

Contents
========
* [Introduction](#introduction)
* [Provided Commands](#provided_commands)
* [Scope](#scope)
* [Installation](#installation)
## Introduction
*Shitbox* is inspired by the project [busybox](https://busybox.net/) but with a
much more limited scope. While Busybox aims to be "*The swiss army knife of
embedded linux*" you can think of shitbox as being more like "*The box store
multi tool of embedded linux*".
All joking aside the utilities which are present function mostly as expected and
the code aims to be robust. It's written in Rust, not C, for whatever that's
worth. Like Busybox it is a multi-call binary which is therefore able to share
code between applets, making for an overall smaller binary.
## Provided Commands
2023-02-07 10:34:09 -05:00
- b2sum
- base32
- base64
- basename
2023-01-21 19:34:02 -05:00
- chgrp
2023-01-20 12:08:04 -05:00
- chmod
- chown
2023-01-21 20:55:59 -05:00
- chroot
- clear
- cut
- df
- dirname
- echo
- false
- factor
- fold
- groups
- head
2023-01-23 10:17:17 -05:00
- hostid
- hostname
- link
2023-02-07 10:34:09 -05:00
- ln
2023-01-21 20:55:59 -05:00
- logname
2023-02-03 19:12:40 -05:00
- md5sum
2023-01-20 23:53:28 -05:00
- mkfifo
2023-01-21 19:34:02 -05:00
- mknod
- mktemp
- mountpoint
- nologin
- nproc
2023-01-21 19:34:02 -05:00
- printenv
- pwd
2023-01-22 00:26:26 -05:00
- readlink
2023-01-22 10:24:21 -05:00
- realpath
- rev
2023-01-17 17:46:05 -05:00
- rm
2023-01-16 23:44:21 -05:00
- rmdir
- sha1sum
- sha224sum
- sha256sum
- sha384sum
- sha512sum
- sleep
2023-02-07 10:34:09 -05:00
- swaplabel
2023-02-08 16:20:25 -05:00
- swapoff
- sync
2023-02-24 19:07:53 -05:00
- touch
- true
2023-04-17 23:01:43 -04:00
- truncate
2023-02-07 10:34:09 -05:00
- umount
- unlink
2023-01-23 00:43:54 -05:00
- wc
- which
2023-03-14 22:17:46 -04:00
- who
- whoami
- yes
## Scope
*Shitbox* does not aim to supply an entire system of utilities, but rather a
2023-01-08 11:40:08 -05:00
subset of the most common Unix shell utilities. Things which are out of scope
for the project include:
- Shells
- Network servers
- Kernel module handling utilities
- Anything requiring suid or sgid bits such as `su` or `sudo`
2023-02-07 10:34:09 -05:00
The code is not intended to be portable across different architectures, only
Linux is supported.
2023-02-08 16:20:25 -05:00
Full compatability with GNU coreutils is not intended. Compliance with POSIX is
the main goal, with extensions provided by GNU or BSD where they make sense, and
certain tweaks to improve consistency of behavior where they do not interfere
with POSIX compliance.
## Installation
Building is done using the official Rust toolchain. It is recommended that you
install your toolchain using Rustup rather than distro packages, as old compiler
versions are not supported.
```Sh
cargo build --release
```
2023-02-07 10:34:09 -05:00
This produces three binaries: corebox, hashbox and utilbox. Most of the commands
ordinarily provided by GNU coreutils are applets of `corebox`, with the exception
of cryptographic hash related commands which are split out into `hashbox`. Linux
swpecific commands ordinarily provided by the util-linux package are in `utilbox`.
The `bootstrap` applet provides facility for installing the binary, creating all
required symlinks and installing some nice to haves such as **Unix man pages**
and **shell completions** [see below].
```Sh
2023-02-07 10:34:09 -05:00
target/release/corebox help bootstrap
```
### Supported shells for completions
- Bash
- Fish
- NuShell
- PowerShell
- Zsh