M7350v1_en_gpl

This commit is contained in:
T
2024-09-09 08:52:07 +00:00
commit f9cc65cfda
65988 changed files with 26357421 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
# Copyright (C) 2008 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := fs_config.c
LOCAL_MODULE := fs_config
LOCAL_FORCE_STATIC_EXECUTABLE := true
LOCAL_MODULE_TAGS := eng
include $(BUILD_HOST_EXECUTABLE)

View File

@@ -0,0 +1,16 @@
ACLOCAL_AMFLAGS = -I m4
AM_CPPFLAGS := \
-I. \
-I$(WORKSPACE)/system/core/include
c_sources := fs_config.c
bin_PROGRAMS := fs_config
fsconfig_SOURCES := $(c_sources)
fsconfig_CPPFLAGS := $(AM_CPPFLAGS)
fsconfig_LDFLAGS := -all-static

View File

@@ -0,0 +1,19 @@
AC_INIT([fsconfig-native],
1.0.0)
AM_INIT_AUTOMAKE([foreign])
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CPP
AC_SUBST([CUTILS_CFLAGS])
AC_SUBST([CUTILS_LIBS])
AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes")
AC_CONFIG_FILES([ \
Makefile \
])
AC_OUTPUT

View File

@@ -0,0 +1,69 @@
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <stdio.h>
#include <sys/stat.h>
#include <errno.h>
#include <unistd.h>
#include <string.h>
#include "private/android_filesystem_config.h"
// This program takes a list of files and directories (indicated by a
// trailing slash) on the stdin, and prints to stdout each input
// filename along with its desired uid, gid, and mode (in octal).
// The leading slash should be stripped from the input.
//
// Example input:
//
// system/etc/dbus.conf
// data/app/
//
// Output:
//
// system/etc/dbus.conf 1002 1002 440
// data/app 1000 1000 771
//
// Note that the output will omit the trailing slash from
// directories.
int main(int argc, char** argv) {
char buffer[1024];
while (fgets(buffer, 1023, stdin) != NULL) {
int is_dir = 0;
int i;
for (i = 0; i < 1024 && buffer[i]; ++i) {
switch (buffer[i]) {
case '\n':
buffer[i-is_dir] = '\0';
i = 1025;
break;
case '/':
is_dir = 1;
break;
default:
is_dir = 0;
break;
}
}
unsigned uid = 0, gid = 0, mode = 0;
fs_config(buffer, is_dir, &uid, &gid, &mode);
printf("%s %d %d %o\n", buffer, uid, gid, mode);
}
return 0;
}