Skip to content

Commit

Permalink
Add o3 mode
Browse files Browse the repository at this point in the history
  • Loading branch information
j005u committed Dec 1, 2024
1 parent 544efd4 commit 17464b7
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ jobs:
run: |
export PATH=$ANDROID_NDK_HOME:$PATH
make ipk
make modloader-o3
make tweaks
- name: Upload release artifacts
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ tweaks: tweak-*/jni/*
$(MAKE) -C tweak-enable-debug-menu ipk
mv tweak-enable-debug-menu/ipk/*.ipk ./


modloader-o3: modloader-o3/*
$(MAKE) -C modloader-o3 ipk
mv modloader-o3/ipk/*.ipk ./

clean:
$(MAKE) -C ipk clean
rm -f *.ipk
6 changes: 6 additions & 0 deletions modloader-o3/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ipk:
$(MAKE) -C ipk clean
$(MAKE) -C ipk

clean:
$(MAKE) -C ipk clean
16 changes: 16 additions & 0 deletions modloader-o3/ipk/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
NAME = $(shell cat ./control/control | grep Package | cut -d" " -f2)
ARCH = $(shell cat ./control/control | grep Architecture | cut -d" " -f2)
VERSION = $(shell cat ./control/control | grep Version | cut -d" " -f2)
IPK_NAME = "${NAME}_${VERSION}_${ARCH}.ipk"

all:
mkdir -p tmp
echo "2.0" > tmp/debian-binary
cp -r data tmp/
cp -r control tmp/
cd tmp/control && tar --owner=0 --group=0 -czvf ../control.tar.gz .
cd tmp/data && tar --owner=0 --group=0 -czvf ../data.tar.gz .
cd tmp/ && tar --owner=0 --group=0 -czvf "../${IPK_NAME}" ./control.tar.gz ./data.tar.gz ./debian-binary

clean:
rm -rf tmp
7 changes: 7 additions & 0 deletions modloader-o3/ipk/control/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Package: wtfos-modloader-o3
Version: 0.1.5
Maintainer: Joonas Trussmann <[email protected]>
Description: Enable modloader for O3 mode
Architecture: pigeon-glasses-v2
Homepage: https://github.com/fpv-wtf/wtfos-modloader
Depends: wtfos-modloader
18 changes: 18 additions & 0 deletions modloader-o3/ipk/control/postinst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/system/bin/sh

if ! mount | grep -q "/dev/loop"; then
echo "/system is not loopmounted. You shouldn't do this on your real /system."
exit 1
fi

cd /system/bin

filename="dji_glasses"

if [[ ! -f ${filename}_original ]]
then
cp ${filename} ${filename}_original
fi

ln -sf /opt/bin/modloader ${filename}
mkdir -p /opt/etc/preload.d/${filename}
11 changes: 11 additions & 0 deletions modloader-o3/ipk/control/prerm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/system/bin/sh

cd /system/bin

filename="dji_glasses"

if [[ -f ${filename}_original ]]
then
rm -f ${filename}
cp ${filename}_original ${filename}
fi

0 comments on commit 17464b7

Please sign in to comment.