From 24ee82b65d5c1ebf659dad0cdecccca1bd2c5b54 Mon Sep 17 00:00:00 2001 From: pelya Date: Sun, 10 Nov 2013 19:28:15 +0200 Subject: [PATCH] Xserver-xsdl: updated readme --- .../jni/application/xserver-gimp/readme.txt | 14 +++++------ project/jni/application/xserver/gfx.c | 24 ++++++++++++++++++- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/project/jni/application/xserver-gimp/readme.txt b/project/jni/application/xserver-gimp/readme.txt index f19337c33..3c63b84cd 100644 --- a/project/jni/application/xserver-gimp/readme.txt +++ b/project/jni/application/xserver-gimp/readme.txt @@ -40,15 +40,15 @@ img-gimp-wheezy.sh from directory img. This will create Debian system image under directory -dist-debug-wheezy-armhf-gimp. Execute commands ( is path to this repo): +dist-gimp-wheezy. Execute commands ( is path to this repo): -sudo cp -a /project/jni/application/src/xserver/data/usr/ dist-debug-wheezy-armhf-gimp/ -sudo cp -a /project/jni/application/src/xserver/android/xhost dist-debug-wheezy-armhf-gimp/usr/bin/ -sudo cp -a /project/jni/application/src/xserver/android/xkbcomp dist-debug-wheezy-armhf-gimp/usr/bin/ -sudo cp -a /project/jni/application/src/xserver/android/xli dist-debug-wheezy-armhf-gimp/usr/bin/ +sudo cp -a /project/jni/application/src/xserver/data/usr/ dist-gimp-wheezy/ +sudo cp -a /project/jni/application/src/xserver/android/xhost dist-gimp-wheezy/usr/bin/ +sudo cp -a /project/jni/application/src/xserver/android/xkbcomp dist-gimp-wheezy/usr/bin/ +sudo cp -a /project/jni/application/src/xserver/android/xli dist-gimp-wheezy/usr/bin/ -cd dist-debug-wheezy-armhf-gimp -sudo tar cvzf ../dist-debug-wheezy-armhf-gimp.tar.gz * +cd dist-gimp-wheezy +sudo tar cvzf ../dist-gimp-wheezy.tar.gz * Upload resulting system image somewhere, and change download URL inside AndroidAppSettings.cfg, then recompile .apk file. diff --git a/project/jni/application/xserver/gfx.c b/project/jni/application/xserver/gfx.c index a9f8cf660..eed64dbaa 100644 --- a/project/jni/application/xserver/gfx.c +++ b/project/jni/application/xserver/gfx.c @@ -39,12 +39,15 @@ void * unpackFilesThread(void * unused) return 1; } + __android_log_print(ANDROID_LOG_INFO, "XSDL", "Unpacking data"); + strcpy( fname, getenv("SECURE_STORAGE_DIR") ); strcat( fname, "/busybox" ); FILE * ff = fopen("busybox", "rb"); FILE * fo = fopen(fname, "wb"); if( !ff || !fo ) { + __android_log_print(ANDROID_LOG_INFO, "XSDL", "Cannot copy busybox"); unpackFinished = 1; return 0; } @@ -55,6 +58,7 @@ void * unpackFilesThread(void * unused) int cnt = fread( buf, 1, sizeof(buf), ff ); if( cnt < 0 ) { + __android_log_print(ANDROID_LOG_INFO, "XSDL", "Cannot copy busybox"); unpackFinished = 1; return 1; } @@ -68,6 +72,7 @@ void * unpackFilesThread(void * unused) if( chmod(fname, 0755) != 0 ) { + __android_log_print(ANDROID_LOG_INFO, "XSDL", "Cannot chmod busybox"); unpackFinished = 1; return 0; } @@ -85,6 +90,7 @@ void * unpackFilesThread(void * unused) fo = popen(fname, "w"); if( !ff || !fo ) { + __android_log_print(ANDROID_LOG_INFO, "XSDL", "Error extracting data"); unpackFinished = 1; return 0; } @@ -96,6 +102,7 @@ void * unpackFilesThread(void * unused) int cnt = fread( buf, 1, sizeof(buf), ff ); if( cnt < 0 ) { + __android_log_print(ANDROID_LOG_INFO, "XSDL", "Error extracting data"); unpackFinished = 1; return 1; } @@ -113,27 +120,42 @@ void * unpackFilesThread(void * unused) fclose(ff); if( pclose(fo) != 0 ) { + __android_log_print(ANDROID_LOG_INFO, "XSDL", "Error extracting data"); unpackFinished = 1; return 0; } remove("data.tar.gz"); + __android_log_print(ANDROID_LOG_INFO, "XSDL", "Extracting data finished"); + strcpy( fname, getenv("SECURE_STORAGE_DIR") ); strcat( fname, "/postinstall.sh" ); if( stat( fname, &st ) != 0 ) { + __android_log_print(ANDROID_LOG_INFO, "XSDL", "No postinstall script"); unpackFinished = 1; return 1; } + __android_log_print(ANDROID_LOG_INFO, "XSDL", "Running postinstall scipt"); + fo = popen(fname, "w"); if( !fo ) { + __android_log_print(ANDROID_LOG_INFO, "XSDL", "ERROR: Cannot launch postinstall scipt"); unpackFinished = 1; return 0; } - pclose(fo); + for(;;) + { + char buf[1024]; + if( !fgets(buf, sizeof(buf), fo) ) + break; + __android_log_print(ANDROID_LOG_INFO, "XSDL", "> %s", buf); + } + + __android_log_print(ANDROID_LOG_INFO, "XSDL", "Postinstall scipt exited with status %d", pclose(fo)); unpackFinished = 1; return 1;