diff --git a/Makefile b/Makefile deleted file mode 100644 index cbd234f..0000000 --- a/Makefile +++ /dev/null @@ -1,237 +0,0 @@ -CC=gcc -I. -DANDROID -AR=ar -RM=rm -ECHO=echo -CFLAGS=-DHOST -Icore/include -Icore/libsparse/include -Icore/libsparse -Ilibselinux/include -Icore/mkbootimg -LDFLAGS=-L. -LIBS=-lz -LIBZ=-lsparse_host -lselinux -SELINUX_SRCS= \ - libselinux/src/booleans.c \ - libselinux/src/canonicalize_context.c \ - libselinux/src/disable.c \ - libselinux/src/enabled.c \ - libselinux/src/fgetfilecon.c \ - libselinux/src/fsetfilecon.c \ - libselinux/src/getenforce.c \ - libselinux/src/getfilecon.c \ - libselinux/src/getpeercon.c \ - libselinux/src/lgetfilecon.c \ - libselinux/src/load_policy.c \ - libselinux/src/lsetfilecon.c \ - libselinux/src/policyvers.c \ - libselinux/src/procattr.c \ - libselinux/src/setenforce.c \ - libselinux/src/setfilecon.c \ - libselinux/src/context.c \ - libselinux/src/mapping.c \ - libselinux/src/stringrep.c \ - libselinux/src/compute_create.c \ - libselinux/src/compute_av.c \ - libselinux/src/avc.c \ - libselinux/src/avc_internal.c \ - libselinux/src/avc_sidtab.c \ - libselinux/src/get_initial_context.c \ - libselinux/src/checkAccess.c -SELINUX_HOST= \ - libselinux/src/callbacks.c \ - libselinux/src/check_context.c \ - libselinux/src/freecon.c \ - libselinux/src/init.c \ - libselinux/src/label.c \ - libselinux/src/label_file.c \ - libselinux/src/label_android_property.c -SELINUX_OBJS= \ - enabled.o \ - load_policy.o \ - avc_internal.o \ - fgetfilecon.o \ - lsetfilecon.o \ - avc.o \ - fsetfilecon.o \ - freecon.o \ - avc_sidtab.o \ - getenforce.o \ - mapping.o \ - booleans.o \ - getfilecon.o \ - callbacks.o \ - get_initial_context.o \ - policyvers.o \ - canonicalize_context.o \ - getpeercon.o \ - procattr.o \ - checkAccess.o \ - setenforce.o \ - check_context.o \ - init.o \ - setfilecon.o \ - compute_av.o \ - label_android_property.o \ - compute_create.o \ - label_file.o \ - stringrep.o \ - context.o \ - label.o \ - disable.o \ - lgetfilecon.o -ZLIB_SRCS= \ - zlib/src/adler32.c \ - zlib/src/compress.c \ - zlib/src/crc32.c \ - zlib/src/deflate.c \ - zlib/src/gzclose.c \ - zlib/src/gzlib.c \ - zlib/src/gzread.c \ - zlib/src/gzwrite.c \ - zlib/src/infback.c \ - zlib/src/inflate.c \ - zlib/src/inftrees.c \ - zlib/src/inffast.c \ - zlib/src/trees.c \ - zlib/src/uncompr.c \ - zlib/src/zutil.c -LIBMINCRYPT_SRCS= core/libmincrypt/*.c -LIBSPARSE_SRCS= \ - core/libsparse/backed_block.c \ - core/libsparse/output_file.c \ - core/libsparse/sparse.c \ - core/libsparse/sparse_crc32.c \ - core/libsparse/sparse_err.c \ - core/libsparse/sparse_read.c -EXT4FS_SRCS= \ - extras/ext4_utils/make_ext4fs.c \ - extras/ext4_utils/ext4fixup.c \ - extras/ext4_utils/ext4_utils.c \ - extras/ext4_utils/allocate.c \ - extras/ext4_utils/contents.c \ - extras/ext4_utils/extent.c \ - extras/ext4_utils/indirect.c \ - extras/ext4_utils/uuid.c \ - extras/ext4_utils/sha1.c \ - extras/ext4_utils/wipe.c \ - extras/ext4_utils/crc16.c - -all: \ - libselinux \ - libz \ - libmincrypt_host \ - mkbootimg \ - mkbootfs \ - libsparse_host \ - simg2img \ - simg2simg \ - img2simg \ - make_ext4fs \ - ext2simg \ - unpackbootimg \ - sgs4ext4fs - -.PHONY: libselinux - -libselinux: - @$(ECHO) "Building libselinux..." - @$(CC) -c $(SELINUX_SRCS) $(CFLAGS) $(SELINUX_HOST) - @$(AR) cqs $@.a $(SELINUX_OBJS) - @$(RM) -rfv *.o - @$(ECHO) "*******************************************" - -libz: - @$(ECHO) "Building zlib_host..." - @$(CC) -c $(ZLIB_SRCS) $(CFLAGS) - @$(AR) cqs $@.a *.o - @$(RM) -rf *.o - @$(ECHO) "*******************************************" - -libmincrypt_host: - @$(ECHO) "Building libmincrypt_host..." - @$(CC) -c $(LIBMINCRYPT_SRCS) $(CFLAGS) - @$(AR) cqs $@.a *.o - @$(RM) -rf *.o - @$(ECHO) "*******************************************" - -mkbootimg: - @$(ECHO) "Building mkbootimg..." - @$(CC) core/mkbootimg/mkbootimg.c -o $@ $(CFLAGS) $(LIBS) libmincrypt_host.a - @$(ECHO) "*******************************************" - -mkbootfs: - @$(ECHO) "Building mkbootfs..." - @$(CC) core/cpio/mkbootfs.c -o $@ $(CFLAGS) $(LIBS) - @$(ECHO) "*******************************************" - -libsparse_host: - @$(ECHO) "Building libsparse_host..." - @$(ECHO) "*******************************************" - @$(CC) -c core/libsparse/*.c $(CFLAGS) - @$(AR) -x libz.a - @$(AR) cqs $@.a *.o - @$(RM) -rf *.o - @$(ECHO) "*******************************************" - -simg2img: - @$(ECHO) "Building simg2img..." - @$(CC) core/libsparse/simg2img.c -o $@ $(LIBSPARSE_SRCS) $(CFLAGS) $(LIBS) - @$(ECHO) "*******************************************" - -simg2simg: - @$(ECHO) "Building simg2simg..." - @$(CC) core/libsparse/simg2simg.c -o $@ $(LIBSPARSE_SRCS) $(CFLAGS) $(LIBS) - @$(ECHO) "*******************************************" - -img2simg: - @$(ECHO) "Building img2simg..." - @$(CC) core/libsparse/img2simg.c -o $@ $(LIBSPARSE_SRCS) $(CFLAGS) $(LIBS) - @$(ECHO) "*******************************************" - -make_ext4fs: - @$(ECHO) "Building make_ext4fs..." - @$(CC) -o $@ extras/ext4_utils/make_ext4fs_main.c $(EXT4FS_SRCS) $(CFLAGS) $(LDFLAGS) $(LIBS) $(LIBZ) - @$(ECHO) "*******************************************" - -ext2simg: - @$(ECHO) "Building ext2simg..." - @$(CC) -o $@ extras/ext4_utils/ext2simg.c $(EXT4FS_SRCS) $(CFLAGS) $(LDFLAGS) $(LIBS) $(LIBZ) - @$(ECHO) "*******************************************" - -unpackbootimg: - @$(ECHO) "Building unpackbootimg..." - @$(CC) external/android_system_core/mkbootimg/unpackbootimg.c -o $@ $(CFLAGS) $(LIBS) libmincrypt_host.a - @$(RM) -rfv *.a - @$(ECHO) "*******************************************" - -sgs4ext4fs: - @$(ECHO) "Building sgs4ext4fs..." - @$(CC) external/sgs4ext4fs/main.c -o $@ - @$(ECHO) "*******************************************" - -.PHONY: - -clean: - @$(ECHO) "Cleaning..." - @$(RM) -rfv *.o *.a *.sh \ - libmincrypt \ - mkbootimg \ - mkbootfs \ - unpackbootimg \ - libsparse_host \ - simg2img \ - simg2simg \ - img2simg \ - make_ext4fs \ - ext2simg \ - sgs4ext4fs - - @$(ECHO) "*******************************************" - -.PHONY: - -clear: - @$(ECHO) "Clearing..." - @$(RM) -rfv *.o *.a - @$(RM) -drfv \ - core \ - extras \ - libselinux \ - zlib \ - external diff --git a/README.md b/README.md index 8bfcb64..b7e1472 100644 --- a/README.md +++ b/README.md @@ -3,30 +3,5 @@ android_img_repack_tools android_img_repack_tools is a kit utilites for unpack/repack android ext4 and boot images -how to make: - -$ ./configure - -will download source from android git repositories - -$ make - -will compille binaries: -mkbootfs -simg2simg -make_ext4fs -mkbootimg -sgs4ext4fs -unpackbootimg -ext2simg -img2simg -simg2img - -$ make clean - -will clean sources - -$ make clear - -will remove sources +for download choose any brunch diff --git a/configure b/configure deleted file mode 100644 index 45eba55..0000000 --- a/configure +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash -# -# configure script for android_img_repack_tools. -# -BRANCH= -BRANCH_EXT= -FILE=extras/ext4_utils/make_ext4fs.c -FILE1=extras/ext4_utils/mkuserimg.sh - -get_src() { - git clone $1 -} -checkout() { - git checkout $BRANCH -} -checkout_external() { - git checkout $BRANCH_EXT -} -edit_text() { - sed -i $1 $2 -} -mkdir external - -get_src https://android.googlesource.com/platform/system/core - cd core - checkout - cd .. -get_src https://android.googlesource.com/platform/system/extras - cd extras - checkout - cd .. -get_src https://android.googlesource.com/platform/external/libselinux - cd libselinux - checkout - cd .. -get_src https://android.googlesource.com/platform/external/zlib - cd zlib - checkout - cd ../external -get_src https://github.com/CyanogenMod/android_system_core.git - cd android_system_core - checkout_external - cd .. -get_src https://github.com/Chainfire/sgs4ext4fs - cd .. - -edit_text '/^/s:fs_config_func(dentries://fs_config_func(dentries:' $FILE -edit_text '/^/s:mode;:stat.st_mode;:' $FILE -edit_text '/^/s:uid;:stat.st_uid;:' $FILE -edit_text '/^/s:gid;:stat.st_gid;:' $FILE -edit_text '/^/s:root_stat.st_mode;:root_mode;:' $FILE -edit_text '/^/s:MAKE_EXT4FS_CMD="make_ext4fs:MAKE_EXT4FS_CMD="./make_ext4fs:' $FILE1 - cp -fv $FILE1 . - -echo -echo "for android.googlesource.com choosed branch $BRANCH..." -echo -echo "for Cyanogen Mod source choosed branch $BRANCH_EXT..." -echo