resolved conflicts for merge of 78afed1c to jb-mr1-dev-plus-aosp

Change-Id: I861e3a6aa07c448909b2ae54618bba178bd6e457
This commit is contained in:
Kenny Root
2012-10-16 17:44:21 -07:00
11 changed files with 4 additions and 53 deletions

View File

@@ -46,6 +46,7 @@ LOCAL_STATIC_LIBRARIES := \
libpixelflinger_static \ libpixelflinger_static \
libpng \ libpng \
libcutils \ libcutils \
libselinux \
libstdc++ \ libstdc++ \
libm \ libm \
libc libc
@@ -56,12 +57,6 @@ ifeq ($(TARGET_USERIMAGES_USE_EXT4), true)
LOCAL_STATIC_LIBRARIES += libext4_utils_static libz LOCAL_STATIC_LIBRARIES += libext4_utils_static libz
endif endif
ifeq ($(HAVE_SELINUX), true)
LOCAL_C_INCLUDES += external/libselinux/include
LOCAL_STATIC_LIBRARIES += libselinux
LOCAL_CFLAGS += -DHAVE_SELINUX
endif # HAVE_SELINUX
# This binary is in the recovery ramdisk, which is otherwise a copy of root. # This binary is in the recovery ramdisk, which is otherwise a copy of root.
# It gets copied there in config/Makefile. LOCAL_MODULE_TAGS suppresses # It gets copied there in config/Makefile. LOCAL_MODULE_TAGS suppresses
# a (redundant) copy of the binary in /system/bin for user builds. # a (redundant) copy of the binary in /system/bin for user builds.
@@ -74,12 +69,6 @@ else
LOCAL_STATIC_LIBRARIES += $(TARGET_RECOVERY_UI_LIB) LOCAL_STATIC_LIBRARIES += $(TARGET_RECOVERY_UI_LIB)
endif endif
ifeq ($(HAVE_SELINUX),true)
LOCAL_C_INCLUDES += external/libselinux/include
LOCAL_STATIC_LIBRARIES += libselinux
LOCAL_CFLAGS += -DHAVE_SELINUX
endif # HAVE_SELINUX
LOCAL_C_INCLUDES += system/extras/ext4_utils LOCAL_C_INCLUDES += system/extras/ext4_utils
include $(BUILD_EXECUTABLE) include $(BUILD_EXECUTABLE)

View File

@@ -8,15 +8,11 @@ LOCAL_SRC_FILES := \
Inlines.c \ Inlines.c \
Zip.c Zip.c
LOCAL_C_INCLUDES += \ LOCAL_C_INCLUDES := \
external/zlib \ external/zlib \
external/safe-iop/include external/safe-iop/include
ifeq ($(HAVE_SELINUX),true) LOCAL_STATIC_LIBRARIES := libselinux
LOCAL_C_INCLUDES += external/libselinux/include
LOCAL_STATIC_LIBRARIES += libselinux
LOCAL_CFLAGS += -DHAVE_SELINUX
endif
LOCAL_MODULE := libminzip LOCAL_MODULE := libminzip

View File

