Skip to content

Commit

Permalink
Add libtar to TWRP instead of using busybox tar
Browse files Browse the repository at this point in the history
Add proper mkdosfs tool
Add fuse to TWRP
Add experimental exfat-fuse to TWRP
Convert all system() functions to use new Exec_Cmd function
  • Loading branch information
bigbiff committed Jan 9, 2013
1 parent 6ff55ce commit 9c75405
Show file tree
Hide file tree
Showing 178 changed files with 39,527 additions and 788 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.*.swp
19 changes: 14 additions & 5 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ LOCAL_SRC_FILES := \
screen_ui.cpp \
verifier.cpp \
fixPermissions.cpp \
twrpTar.cpp \
adb_install.cpp

LOCAL_SRC_FILES += \
data.cpp \
makelist.cpp \
partition.cpp \
partitionmanager.cpp \
mtdutils/mtdutils.c \
Expand Down Expand Up @@ -65,7 +65,7 @@ LOCAL_SHARED_LIBRARIES :=
LOCAL_STATIC_LIBRARIES += libmtdutils
LOCAL_STATIC_LIBRARIES += libminadbd libminzip libunz
LOCAL_STATIC_LIBRARIES += libminuitwrp libpixelflinger_static libpng libjpegtwrp libgui
LOCAL_SHARED_LIBRARIES += libz libc libstlport libcutils libstdc++ libmincrypt libext4_utils
LOCAL_SHARED_LIBRARIES += libz libc libstlport libcutils libstdc++ libmincrypt libext4_utils libtar

ifeq ($(TARGET_USERIMAGES_USE_EXT4), true)
LOCAL_CFLAGS += -DUSE_EXT4
Expand All @@ -76,7 +76,7 @@ endif
ifeq ($(HAVE_SELINUX), true)
LOCAL_C_INCLUDES += external/libselinux/include
LOCAL_STATIC_LIBRARIES += libselinux
LOCAL_CFLAGS += -DHAVE_SELINUX
LOCAL_CFLAGS += -DHAVE_SELINUX -g
endif # HAVE_SELINUX

# This binary is in the recovery ramdisk, which is otherwise a copy of root.
Expand Down Expand Up @@ -269,14 +269,16 @@ include $(commands_recovery_local_path)/libjpegtwrp/Android.mk \
$(commands_recovery_local_path)/gui/Android.mk \
$(commands_recovery_local_path)/mmcutils/Android.mk \
$(commands_recovery_local_path)/bmlutils/Android.mk \
$(commands_recovery_local_path)/flashutils/Android.mk \
$(commands_recovery_local_path)/prebuilt/Android.mk \
$(commands_recovery_local_path)/mtdutils/Android.mk \
$(commands_recovery_local_path)/flashutils/Android.mk \
$(commands_recovery_local_path)/pigz/Android.mk \
$(commands_recovery_local_path)/dosfstools/Android.mk \
$(commands_recovery_local_path)/libtar/Android.mk \
$(commands_recovery_local_path)/crypto/cryptsettings/Android.mk \
$(commands_recovery_local_path)/crypto/cryptfs/Android.mk \
$(commands_recovery_local_path)/libcrecovery/Android.mk \
$(commands_recovery_local_path)/twmincrypt/Android.mk
$(commands_recovery_local_path)/twmincrypt/Android.mk \

ifeq ($(TW_INCLUDE_CRYPTO_SAMSUNG), true)
include $(commands_recovery_local_path)/crypto/libcrypt_samsung/Android.mk
Expand All @@ -286,4 +288,11 @@ ifeq ($(TW_INCLUDE_JB_CRYPTO), true)
include $(commands_recovery_local_path)/crypto/fs_mgr/Android.mk
endif

ifeq ($(TW_INCLUDE_EXFAT), true)
include $(commands_recovery_local_path)/fuse/Android.mk
include $(commands_recovery_local_path)/exfat/libexfat/Android.mk
include $(commands_recovery_local_path)/exfat/exfat-fuse/Android.mk
include $(commands_recovery_local_path)/exfat/mkfs/Android.mk
endif

commands_recovery_local_path :=
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

