Skip to content

Commit bf0f8fd

Browse files
author
AXON
committed
Update README.md
1 parent cea0f1e commit bf0f8fd

1 file changed

Lines changed: 56 additions & 4 deletions

File tree

README.md

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Introduction
2+
13
This is my very first public `rust` project for fun purposes.
24

35
Obviously this was written in `Rust - a systems programming language` by a noob rustacean with a few hours of experience with rust 😝
@@ -7,7 +9,57 @@ My code may seem funny in some parts since I've just tried to apply what I've le
79
So, kindly ignore as long I'm a noob LoL
810

911

10-
# To-do:
11-
* Add build details in README.md
12-
* Completing this project (Means testing it ... the hard part of all, didn't test the final change yet)
13-
* Once after these, release pre-built binaries for ease of use
12+
13+
# Build instructions
14+
15+
* First of all you need rust. Follow the link below and you should know what to do.
16+
17+
> It'll also autoinstall rustc and cargo for you.
18+
19+
> https://www.rust-lang.org/tools/install
20+
21+
* Once you have rustt and everything it brings, we add a new target. Run the following command:
22+
23+
```bash
24+
rustup target add x86_64-unknown-linux-musl
25+
```
26+
27+
> Or if you wan to make for 32bit arch then the target should be `i686-unknown-linux-musl`.
28+
29+
* After you have the build targets installed simply run the following command:
30+
31+
```bash
32+
cargo build --release --target x86_64-unknown-linux-musl # For 64bit
33+
34+
# or
35+
36+
cargo build --release --target i686-unknown-linux-musl # For 32bit
37+
```
38+
39+
> Then you should find the output as `target/x86_64-unknown-linux-musl/release/rusgik`
40+
> I recommend to `strip` the binary for reducing the size.
41+
42+
43+
# Installation
44+
45+
## For Android-9 and below
46+
47+
* Copy your `ramdisk.img` and the `rusgik` binary in an ext4 partition directory and run the following commands:
48+
49+
```bash
50+
su
51+
mkdir ramdisk && ( cd ramdisk && zcat ../ramdisk.img | cpio -iud && mv init init.real )
52+
rsync rusgik ramdisk/init && chmod 777 ramdisk/init && ( cd ramdisk && find . | cpio -o -H newc | gzip > ../ramdisk.img )
53+
```
54+
55+
> Tl;dr: In short, you need to rename `init` executable to `init.real` and put `rusgik` as `init` inside your `ramdisk.img`.
56+
57+
## For Android-10 and above
58+
59+
* If your system image is `system.sfs` then you need to extract it, an quick way to do that is: `7z x system.sfs && rm system.sfs`
60+
61+
* Once you have `system.img` you need to mount it: `mkdir mdir && sudo mount -o loop system.img mdir`
62+
63+
* Now rename `init` to `init.real` by running the following command: `sudo mv init init.real`
64+
65+
* Lastly put `rusgik` binary as `init` executable at `/` of system.img: `sudo rsync rusgik mdir/init && chmod 777 mdir/init`

0 commit comments

Comments
 (0)