2022-12-25 22:27:17 -05:00
|
|
|
Contents
|
|
|
|
========
|
|
|
|
* [Introduction](#introduction)
|
2023-01-16 19:03:25 -05:00
|
|
|
* [Provided Commands](#provided_commands)
|
2022-12-25 22:27:17 -05:00
|
|
|
* [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
|
2023-01-10 18:32:27 -05:00
|
|
|
embedded linux*" you can think of shitbox as being more like "*The box store
|
2022-12-25 22:27:17 -05:00
|
|
|
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.
|
|
|
|
|
2023-01-16 19:03:25 -05:00
|
|
|
## Provided Commands
|
|
|
|
- base32
|
|
|
|
- base64
|
|
|
|
- basename
|
|
|
|
- bootstrap
|
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
|
2023-01-16 19:03:25 -05:00
|
|
|
- clear
|
|
|
|
- cut
|
|
|
|
- dirname
|
|
|
|
- echo
|
|
|
|
- false
|
|
|
|
- factor
|
|
|
|
- fold
|
|
|
|
- groups
|
|
|
|
- head
|
|
|
|
- hostname
|
|
|
|
- link
|
2023-01-21 20:55:59 -05:00
|
|
|
- logname
|
2023-01-20 23:53:28 -05:00
|
|
|
- mkfifo
|
2023-01-21 19:34:02 -05:00
|
|
|
- mknod
|
2023-01-16 19:03:25 -05:00
|
|
|
- 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
|
2023-01-16 19:03:25 -05:00
|
|
|
- rev
|
2023-01-17 17:46:05 -05:00
|
|
|
- rm
|
2023-01-16 23:44:21 -05:00
|
|
|
- rmdir
|
2023-01-16 19:03:25 -05:00
|
|
|
- sleep
|
|
|
|
- shitbox
|
|
|
|
- sync
|
|
|
|
- true
|
|
|
|
- unlink
|
2023-01-23 00:43:54 -05:00
|
|
|
- wc
|
2023-01-16 19:03:25 -05:00
|
|
|
- which
|
|
|
|
- whoami
|
|
|
|
- yes
|
|
|
|
|
2022-12-25 22:27:17 -05:00
|
|
|
## 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
|
2022-12-25 22:27:17 -05:00
|
|
|
for the project include:
|
|
|
|
- Shells
|
|
|
|
- Network servers
|
|
|
|
- Kernel module handling utilities
|
2023-01-16 19:03:25 -05:00
|
|
|
- Anything requiring suid or sgid bits such as `su` or `sudo`
|
2022-12-25 22:27:17 -05:00
|
|
|
The code aims to be portable across **Unix** variants, ie Linux and BSD, but not
|
|
|
|
MacOS or Windows. Development occurs on Linux, so if your OS is more exotic then
|
|
|
|
YMMV.
|
|
|
|
|
|
|
|
## 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
|
|
|
|
```
|
|
|
|
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
|
|
|
|
target/release/shitbox help bootstrap
|
|
|
|
```
|
|
|
|
### Supported shells for completions
|
|
|
|
- Bash
|
|
|
|
- Fish
|
|
|
|
- NuShell
|
|
|
|
- PowerShell
|
|
|
|
- Zsh
|
|
|
|
|