mirror of
https://github.com/kdave/btrfs-progs
synced 2025-04-16 20:15:20 +00:00
btrfs-progs: build: remove incomplete android support
There is a support to build on android but it's incomplete and there's little interest to fix it. To reinstate we'll need: * fix remaining issues from lore.kernel.org/linux-btrfs/20170802185111.187922-1-filipbystricky@google.com * find CI host with Android support to verify build, either local eg. in docker or in a hosted environment * switch the make-based build to 'soong' (source.android.com/setup/build) Issue: #357 Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
7fa07e2abb
commit
51f15d393a
119
Android.mk
119
Android.mk
@ -1,119 +0,0 @@
|
|||||||
LOCAL_PATH:= $(call my-dir)
|
|
||||||
|
|
||||||
#include $(call all-subdir-makefiles)
|
|
||||||
|
|
||||||
CFLAGS := -g -O1 -Wall -D_FORTIFY_SOURCE=2 -include config.h \
|
|
||||||
-DBTRFS_FLAT_INCLUDES -D_XOPEN_SOURCE=700 -fno-strict-aliasing -fPIC
|
|
||||||
|
|
||||||
LDFLAGS := -static -rdynamic
|
|
||||||
|
|
||||||
LIBS := -luuid -lblkid -lz -llzo2 -L. -lpthread
|
|
||||||
LIBBTRFS_LIBS := $(LIBS)
|
|
||||||
|
|
||||||
STATIC_CFLAGS := $(CFLAGS) -ffunction-sections -fdata-sections
|
|
||||||
STATIC_LDFLAGS := -static -Wl,--gc-sections
|
|
||||||
STATIC_LIBS := -luuid -lblkid -luuid -lz -llzo2 -L. -pthread
|
|
||||||
|
|
||||||
btrfs_shared_libraries := libext2_uuid \
|
|
||||||
libext2_blkid
|
|
||||||
|
|
||||||
objects := kernel-shared/ctree.c kernel-shared/disk-io.c kernel-lib/radix-tree.c \
|
|
||||||
kernel-shared/extent-tree.c kernel-shared/print-tree.c \
|
|
||||||
root-tree.c dir-item.c file-item.c inode-item.c inode-map.c \
|
|
||||||
common/extent-cache.c kernel-shared/extent_io.c kernel-shared/volumes.c utils.c repair.c \
|
|
||||||
qgroup.c kernel-shared/free-space-cache.c kernel-lib/list_sort.c props.c \
|
|
||||||
kernel-shared/ulist.c qgroup-verify.c backref.c common/string-table.c task-utils.c \
|
|
||||||
kernel-shared/inode.c kernel-shared/file.c \
|
|
||||||
free-space-tree.c help.c cmds/receive-dump.c \
|
|
||||||
common/fsfeatures.c kernel-lib/tables.c kernel-lib/raid56.c kernel-shared/transaction.c
|
|
||||||
cmds_objects := cmds-subvolume.c cmds-filesystem.c cmds-device.c cmds-scrub.c \
|
|
||||||
cmds-inspect.c cmds-balance.c cmds-send.c cmds-receive.c \
|
|
||||||
cmds-quota.c cmds-qgroup.c cmds-replace.c cmds-check.c \
|
|
||||||
cmds-restore.c cmds-rescue.c chunk-recover.c super-recover.c \
|
|
||||||
cmds-property.c cmds-fi-usage.c cmds-inspect-dump-tree.c \
|
|
||||||
cmds-inspect-dump-super.c cmds-inspect-tree-stats.c cmds-fi-du.c \
|
|
||||||
mkfs/common.c
|
|
||||||
libbtrfs_objects := common/send-stream.c common/send-utils.c kernel-lib/rbtree.c btrfs-list.c \
|
|
||||||
crypto/crc32c.c messages.c \
|
|
||||||
uuid-tree.c common/utils-lib.c rbtree-utils.c
|
|
||||||
libbtrfs_headers := common/send-stream.h common/send-utils.h send.h kernel-lib/rbtree.h btrfs-list.h \
|
|
||||||
crypto/crc32c.h kernel-lib/list.h kerncompat.h \
|
|
||||||
kernel-lib/radix-tree.h kernel-lib/sizes.h kernel-lib/raid56.h \
|
|
||||||
common/extent-cache.h kernel-shared/extent_io.h ioctl.h \
|
|
||||||
kernel-shared/ctree.h btrfsck.h version.h
|
|
||||||
blkid_objects := partition/ superblocks/ topology/
|
|
||||||
|
|
||||||
|
|
||||||
# external/e2fsprogs/lib is needed for uuid/uuid.h
|
|
||||||
common_C_INCLUDES := $(LOCAL_PATH) external/e2fsprogs/lib/ external/lzo/include/ external/zlib/
|
|
||||||
|
|
||||||
#----------------------------------------------------------
|
|
||||||
include $(CLEAR_VARS)
|
|
||||||
LOCAL_SRC_FILES := $(libbtrfs_objects)
|
|
||||||
LOCAL_CFLAGS := $(STATIC_CFLAGS)
|
|
||||||
LOCAL_MODULE := libbtrfs
|
|
||||||
LOCAL_C_INCLUDES := $(common_C_INCLUDES)
|
|
||||||
include $(BUILD_STATIC_LIBRARY)
|
|
||||||
|
|
||||||
#----------------------------------------------------------
|
|
||||||
include $(CLEAR_VARS)
|
|
||||||
LOCAL_MODULE := btrfs
|
|
||||||
#LOCAL_FORCE_STATIC_EXECUTABLE := true
|
|
||||||
LOCAL_SRC_FILES := \
|
|
||||||
$(objects) \
|
|
||||||
$(cmds_objects) \
|
|
||||||
btrfs.c \
|
|
||||||
help.c \
|
|
||||||
|
|
||||||
LOCAL_C_INCLUDES := $(common_C_INCLUDES)
|
|
||||||
LOCAL_CFLAGS := $(STATIC_CFLAGS)
|
|
||||||
#LOCAL_LDLIBS := $(LIBBTRFS_LIBS)
|
|
||||||
#LOCAL_LDFLAGS := $(STATIC_LDFLAGS)
|
|
||||||
LOCAL_SHARED_LIBRARIES := $(btrfs_shared_libraries)
|
|
||||||
LOCAL_STATIC_LIBRARIES := libbtrfs liblzo-static libz
|
|
||||||
LOCAL_SYSTEM_SHARED_LIBRARIES := libc libcutils
|
|
||||||
|
|
||||||
LOCAL_EXPORT_C_INCLUDES := $(common_C_INCLUDES)
|
|
||||||
#LOCAL_MODULE_TAGS := optional
|
|
||||||
include $(BUILD_EXECUTABLE)
|
|
||||||
|
|
||||||
#----------------------------------------------------------
|
|
||||||
include $(CLEAR_VARS)
|
|
||||||
LOCAL_MODULE := mkfs.btrfs
|
|
||||||
LOCAL_SRC_FILES := \
|
|
||||||
$(objects) \
|
|
||||||
mkfs/common.c \
|
|
||||||
mkfs/main.c
|
|
||||||
|
|
||||||
LOCAL_C_INCLUDES := $(common_C_INCLUDES)
|
|
||||||
LOCAL_CFLAGS := $(STATIC_CFLAGS)
|
|
||||||
#LOCAL_LDLIBS := $(LIBBTRFS_LIBS)
|
|
||||||
#LOCAL_LDFLAGS := $(STATIC_LDFLAGS)
|
|
||||||
LOCAL_SHARED_LIBRARIES := $(btrfs_shared_libraries)
|
|
||||||
LOCAL_STATIC_LIBRARIES := libbtrfs liblzo-static
|
|
||||||
LOCAL_SYSTEM_SHARED_LIBRARIES := libc libcutils
|
|
||||||
|
|
||||||
LOCAL_EXPORT_C_INCLUDES := $(common_C_INCLUDES)
|
|
||||||
#LOCAL_MODULE_TAGS := optional
|
|
||||||
include $(BUILD_EXECUTABLE)
|
|
||||||
|
|
||||||
#---------------------------------------------------------------
|
|
||||||
include $(CLEAR_VARS)
|
|
||||||
LOCAL_MODULE := btrfstune
|
|
||||||
LOCAL_SRC_FILES := \
|
|
||||||
$(objects) \
|
|
||||||
btrfstune.c
|
|
||||||
|
|
||||||
LOCAL_C_INCLUDES := $(common_C_INCLUDES)
|
|
||||||
LOCAL_CFLAGS := $(STATIC_CFLAGS)
|
|
||||||
LOCAL_SHARED_LIBRARIES := $(btrfs_shared_libraries)
|
|
||||||
#LOCAL_LDLIBS := $(LIBBTRFS_LIBS)
|
|
||||||
#LOCAL_LDFLAGS := $(STATIC_LDFLAGS)
|
|
||||||
LOCAL_SHARED_LIBRARIES := $(btrfs_shared_libraries)
|
|
||||||
LOCAL_STATIC_LIBRARIES := libbtrfs liblzo-static
|
|
||||||
LOCAL_SYSTEM_SHARED_LIBRARIES := libc libcutils
|
|
||||||
|
|
||||||
LOCAL_EXPORT_C_INCLUDES := $(common_C_INCLUDES)
|
|
||||||
LOCAL_MODULE_TAGS := optional
|
|
||||||
include $(BUILD_EXECUTABLE)
|
|
||||||
#--------------------------------------------------------------
|
|
@ -1,28 +0,0 @@
|
|||||||
/*
|
|
||||||
* Compatibility layer for Android.
|
|
||||||
*
|
|
||||||
* Stub calls or alternate functions for pthreads.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __ANDROID_H__
|
|
||||||
#define __ANDROID_H__
|
|
||||||
|
|
||||||
#ifdef ANDROID
|
|
||||||
|
|
||||||
#define pthread_setcanceltype(type, oldtype) (0)
|
|
||||||
#define pthread_setcancelstate(state, oldstate) (0)
|
|
||||||
|
|
||||||
#define pthread_cancel(ret) pthread_kill((ret), SIGUSR1)
|
|
||||||
|
|
||||||
typedef struct blkid_struct_probe *blkid_probe;
|
|
||||||
|
|
||||||
#include <dirent.h>
|
|
||||||
#define direct dirent
|
|
||||||
|
|
||||||
#else /* !ANDROID */
|
|
||||||
|
|
||||||
#include <sys/dir.h>
|
|
||||||
|
|
||||||
#endif /* !ANDROID */
|
|
||||||
|
|
||||||
#endif /* __ANDROID_H__ */
|
|
@ -17,7 +17,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "kerncompat.h"
|
#include "kerncompat.h"
|
||||||
#include "androidcompat.h"
|
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "kerncompat.h"
|
#include "kerncompat.h"
|
||||||
#include "androidcompat.h"
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdio_ext.h>
|
#include <stdio_ext.h>
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "kerncompat.h"
|
#include "kerncompat.h"
|
||||||
#include "androidcompat.h"
|
|
||||||
|
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
|
@ -17,14 +17,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "kerncompat.h"
|
#include "kerncompat.h"
|
||||||
#include "androidcompat.h"
|
|
||||||
|
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <sys/mount.h>
|
#include <sys/mount.h>
|
||||||
#include "ioctl.h"
|
#include "ioctl.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
/* #include <sys/dir.h> included via androidcompat.h */
|
#include <dirent.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "kerncompat.h"
|
#include "kerncompat.h"
|
||||||
#include "androidcompat.h"
|
|
||||||
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -156,7 +155,7 @@ static int fill_inode_item(struct btrfs_trans_handle *trans,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int directory_select(const struct direct *entry)
|
static int directory_select(const struct dirent *entry)
|
||||||
{
|
{
|
||||||
if (entry->d_name[0] == '.' &&
|
if (entry->d_name[0] == '.' &&
|
||||||
(entry->d_name[1] == 0 ||
|
(entry->d_name[1] == 0 ||
|
||||||
@ -165,7 +164,7 @@ static int directory_select(const struct direct *entry)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void free_namelist(struct direct **files, int count)
|
static void free_namelist(struct dirent **files, int count)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -180,7 +179,7 @@ static void free_namelist(struct direct **files, int count)
|
|||||||
static u64 calculate_dir_inode_size(const char *dirname)
|
static u64 calculate_dir_inode_size(const char *dirname)
|
||||||
{
|
{
|
||||||
int count, i;
|
int count, i;
|
||||||
struct direct **files, *cur_file;
|
struct dirent **files, *cur_file;
|
||||||
u64 dir_inode_size = 0;
|
u64 dir_inode_size = 0;
|
||||||
|
|
||||||
count = scandir(dirname, &files, directory_select, NULL);
|
count = scandir(dirname, &files, directory_select, NULL);
|
||||||
@ -445,10 +444,10 @@ static int traverse_directory(struct btrfs_trans_handle *trans,
|
|||||||
struct btrfs_inode_item cur_inode;
|
struct btrfs_inode_item cur_inode;
|
||||||
struct btrfs_inode_item *inode_item;
|
struct btrfs_inode_item *inode_item;
|
||||||
int count, i, dir_index_cnt;
|
int count, i, dir_index_cnt;
|
||||||
struct direct **files;
|
struct dirent **files;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
struct directory_name_entry *dir_entry, *parent_dir_entry;
|
struct directory_name_entry *dir_entry, *parent_dir_entry;
|
||||||
struct direct *cur_file;
|
struct dirent *cur_file;
|
||||||
ino_t parent_inum, cur_inum;
|
ino_t parent_inum, cur_inum;
|
||||||
ino_t highest_inum = 0;
|
ino_t highest_inum = 0;
|
||||||
const char *parent_dir_name;
|
const char *parent_dir_name;
|
||||||
|
Loading…
Reference in New Issue
Block a user