From e7a248ef12140173a5d57d781345cd7bf3b028aa Mon Sep 17 00:00:00 2001 From: Sergii Pylypenko Date: Mon, 31 Mar 2014 23:45:43 +0300 Subject: [PATCH] Xserver-debian: more flexible postinstall script launcher --- project/jni/application/xserver/gfx.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/project/jni/application/xserver/gfx.c b/project/jni/application/xserver/gfx.c index 1d2612243..ad2e6e1e4 100644 --- a/project/jni/application/xserver/gfx.c +++ b/project/jni/application/xserver/gfx.c @@ -106,9 +106,23 @@ void * unpackFilesThread(void * unused) strcat( fname, "/postinstall.sh" ); if( stat( fname, &st ) != 0 ) { - __android_log_print(ANDROID_LOG_INFO, "XSDL", "No postinstall script"); - unpackFinished = 1; - return (void *)1; + strcpy( fname2, getenv("UNSECURE_STORAGE_DIR") ); + strcat( fname2, "/postinstall.sh" ); + if( stat( fname2, &st ) != 0 ) + { + __android_log_print(ANDROID_LOG_INFO, "XSDL", "No postinstall script"); + unpackFinished = 1; + return (void *)1; + } + else + { + strcpy( fname2, "cat " ); + strcat( fname2, getenv("UNSECURE_STORAGE_DIR") ); + strcat( fname2, "/postinstall.sh > " ); + strcat( fname2, fname ); + __android_log_print(ANDROID_LOG_INFO, "XSDL", "Copying postinstall scipt from SD card: %s", fname2); + system( fname2 ); + } } unpackProgressRunningScript = 1;