Introduce dump_chip_info module
Introduce dump_chip_info dumper to dump driver information of chip-info and required sepolicy. [ 9819.206787][ T335] type=1400 audit(1729750876.372:4710): avc: denied { execute_no_trans } for comm="android.hardwar" path="/vendor/bin/dump/dump_chip_info" dev="dm-11" ino=79 scontext=u:r:hal_dumpstate_default:s0 tcontext=u:object_r:vendor_file:s0 tclass=file permissive=1 [ 9819.231374][ T335] type=1400 audit(1729750876.384:4711): avc: denied { getattr } for comm="dump_chip_info" path="pipe:[1038881]" dev="pipefs" ino=1038881 scontext=u:r:hal_dumpstate_default:s0 tcontext=u:r:shell:s0 tclass=fifo_file permissive=1 Flag: EXEMPT, change source of chipid Bug: 298883728 Change-Id: I0ff6edf98548de4b93c9eeee005ab2e7b365cf7f
This commit is contained in:
parent
dc6f3713ce
commit
0a17acae18
7 changed files with 55 additions and 0 deletions
20
dump_chip_info/Android.bp
Normal file
20
dump_chip_info/Android.bp
Normal file
|
@ -0,0 +1,20 @@
|
|||
package {
|
||||
default_applicable_licenses: ["Android-Apache-2.0"],
|
||||
}
|
||||
|
||||
cc_binary {
|
||||
name: "dump_chip_info",
|
||||
srcs: ["dump_chip_info.cpp"],
|
||||
cflags: [
|
||||
"-Wall",
|
||||
"-Wextra",
|
||||
"-Werror",
|
||||
],
|
||||
shared_libs: [
|
||||
"libbase",
|
||||
"libdump",
|
||||
"liblog",
|
||||
],
|
||||
vendor: true,
|
||||
relative_install_path: "dump",
|
||||
}
|
3
dump_chip_info/chip_info.mk
Normal file
3
dump_chip_info/chip_info.mk
Normal file
|
@ -0,0 +1,3 @@
|
|||
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/dump_chip_info/sepolicy
|
||||
|
||||
PRODUCT_PACKAGES += dump_chip_info
|
24
dump_chip_info/dump_chip_info.cpp
Normal file
24
dump_chip_info/dump_chip_info.cpp
Normal file
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* Copyright 2024 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 <dump/pixel_dump.h>
|
||||
#include <android-base/file.h>
|
||||
|
||||
int main() {
|
||||
dumpFileContent("ap_rom_patch_ver", "/sys/devices/system/goog-chip-info/ap_rom_patch_ver");
|
||||
dumpFileContent("gpcm_asic_id", "/sys/devices/system/goog-chip-info/gpcm_asic_id");
|
||||
|
||||
return 0;
|
||||
}
|
3
dump_chip_info/sepolicy/dump_chip_info.te
Normal file
3
dump_chip_info/sepolicy/dump_chip_info.te
Normal file
|
@ -0,0 +1,3 @@
|
|||
#
|
||||
pixel_bugreport(dump_chip_info)
|
||||
allow dump_chip_info sysfs_chip_info:file r_file_perms;
|
2
dump_chip_info/sepolicy/file.te
Normal file
2
dump_chip_info/sepolicy/file.te
Normal file
|
@ -0,0 +1,2 @@
|
|||
#
|
||||
type sysfs_chip_info, sysfs_type, fs_type;
|
1
dump_chip_info/sepolicy/file_contexts
Normal file
1
dump_chip_info/sepolicy/file_contexts
Normal file
|
@ -0,0 +1 @@
|
|||
/vendor/bin/dump/dump_chip_info u:object_r:dump_chip_info_exec:s0
|
2
dump_chip_info/sepolicy/genfs_contexts
Normal file
2
dump_chip_info/sepolicy/genfs_contexts
Normal file
|
@ -0,0 +1,2 @@
|
|||
genfscon sysfs /devices/system/goog-chip-info/ap_rom_patch_ver u:object_r:sysfs_chip_info:s0
|
||||
genfscon sysfs /devices/system/goog-chip-info/gpcm_asic_id u:object_r:sysfs_chip_info:s0
|
Loading…
Add table
Add a link
Reference in a new issue