Merge branch 'master' of https://github.com/bvanassche/fio
authorJens Axboe <axboe@kernel.dk>
Thu, 27 Apr 2023 23:08:41 +0000 (17:08 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 27 Apr 2023 23:08:41 +0000 (17:08 -0600)
* 'master' of https://github.com/bvanassche/fio:
  ci: Also test the Android recovery environment
  Detect ASharedMemory_create() support

.github/workflows/ci.yml
ci/actions-build.sh
ci/actions-full-test.sh
ci/actions-install.sh
ci/actions-smoke-test.sh
configure
os/os-ashmem.h

index 06e03ce3e6f1332b59fefaad8c098953d4688048..dd2997f0753c2f8d3a1632fef80114ebd42fa792 100644 (file)
@@ -34,6 +34,9 @@ jobs:
         - build: android
           os: ubuntu-22.04
           arch: aarch64-linux-android32
+        - build: android-recovery
+          os: ubuntu-22.04
+          arch: aarch64-linux-android32
         - build: windows-cygwin-64
           os: windows-latest
           arch: x86_64
index 7146fb592b39258ec66823fc71e889e2f7041c4d..351b8d18aad07e13cbc53d0cc82937855598922a 100755 (executable)
@@ -12,7 +12,7 @@ main() {
 
     set_ci_target_os
     case "${CI_TARGET_BUILD}/${CI_TARGET_OS}" in
-        android/*)
+        android*/*)
             export UNAME=Android
             if [ -z "${CI_TARGET_ARCH}" ]; then
                 echo "Error: CI_TARGET_ARCH has not been set"
@@ -20,7 +20,9 @@ main() {
             fi
             NDK=$PWD/android-ndk-r24/toolchains/llvm/prebuilt/linux-x86_64/bin
             export PATH="${NDK}:${PATH}"
-            export LIBS="-landroid"
+            if [ "${CI_TARGET_BUILD}" = "android" ]; then
+                export LIBS="-landroid"
+            fi
             CC=${NDK}/${CI_TARGET_ARCH}-clang
             if [ ! -e "${CC}" ]; then
                 echo "Error: could not find ${CC}"
index d1675f6eb2f17c0d5e08142245e0cbdde2efcdc1..d2fb4201ae37ba1f4f9bcdce91acc8dcc3338733 100755 (executable)
@@ -3,7 +3,10 @@
 set -eu
 
 main() {
-    [ "${CI_TARGET_BUILD}" = android ] && return 0
+    case "${CI_TARGET_BUILD}" in
+       android*)
+           return 0;;
+    esac
 
     echo "Running long running tests..."
     export PYTHONUNBUFFERED="TRUE"
index 39395de8b7876b616f9ce8665ac7bc2ccedf79e6..0d73ac97e2167572f1dfeb6313263dd2f11b2250 100755 (executable)
@@ -94,12 +94,14 @@ install_windows() {
 }
 
 main() {
-    if [ "${CI_TARGET_BUILD}" = "android" ]; then
-       echo "Installing Android NDK..."
-       wget --quiet https://dl.google.com/android/repository/android-ndk-r24-linux.zip
-       unzip -q android-ndk-r24-linux.zip
-       return 0
-    fi
+    case "${CI_TARGET_BUILD}" in
+       android*)
+           echo "Installing Android NDK..."
+           wget --quiet https://dl.google.com/android/repository/android-ndk-r24-linux.zip
+           unzip -q android-ndk-r24-linux.zip
+           return 0
+           ;;
+    esac
 
     set_ci_target_os
 
index 3196f6a1ba33a0c2a1a8bfad0fdff3e60bb6e2f5..494462ac38a5c46d129d95c07146595e724c3878 100755 (executable)
@@ -3,7 +3,10 @@
 set -eu
 
 main() {
-    [ "${CI_TARGET_BUILD}" = "android" ] && return 0
+    case "${CI_TARGET_BUILD}" in
+       android*)
+           return 0;;
+    esac
 
     echo "Running smoke tests..."
     make test
index abb6d016492e5d99a30fe8d4616702254d486980..ca03350b478cde342df4c3f2a5bac8654e547917 100755 (executable)
--- a/configure
+++ b/configure
@@ -1345,6 +1345,23 @@ if compile_prog "" "" "sync_file_range"; then
 fi
 print_config "sync_file_range" "$sync_file_range"
 
+##########################################
+# ASharedMemory_create() probe
+if test "$ASharedMemory_create" != "yes" ; then
+  ASharedMemory_create="no"
+fi
+cat > $TMPC << EOF
+#include <android/sharedmem.h>
+int main(int argc, char **argv)
+{
+  return ASharedMemory_create("", 0);
+}
+EOF
+if compile_prog "" "" "ASharedMemory_create"; then
+  ASharedMemory_create="yes"
+fi
+print_config "ASharedMemory_create" "$ASharedMemory_create"
+
 ##########################################
 # ext4 move extent probe
 if test "$ext4_me" != "yes" ; then
@@ -3011,6 +3028,9 @@ fi
 if test "$sync_file_range" = "yes" ; then
   output_sym "CONFIG_SYNC_FILE_RANGE"
 fi
+if test "$ASharedMemory_create" = "yes" ; then
+  output_sym "CONFIG_ASHAREDMEMORY_CREATE"
+fi
 if test "$sfaa" = "yes" ; then
   output_sym "CONFIG_SFAA"
 fi
index c34ff656cc75a0fd78a0509d94974e3ecab9d6c1..80eab7c4e1d851cd336892da24687ed43fea1798 100644 (file)
@@ -6,7 +6,7 @@
 #include <linux/ashmem.h>
 #include <linux/shm.h>
 #include <android/api-level.h>
-#if __ANDROID_API__ >= __ANDROID_API_O__
+#ifdef CONFIG_ASHAREDMEMORY_CREATE
 #include <android/sharedmem.h>
 #else
 #define ASHMEM_DEVICE  "/dev/ashmem"
@@ -27,7 +27,7 @@ static inline int shmctl(int __shmid, int __cmd, struct shmid_ds *__buf)
        return ret;
 }
 
-#if __ANDROID_API__ >= __ANDROID_API_O__
+#ifdef CONFIG_ASHAREDMEMORY_CREATE
 static inline int shmget(key_t __key, size_t __size, int __shmflg)
 {
        char keybuf[11];