Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues compiling LiME for a Android Pixel 2 - Invalid Argument #98

Open
MichaelHbfh opened this issue Dec 20, 2021 · 0 comments
Open

Issues compiling LiME for a Android Pixel 2 - Invalid Argument #98

MichaelHbfh opened this issue Dec 20, 2021 · 0 comments

Comments

@MichaelHbfh
Copy link

I am trying to cross-compile the latest version of LiME to acquire a memory image of my Android Pixel 2 phone.

I did manage to compile the Android kernel and using the same configuration (exports) as for the kernel compilation, therefore the same cross compiler. When I try to compile LiME the following error messages appear:
cross-compile for Android emulator
make ARCH=arm64 CROSS_COMPILE=/home/michael/Projects/Android/phone_info/pixel_2/android-ndk-r16b/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android- -C /home/michael/Projects/Android/phone_info/pixel_2/android-msm-wahoo-4.4-android11 M="/home/michael/Projects/Android/phone_info/pixel_2/LiME/src" modules
make[1]: Entering directory '/home/michael/Projects/Android/phone_info/pixel_2/android-msm-wahoo-4.4-android11'
CC [M] /home/michael/Projects/Android/phone_info/pixel_2/LiME/src/tcp.o
/home/michael/Projects/Android/phone_info/pixel_2/LiME/src/tcp.c:39:1: error: expected '=', ',', ';', 'asm' or 'attribute' before 'ssize_t'
ssize_t write_vaddr_tcp(void *, size_t);
^
/home/michael/Projects/Android/phone_info/pixel_2/LiME/src/tcp.c: In function 'setup_tcp':
/home/michael/Projects/Android/phone_info/pixel_2/LiME/src/tcp.c:77:5: error: 'opt' undeclared (first use in this function)
opt = 1;
^
/home/michael/Projects/Android/phone_info/pixel_2/LiME/src/tcp.c:77:5: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [scripts/Makefile.build:277: /home/michael/Projects/Android/phone_info/pixel_2/LiME/src/tcp.o] Error 1
make[1]: *** [Makefile:1473: module/home/michael/Projects/Android/phone_info/pixel_2/LiME/src] Error 2
make[1]: Leaving directory '/home/michael/Projects/Android/phone_info/pixel_2/android-msm-wahoo-4.4-android11'
make: *** [Makefile:37: cross-compile] Error 2
******************************************

cross-compile for Android emulator

make ARCH=arm64 CROSS_COMPILE=/home/michael/Projects/Android/phone_info/pixel_2/android-ndk-r16b/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android- -C /home/michael/Projects/Android/phone_info/pixel_2/android-msm-wahoo-4.4-android11 M="/home/michael/Projects/Android/phone_info/pixel_2/LiME/src" modules
make[1]: Entering directory '/home/michael/Projects/Android/phone_info/pixel_2/android-msm-wahoo-4.4-android11'
CC [M] /home/michael/Projects/Android/phone_info/pixel_2/LiME/src/tcp.o
CC [M] /home/michael/Projects/Android/phone_info/pixel_2/LiME/src/disk.o
/home/michael/Projects/Android/phone_info/pixel_2/LiME/src/disk.c: In function 'write_vaddr_disk':
/home/michael/Projects/Android/phone_info/pixel_2/LiME/src/disk.c:99:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
mm_segment_t fs;
^
cc1: all warnings being treated as errors
make[2]: *** [scripts/Makefile.build:277: /home/michael/Projects/Android/phone_info/pixel_2/LiME/src/disk.o] Error 1
make[1]: *** [Makefile:1473: module/home/michael/Projects/Android/phone_info/pixel_2/LiME/src] Error 2
make[1]: Leaving directory '/home/michael/Projects/Android/phone_info/pixel_2/android-msm-wahoo-4.4-android11'
make: *** [Makefile:37: cross-compile] Error 2
michael@spica:~/Projects/Android/phone_info/pixel_2/LiME/src$ make cross-compile

cross-compile for Android emulator

make ARCH=arm64 CROSS_COMPILE=/home/michael/Projects/Android/phone_info/pixel_2/android-ndk-r16b/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android- -C /home/michael/Projects/Android/phone_info/pixel_2/android-msm-wahoo-4.4-android11 M="/home/michael/Projects/Android/phone_info/pixel_2/LiME/src" modules
make[1]: Entering directory '/home/michael/Projects/Android/phone_info/pixel_2/android-msm-wahoo-4.4-android11'
CC [M] /home/michael/Projects/Android/phone_info/pixel_2/LiME/src/disk.o
CC [M] /home/michael/Projects/Android/phone_info/pixel_2/LiME/src/main.o
CC [M] /home/michael/Projects/Android/phone_info/pixel_2/LiME/src/hash.o
CC [M] /home/michael/Projects/Android/phone_info/pixel_2/LiME/src/deflate.o
LD [M] /home/michael/Projects/Android/phone_info/pixel_2/LiME/src/lime.o
Building modules, stage 2.
MODPOST 1 modules
CC /home/michael/Projects/Android/phone_info/pixel_2/LiME/src/lime.mod.o
LD [M] /home/michael/Projects/Android/phone_info/pixel_2/LiME/src/lime.ko
make[1]: Leaving directory '/home/michael/Projects/Android/phone_info/pixel_2/android-msm-wahoo-4.4-android11'
/home/michael/Projects/Android/phone_info/pixel_2/android-ndk-r16b/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-strip --strip-unneeded lime.ko
mv lime.ko lime-goldfish.ko

I did manage to change the source code so that LiME does compile. But when I copy the .ko file onto my phone and try to forward a memory image I constantly get the following error message:
walleye:/sdcard # insmod lime-pixel_2.ko "path=tcp:4444 format=lime"
insmod: failed to load lime-pixel_2.ko: Invalid argument
1|walleye:/sdcard #

Any idea I can improve?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant