dcb3bd24c47ea99734f94ed3b9767a9518f410e9
[openwrt/openwrt.git] / package / utils / f2fs-tools / patches / 020-no_selinux.patch
1 --- a/configure.ac
2 +++ b/configure.ac
3 @@ -49,7 +49,7 @@ AC_PATH_PROG([LDCONFIG], [ldconfig],
4
5 # Checks for libraries.
6 PKG_CHECK_MODULES([libuuid], [uuid])
7 -PKG_CHECK_MODULES([libselinux], [libselinux])
8 +# PKG_CHECK_MODULES([libselinux], [libselinux])
9
10 # Checks for header files.
11 AC_CHECK_HEADERS([linux/fs.h fcntl.h mntent.h stdlib.h string.h \
12 --- a/fsck/sload.c
13 +++ b/fsck/sload.c
14 @@ -16,10 +16,11 @@
15 #include <libgen.h>
16 #include <dirent.h>
17 #include <mntent.h>
18 +
19 +#ifdef WITH_ANDROID
20 #include <selinux/selinux.h>
21 #include <selinux/label.h>
22
23 -#ifdef WITH_ANDROID
24 #include <selinux/label.h>
25 #include <private/android_filesystem_config.h>
26
27 @@ -110,10 +111,12 @@ static int build_directory(struct f2fs_s
28 handle_selabel(dentries + i, S_ISDIR(stat.st_mode),
29 target_out_dir);
30
31 +#ifdef WITH_ANDROID
32 if (sehnd && selabel_lookup(sehnd, &dentries[i].secon,
33 dentries[i].path, stat.st_mode) < 0)
34 ERR_MSG("Cannot lookup security context for %s\n",
35 dentries[i].path);
36 +#endif
37
38 dentries[i].pino = dir_ino;
39
40 @@ -218,6 +221,7 @@ int f2fs_sload(struct f2fs_sb_info *sbi,
41 return ret;
42 }
43
44 +#ifdef WITH_ANDROID
45 if (sehnd) {
46 char *secontext = NULL;
47
48 @@ -233,6 +237,7 @@ int f2fs_sload(struct f2fs_sb_info *sbi,
49 }
50 free(secontext);
51 }
52 +#endif
53
54 /* update curseg info; can update sit->types */
55 move_curseg_info(sbi, SM_I(sbi)->main_blkaddr);