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:
Lucas Wei 2024-10-23 08:35:26 +00:00
parent dc6f3713ce
commit 0a17acae18
7 changed files with 55 additions and 0 deletions

View 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;
}