Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
VHSgunzo committed Nov 7, 2024
1 parent 01a2e8e commit ce2983e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ target
.vscode
Cargo.lock
test
sharun
23 changes: 10 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ git clone https://github.com/VHSgunzo/sharun.git && cd sharun
* **Compile a binary**
```
rustup default nightly
rustup target add x86_64-unknown-linux-musl
rustup target add $(uname -m)-unknown-linux-musl
rustup component add rust-src --toolchain nightly
cargo build --release
cp ./target/$(uname -m)-unknown-linux-musl/release/sharun .
./sharun --help
./sharun lib4bin --help
```
* Or take an already precompiled binary file from the [releases](https://github.com/VHSgunzo/sharun/releases)

Expand Down Expand Up @@ -65,24 +68,18 @@ cargo build --release

## Examples:
```
# create a directory and cd
mkdir test && cd test
# and copy 'sharun' to this directory
cp ../target/x86_64-unknown-linux-musl/release/sharun .
# run lib4bin with the paths to the binary files that you want to make portable
./sharun lib4bin --strip --gen-lib-path /bin/bash
./sharun lib4bin --with-sharun --dst-dir test /bin/bash
# or for correct /proc/self/exe you can use HARD_LINKS=1
./sharun lib4bin --hard-links --strip --gen-lib-path /bin/bash
# this will create hard links to 'sharun' in the 'bin' directory
# or for correct /proc/self/exe you can use --hard-links flag
./sharun lib4bin --hard-links --with-sharun --dst-dir test /bin/bash
# this will create hard links from 'test/sharun' in the 'test/bin' directory
# now you can move 'test' dir to other linux system and run binaries from the 'bin' dir
./bin/bash --version
./test/bin/bash --version
# or specify them as an argument to 'sharun'
./sharun bash --version
./test/sharun bash --version
```

# Screenshots:
Expand Down

0 comments on commit ce2983e

Please sign in to comment.