Skip to content

Commit 45247d6

Browse files
committed
Add RCM payload support for Raspberry Pi
See #57
1 parent 3bfc37a commit 45247d6

File tree

7 files changed

+52
-3
lines changed

7 files changed

+52
-3
lines changed

BUILD.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ $ javac -h . RcmSmash.java
2929
$ cd 'NS-USBloader/JNI sources/linux'
3030
$ make install clean
3131
```
32+
**Build for Raspberry Pi (Raspberry Pi host):**
33+
```
34+
$ cd 'NS-USBloader/JNI sources/linux'
35+
$ mv Makefile_rapsberry Makefile
36+
$ make install clean
37+
```
38+
3239
**Build for Windows (on x86_64 host):**
3340

3441
[ This part should be updated ]

JNI sources/linux/Makefile_raspberry

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Compiler
2+
CC=arm-linux-gnueabihf-gcc
3+
# Flags
4+
CFLAGS=-O2
5+
MKDIR_P = mkdir -p
6+
APP_NAME = smashlib.so
7+
8+
ifeq ($(JAVA_HOME),)
9+
JAVA_LIB_PATH := "/usr/lib/jvm/default-java/include"
10+
JAVA_LIB_PATH_LINUX := "/usr/lib/jvm/default-java/include/linux"
11+
else
12+
JAVA_LIB_PATH = ${JAVA_HOME}/include
13+
JAVA_LIB_PATH_LINUX = ${JAVA_HOME}/include/linux
14+
endif
15+
16+
all: arm
17+
18+
arm:
19+
test $(JAVA_LIB_PATH)
20+
$(MKDIR_P) ./arm
21+
$(CC) -c -fPIC -I$(JAVA_LIB_PATH) -I"$(JAVA_LIB_PATH_LINUX)" smashlib.c -o smashlib_arm.o
22+
$(CC) ${CFLAGS} -shared -fPIC -o ./arm/${APP_NAME} smashlib_arm.o -lc
23+
24+
clean:
25+
rm -rf smashlib_arm.o ./arm
26+
27+
install: arm
28+
install ./arm/${APP_NAME} ../../src/main/resources/native/linux/arm/
29+
30+
uninstall:
31+
rm ../../src/main/resources/native/linux/arm/${APP_NAME}

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
NS-USBloader is:
88
* A PC-side installer for **[Adubbz/TinFoil (v0.2.1)](https://github.com/Adubbz/Tinfoil/)**, **[Huntereb/Awoo-Installer](https://github.com/Huntereb/Awoo-Installer)** (USB and Network supported) and **[XorTroll/GoldLeaf](https://github.com/XorTroll/Goldleaf)** (USB) NSP installer.
99
Replacement for default **usb_install_pc.py**, **remote_install_pc.py**, **GoldTree**/**Quark**.
10-
* This application also could be used as RCM payload on Windows, MacOS and Linux (supported arch: x86, x86_64).
10+
* This application also could be used as RCM payload on Windows, MacOS and Linux (supported arch: x86, x86_64 and Raspberry Pi).
1111
* And of course it's a tool for split files!
1212
* And also for merging split-files into one :)
1313

@@ -90,6 +90,14 @@ root # udevadm control --reload-rules && udevadm trigger
9090

9191
Please note: you may have to change 'plugdev' group from example above to the different one. It's depends on you linux distro.
9292

93+
##### Raspberry Pi
94+
95+
1. Install JDK: `sudo apt install default-jdk`
96+
97+
2. For UI install JavaFX:
98+
99+
3. See steps 3 and 4 from 'Linux' section to update 'udev'.
100+
93101
##### macOS
94102

95103
Double-click on downloaded .jar file. Follow instructions. Or see 'Linux' section.

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<name>NS-USBloader</name>
99

1010
<artifactId>ns-usbloader</artifactId>
11-
<version>4.0-SNAPSHOT</version>
11+
<version>4.1-SNAPSHOT</version>
1212

1313
<url>https://github.com/developersu/ns-usbloader/</url>
1414
<description>

src/main/java/nsusbloader/NSLMain.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
public class NSLMain extends Application {
3434

35-
public static final String appVersion = "v4.0";
35+
public static final String appVersion = "v4.1";
3636
public static boolean isCli;
3737

3838
@Override

src/main/java/nsusbloader/Utilities/JNIRcmLoader.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ public static boolean load(){
4343
case "amd64":
4444
osArch = "amd64";
4545
break;
46+
case "arm":
47+
osArch = "arm";
48+
break;
4649
default:
4750
return false;
4851
}
7.48 KB
Binary file not shown.

0 commit comments

Comments
 (0)