From b904c27e12928583cf4a47a2b71ec04e9d35a4fc Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 14 Mar 2024 15:29:48 +0000 Subject: [PATCH] Remove fs_get_stats. This was only used by the tarball-building support that was removed in 2019. Test: treehugger Change-Id: I719364699d426d21010c3ab913d12f15128f2538 --- core/config.mk | 2 +- tools/fs_get_stats/Android.bp | 14 ------- tools/fs_get_stats/fs_get_stats.c | 67 ------------------------------- 3 files changed, 1 insertion(+), 82 deletions(-) delete mode 100644 tools/fs_get_stats/Android.bp delete mode 100644 tools/fs_get_stats/fs_get_stats.c diff --git a/core/config.mk b/core/config.mk index dbee0a07a3..1c4a10f100 100644 --- a/core/config.mk +++ b/core/config.mk @@ -172,6 +172,7 @@ $(KATI_obsolete_var PRODUCT_VERITY_SIGNING_KEY,VB 1.0 and related variables are $(KATI_obsolete_var BOARD_PREBUILT_PVMFWIMAGE,pvmfw.bin is now built in AOSP and custom versions are no longer supported) $(KATI_obsolete_var BUILDING_PVMFW_IMAGE,BUILDING_PVMFW_IMAGE is no longer used) $(KATI_obsolete_var BOARD_BUILD_SYSTEM_ROOT_IMAGE) +$(KATI_obsolete_var FS_GET_STATS) # Used to force goals to build. Only use for conditionally defined goals. .PHONY: FORCE @@ -690,7 +691,6 @@ else AVBTOOL := $(BOARD_CUSTOM_AVBTOOL) endif APICHECK := $(HOST_OUT_JAVA_LIBRARIES)/metalava$(COMMON_JAVA_PACKAGE_SUFFIX) -FS_GET_STATS := $(HOST_OUT_EXECUTABLES)/fs_get_stats$(HOST_EXECUTABLE_SUFFIX) MKEXTUSERIMG := $(HOST_OUT_EXECUTABLES)/mkuserimg_mke2fs MKE2FS_CONF := system/extras/ext4_utils/mke2fs.conf MKEROFS := $(HOST_OUT_EXECUTABLES)/mkfs.erofs diff --git a/tools/fs_get_stats/Android.bp b/tools/fs_get_stats/Android.bp deleted file mode 100644 index 0697999090..0000000000 --- a/tools/fs_get_stats/Android.bp +++ /dev/null @@ -1,14 +0,0 @@ -package { - // See: http://go/android-license-faq - default_applicable_licenses: ["Android-Apache-2.0"], -} - -cc_binary_host { - name: "fs_get_stats", - srcs: ["fs_get_stats.c"], - cflags: ["-Wall", "-Werror"], - shared_libs: [ - "libcutils", - "liblog", - ], -} diff --git a/tools/fs_get_stats/fs_get_stats.c b/tools/fs_get_stats/fs_get_stats.c deleted file mode 100644 index 64ef0e2312..0000000000 --- a/tools/fs_get_stats/fs_get_stats.c +++ /dev/null @@ -1,67 +0,0 @@ -#include -#include -#include -#include - -#include -#include - -#define DO_DEBUG 1 - -#define ERROR(fmt,args...) \ - do { \ - fprintf(stderr, "%s:%d: ERROR: " fmt, \ - __FILE__, __LINE__, ##args); \ - } while (0) - -#if DO_DEBUG -#define DEBUG(fmt,args...) \ - do { fprintf(stderr, "DEBUG: " fmt, ##args); } while(0) -#else -#define DEBUG(x...) do {} while(0) -#endif - -void -print_help(void) -{ - fprintf(stderr, "fs_get_stats: retrieve the target file stats " - "for the specified file\n"); - fprintf(stderr, "usage: fs_get_stats cur_perms is_dir filename targetout\n"); - fprintf(stderr, "\tcur_perms - The current permissions of " - "the file\n"); - fprintf(stderr, "\tis_dir - Is filename is a dir, 1. Otherwise, 0.\n"); - fprintf(stderr, "\tfilename - The filename to lookup\n"); - fprintf(stderr, "\ttargetout - The target out path to query device specific FS configs\n"); - fprintf(stderr, "\n"); -} - -int -main(int argc, const char *argv[]) -{ - char *endptr; - char is_dir = 0; - unsigned perms = 0; - unsigned uid = (unsigned)-1; - unsigned gid = (unsigned)-1; - - if (argc < 5) { - ERROR("Invalid arguments\n"); - print_help(); - exit(-1); - } - - perms = (unsigned)strtoul(argv[1], &endptr, 0); - if (!endptr || (endptr == argv[1]) || (*endptr != '\0')) { - ERROR("current permissions must be a number. Got '%s'.\n", argv[1]); - exit(-1); - } - - if (!strcmp(argv[2], "1")) - is_dir = 1; - - uint64_t capabilities; - fs_config(argv[3], is_dir, argv[4], &uid, &gid, &perms, &capabilities); - fprintf(stdout, "%d %d 0%o\n", uid, gid, perms); - - return 0; -}