The goal of this branch is to rebase TWRP onto AOSP while maintaining as much of the original AOSP code as possible. This goal should allow us to apply updates to the AOSP code going forward with little to no extra work. With this goal in mind, we will carefully consider any changes needed to the AOSP code before allowing them. In most cases, instead of changing the AOSP code, we'll create our own functions instead. The only changes that should be made to AOSP code should be those affecting startup of the recovery and some of the make files.

This branch is currently a work in progress, however, most features have been implemented and it is now ready for testing.
If there are changes that need to be merged from AOSP, we will pull the change directly from AOSP instead of creating a new patch in order to prevent merge conflicts with AOSP.

You can find a compiling guide [here](http://rootzwiki.com/topic/23903-how-to-compile-twrp-from-source/ "Guide").
This branch is under final testing and will be used shortly for public builds, but has not officially been released.

You can find a compiling guide [here](http://forum.xda-developers.com/showthread.php?t=1943625 "Guide").

[More information about the project.](http://www.teamw.in/project/twrp2 "More Information")

Expand Down
4 changes: 1 addition & 3 deletions data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,6 @@ int DataManager::SetValue(const string varName, string value, int persist /* = 0

if (pos->second.second != 0)
SaveValues();

gui_notifyVarChange(varName.c_str(), value.c_str());
return 0;
}
Expand Down Expand Up @@ -842,8 +841,7 @@ void DataManager::Output_Version(void) {
}
Path += "/TWRP/.version";
if (TWFunc::Path_Exists(Path)) {
Command = "rm -f " + Path;
system(Command.c_str());
unlink(Path.c_str());
}
FILE *fp = fopen(Path.c_str(), "w");
if (fp == NULL) {
Expand Down
59 changes: 59 additions & 0 deletions dosfstools/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
ifneq ($(TARGET_SIMULATOR),true)
LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)
LOCAL_SRC_FILES := src/boot.c src/check.c src/common.c \
src/fat.c src/file.c src/io.c src/lfn.c src/dosfsck.c
LOCAL_C_INCLUDES := $(KERNEL_HEADERS)
LOCAL_SHARED_LIBRARIES := libc
LOCAL_CFLAGS += -D_USING_BIONIC_
LOCAL_CFLAGS += -DUSE_ANDROID_RETVALS
LOCAL_MODULE = dosfsck
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
include $(BUILD_EXECUTABLE)

# build symlink
SYMLINKS := $(addprefix $(TARGET_OUT)/bin/,fsck_msdos)
$(SYMLINKS): DOSFSCK_BINARY := $(LOCAL_MODULE)
$(SYMLINKS): $(LOCAL_INSTALLED_MODULE) $(LOCAL_PATH)/Android.mk
@echo "Symlink: $@ -> $(DOSFSCK_BINARY)"
@mkdir -p $(dir $@)
@rm -rf $@
$(hide) ln -sf $(DOSFSCK_BINARY) $@

ALL_DEFAULT_INSTALLED_MODULES += $(SYMLINKS)

# We need this so that the installed files could be picked up based on the
# local module name
ALL_MODULES.$(LOCAL_MODULE).INSTALLED := \
$(ALL_MODULES.$(LOCAL_MODULE).INSTALLED) $(SYMLINKS)



include $(CLEAR_VARS)
LOCAL_SRC_FILES := src/boot.c src/check.c src/common.c src/fat.c \
src/file.c src/io.c src/lfn.c src/dosfslabel.c
LOCAL_C_INCLUDES := $(KERNEL_HEADERS) \
bionic/libc/kernel/common
LOCAL_SHARED_LIBRARIES := libc
LOCAL_CFLAGS += -D_USING_BIONIC_
LOCAL_MODULE = dosfslabel
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
include $(BUILD_EXECUTABLE)

include $(CLEAR_VARS)
LOCAL_SRC_FILES := src/mkdosfs.c
LOCAL_C_INCLUDES := $(KERNEL_HEADERS)
LOCAL_SHARED_LIBRARIES := libc
LOCAL_CFLAGS += -D_USING_BIONIC_
LOCAL_MODULE = mkdosfs
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
include $(BUILD_EXECUTABLE)

endif
Loading

0 comments on commit 9c75405

Please sign in to comment.