@@ -145,24 +145,19 @@ dirCreateHierarchy(const char *path, int mode,
} else if (ds == DMISSING) { } else if (ds == DMISSING) {
int err; int err;
#ifdef HAVE_SELINUX
char *secontext = NULL; char *secontext = NULL;
if (sehnd) { if (sehnd) {
selabel_lookup(sehnd, &secontext, cpath, mode); selabel_lookup(sehnd, &secontext, cpath, mode);
setfscreatecon(secontext); setfscreatecon(secontext);
} }
#endif
err = mkdir(cpath, mode); err = mkdir(cpath, mode);
#ifdef HAVE_SELINUX
if (secontext) { if (secontext) {
freecon(secontext); freecon(secontext);
setfscreatecon(NULL); setfscreatecon(NULL);
} }
#endif
if (err != 0) { if (err != 0) {
free(cpath); free(cpath);

View File

@@ -24,12 +24,8 @@
extern "C" { extern "C" {
#endif #endif
#ifdef HAVE_SELINUX
#include <selinux/selinux.h> #include <selinux/selinux.h>
#include <selinux/label.h> #include <selinux/label.h>
#else
struct selabel_handle;
#endif
/* Like "mkdir -p", try to guarantee that all directories /* Like "mkdir -p", try to guarantee that all directories
* specified in path are present, creating as many directories * specified in path are present, creating as many directories

View File

@@ -1115,23 +1115,19 @@ bool mzExtractRecursive(const ZipArchive *pArchive,
* Open the target for writing. * Open the target for writing.
*/ */
#ifdef HAVE_SELINUX
char *secontext = NULL; char *secontext = NULL;
if (sehnd) { if (sehnd) {
selabel_lookup(sehnd, &secontext, targetFile, UNZIP_FILEMODE); selabel_lookup(sehnd, &secontext, targetFile, UNZIP_FILEMODE);
setfscreatecon(secontext); setfscreatecon(secontext);
} }
#endif
int fd = creat(targetFile, UNZIP_FILEMODE); int fd = creat(targetFile, UNZIP_FILEMODE);
#ifdef HAVE_SELINUX
if (secontext) { if (secontext) {
freecon(secontext); freecon(secontext);
setfscreatecon(NULL); setfscreatecon(NULL);
} }
#endif
if (fd < 0) { if (fd < 0) {
LOGE("Can't create target file \"%s\": %s\n", LOGE("Can't create target file \"%s\": %s\n",

View File

@@ -18,12 +18,8 @@
extern "C" { extern "C" {
#endif #endif
#ifdef HAVE_SELINUX
#include <selinux/selinux.h> #include <selinux/selinux.h>
#include <selinux/label.h> #include <selinux/label.h>
#else
struct selabel_handle;
#endif
/* /*
* One entry in the Zip archive. Treat this as opaque -- use accessors below. * One entry in the Zip archive. Treat this as opaque -- use accessors below.

View File

@@ -863,7 +863,6 @@ main(int argc, char **argv) {
ui->SetBackground(RecoveryUI::NONE); ui->SetBackground(RecoveryUI::NONE);
if (show_text) ui->ShowText(true); if (show_text) ui->ShowText(true);
#ifdef HAVE_SELINUX
struct selinux_opt seopts[] = { struct selinux_opt seopts[] = {
{ SELABEL_OPT_PATH, "/file_contexts" } { SELABEL_OPT_PATH, "/file_contexts" }
}; };
@@ -874,7 +873,6 @@ main(int argc, char **argv) {
fprintf(stderr, "Warning: No file_contexts\n"); fprintf(stderr, "Warning: No file_contexts\n");
ui->Print("Warning: No file_contexts\n"); ui->Print("Warning: No file_contexts\n");
} }
#endif
device->StartRecovery(); device->StartRecovery();

View File

@@ -27,17 +27,12 @@ LOCAL_STATIC_LIBRARIES += \
libz libz
endif endif
ifeq ($(HAVE_SELINUX), true)
LOCAL_C_INCLUDES += external/libselinux/include
LOCAL_STATIC_LIBRARIES += libselinux
LOCAL_CFLAGS += -DHAVE_SELINUX
endif # HAVE_SELINUX
LOCAL_STATIC_LIBRARIES += $(TARGET_RECOVERY_UPDATER_LIBS) $(TARGET_RECOVERY_UPDATER_EXTRA_LIBS) LOCAL_STATIC_LIBRARIES += $(TARGET_RECOVERY_UPDATER_LIBS) $(TARGET_RECOVERY_UPDATER_EXTRA_LIBS)
LOCAL_STATIC_LIBRARIES += libapplypatch libedify libmtdutils libminzip libz LOCAL_STATIC_LIBRARIES += libapplypatch libedify libmtdutils libminzip libz
LOCAL_STATIC_LIBRARIES += libmincrypt libbz LOCAL_STATIC_LIBRARIES += libmincrypt libbz
LOCAL_STATIC_LIBRARIES += libminelf LOCAL_STATIC_LIBRARIES += libminelf
LOCAL_STATIC_LIBRARIES += libcutils libstdc++ libc LOCAL_STATIC_LIBRARIES += libcutils libstdc++ libc
LOCAL_STATIC_LIBRARIES += libselinux
LOCAL_C_INCLUDES += $(LOCAL_PATH)/.. LOCAL_C_INCLUDES += $(LOCAL_PATH)/..
# Each library in TARGET_RECOVERY_UPDATER_LIBS should have a function # Each library in TARGET_RECOVERY_UPDATER_LIBS should have a function

View File

@@ -78,23 +78,19 @@ Value* MountFn(const char* name, State* state, int argc, Expr* argv[]) {
goto done; goto done;
} }
#ifdef HAVE_SELINUX
char *secontext = NULL; char *secontext = NULL;
if (sehandle) { if (sehandle) {
selabel_lookup(sehandle, &secontext, mount_point, 0755); selabel_lookup(sehandle, &secontext, mount_point, 0755);
setfscreatecon(secontext); setfscreatecon(secontext);
} }
#endif
mkdir(mount_point, 0755); mkdir(mount_point, 0755);
#ifdef HAVE_SELINUX
if (secontext) { if (secontext) {
freecon(secontext); freecon(secontext);
setfscreatecon(NULL); setfscreatecon(NULL);
} }
#endif
if (strcmp(partition_type, "MTD") == 0) { if (strcmp(partition_type, "MTD") == 0) {
mtd_scan_partitions(); mtd_scan_partitions();

View File

@@ -105,7 +105,6 @@ int main(int argc, char** argv) {
return 6; return 6;
} }
#ifdef HAVE_SELINUX
struct selinux_opt seopts[] = { struct selinux_opt seopts[] = {
{ SELABEL_OPT_PATH, "/file_contexts" } { SELABEL_OPT_PATH, "/file_contexts" }
}; };
@@ -116,7 +115,6 @@ int main(int argc, char** argv) {
fprintf(stderr, "Warning: No file_contexts\n"); fprintf(stderr, "Warning: No file_contexts\n");
fprintf(cmd_pipe, "ui_print Warning: No file_contexts\n"); fprintf(cmd_pipe, "ui_print Warning: No file_contexts\n");
} }
#endif
// Evaluate the parsed script. // Evaluate the parsed script.

View File

@@ -20,12 +20,8 @@
#include <stdio.h> #include <stdio.h>
#include "minzip/Zip.h" #include "minzip/Zip.h"
#ifdef HAVE_SELINUX
#include <selinux/selinux.h> #include <selinux/selinux.h>
#include <selinux/label.h> #include <selinux/label.h>
#else
struct selabel_handle;
#endif
typedef struct { typedef struct {
FILE* cmd_pipe; FILE* cmd_pipe;