______ __ ______ ______ __ __ /\ ___\ /\ \ /\ __ \ /\ ___\ /\ \_\ \ \ \___ \\ \ \____\ \ \/\ \\ \___ \\ \ __ \ \/\_____\\ \_____\\ \_____\\/\_____\\ \_\ \_\ \/_____/ \/_____/ \/_____/ \/_____/ \/_/\/_/
the slosh guide : download and build
download
The source code for slosh is hosted in a git repository. If you have git installed, you can run the following command from your terminal (on a unix-like system):
git clone https://git.rawtext.club/sloum/slosh && cd slosh
If you do not have git installed on your system and still want access to the source code you can alternately download a zip file of the code:
build
Now that you have the code on your system you will need to build slosh.
pre-requisites
To build slosh you will need a Go compiler. If you do not have one, you may be able to get one from your operating system's package repository. Or, if you prefer, you can download one directly from the Go website:
slosh was built with Go 1.16. You may be able to build it with an older version, but the tested version is 1.16.
In addition to Go it is helpful to have Make installed on your system. Most unix/bsd/linux systems should already have a version of Make installed. If not, check with your system's package repository. It is possible to build and install without Make, by using go itself. However, using this method will not provide you with the manpage installed on your system.
Optionally, having upx installed on the system to compress the resulting binary can be helpful, expecially on resource constrained systems.
using the makefile to build and install
A few Make targets have been set up for your convenience.
If you have administrator privleges (or your system does not require them for a global install), you can run the following from within the main slosh source code directory you cloned/downloaded:
sudo make install
If you are using upx, you will want to run:
sudo upx -9 /usr/local/bin/slosh
It is possible your system will not require sudo, or may use an alternative such as doas.
The above command(s) will install slosh and its manpage.
If you prefer, or need, to install locally for just your user you can run the following from the repository directory:
make
This will build the program in place and you can move it wherever you like.
using go to build and install
The makefile uses Go to build and install slosh anyway, so you may just prefer to do so directly. To install slosh run the following from the repository directory:
go install
To build in the local folder you may run:
go build -ldflags "-w -s" -o slosh
You can, optionally, run upx as listed in the makefile instructions. Just adjust the path to the location of the binary.
Remember that this does not install the man page. It is, however, provided in the repository and you may manually install it if you like.
Add slosh as a Login Shell
The last step, if you intend to use slosh as a login shell, is to add slosh to /etc/shells.
echo /usr/local/bin/slosh >> /etc/shells
Adjust the path if you installed slosh to a different location. Essentially we are just appending the path to slosh tot he end of the /etc/shells file. This will enable users on the system to change their login shell to slosh via the chsh command.