Remove fs_get_stats.

This was only used by the tarball-building support that was removed
in 2019.

Test: treehugger
Change-Id: I719364699d426d21010c3ab913d12f15128f2538
This commit is contained in:
Elliott Hughes 2024-03-14 15:29:48 +00:00
parent 40922cb75b
commit b904c27e12
3 changed files with 1 additions and 82 deletions

View file

@ -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

View file

@ -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",
],
}

View file

@ -1,67 +0,0 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <private/android_filesystem_config.h>
#include <private/fs_config.h>
#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;
}