Add dummy vndk library libmkbootimg to enable abi checks on boot_img_hdr.
Bug: 74763691
Test: m -j libmkbootimg creates libmkbootimg.so.lsdump.
Test: make -j64
Change-Id: I8d716c560467aaf090f4f7ee9cfbc53a9405f05d
(cherry picked from commit 4cc755dce5
)
This commit is contained in:
parent
95a524460a
commit
478c7c1eaf
6 changed files with 101 additions and 18 deletions
|
@ -22,7 +22,8 @@ LOCAL_CFLAGS += -DFASTBOOT_VERSION="\"$(tool_version)\""
|
|||
|
||||
LOCAL_C_INCLUDES := \
|
||||
$(LOCAL_PATH)/../adb \
|
||||
$(LOCAL_PATH)/../mkbootimg \
|
||||
|
||||
LOCAL_HEADER_LIBRARIES := bootimg_headers
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
bootimg_utils.cpp \
|
||||
|
|
|
@ -127,9 +127,7 @@ cc_library_static {
|
|||
"watchdogd.cpp",
|
||||
],
|
||||
whole_static_libs: ["libcap"],
|
||||
include_dirs: [
|
||||
"system/core/mkbootimg",
|
||||
],
|
||||
header_libs: ["bootimg_headers"],
|
||||
proto: {
|
||||
type: "lite",
|
||||
export_proto_headers: true,
|
||||
|
|
32
mkbootimg/Android.bp
Normal file
32
mkbootimg/Android.bp
Normal file
|
@ -0,0 +1,32 @@
|
|||
// Copyright 2012 The Android Open Source Project
|
||||
|
||||
cc_library_headers {
|
||||
name: "libmkbootimg_abi_headers",
|
||||
vendor_available: true,
|
||||
export_include_dirs: ["include"],
|
||||
}
|
||||
|
||||
cc_library_headers {
|
||||
name: "bootimg_headers",
|
||||
vendor_available: true,
|
||||
export_include_dirs: ["include/bootimg"],
|
||||
host_supported: true,
|
||||
target: {
|
||||
windows: {
|
||||
enabled: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
cc_library {
|
||||
name: "libmkbootimg_abi_check",
|
||||
vendor_available: true,
|
||||
vndk: {
|
||||
enabled: true,
|
||||
},
|
||||
srcs: [
|
||||
"mkbootimg_dummy.cpp",
|
||||
],
|
||||
header_libs: ["libmkbootimg_abi_headers"],
|
||||
export_header_lib_headers: ["libmkbootimg_abi_headers"],
|
||||
}
|
28
mkbootimg/include/abi_check/mkbootimg_abi_check.h
Normal file
28
mkbootimg/include/abi_check/mkbootimg_abi_check.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* Copyright (C) 2018 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 <bootimg/bootimg.h>
|
||||
|
||||
// This header has been created for the following reaons:
|
||||
// 1) In order for a change in a user defined type to be classified as API /
|
||||
// ABI breaking, it needs to be referenced by an 'exported interface'
|
||||
// (in this case the function mkbootimg_dummy).
|
||||
// 2) Since 'mkbootimg_dummy' needs to be exported, we need to have it
|
||||
// exposed through a public header.
|
||||
// 3) It is desirable not to pollute bootimg.h with interfaces which are not
|
||||
// 'used' in reality by on device binaries. Furthermore, bootimg.h might
|
||||
// be exported by a library in the future, so we must avoid polluting it.
|
||||
void mkbootimg_dummy(boot_img_hdr*);
|
|
@ -2,16 +2,16 @@
|
|||
**
|
||||
** Copyright 2007, 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
|
||||
** 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
|
||||
** 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
|
||||
** 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.
|
||||
*/
|
||||
|
||||
|
@ -34,17 +34,17 @@
|
|||
struct boot_img_hdr_v0 {
|
||||
uint8_t magic[BOOT_MAGIC_SIZE];
|
||||
|
||||
uint32_t kernel_size; /* size in bytes */
|
||||
uint32_t kernel_addr; /* physical load addr */
|
||||
uint32_t kernel_size; /* size in bytes */
|
||||
uint32_t kernel_addr; /* physical load addr */
|
||||
|
||||
uint32_t ramdisk_size; /* size in bytes */
|
||||
uint32_t ramdisk_addr; /* physical load addr */
|
||||
|
||||
uint32_t second_size; /* size in bytes */
|
||||
uint32_t second_addr; /* physical load addr */
|
||||
uint32_t second_size; /* size in bytes */
|
||||
uint32_t second_addr; /* physical load addr */
|
||||
|
||||
uint32_t tags_addr; /* physical addr for kernel tags */
|
||||
uint32_t page_size; /* flash page size we assume */
|
||||
uint32_t tags_addr; /* physical addr for kernel tags */
|
||||
uint32_t page_size; /* flash page size we assume */
|
||||
/*
|
||||
* version for the boot image header.
|
||||
*/
|
24
mkbootimg/mkbootimg_dummy.cpp
Normal file
24
mkbootimg/mkbootimg_dummy.cpp
Normal file
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* Copyright (C) 2018 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 <abi_check/mkbootimg_abi_check.h>
|
||||
|
||||
void mkbootimg_dummy(boot_img_hdr* hdr) {
|
||||
// TODO: Hack to trigger abi checks, remove this.
|
||||
if (hdr) {
|
||||
hdr--;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue