1 /* 2 * Copyright (C) 2016 The Android Open Source Project 3 * 4 * Permission is hereby granted, free of charge, to any person 5 * obtaining a copy of this software and associated documentation 6 * files (the "Software"), to deal in the Software without 7 * restriction, including without limitation the rights to use, copy, 8 * modify, merge, publish, distribute, sublicense, and/or sell copies 9 * of the Software, and to permit persons to whom the Software is 10 * furnished to do so, subject to the following conditions: 11 * 12 * The above copyright notice and this permission notice shall be 13 * included in all copies or substantial portions of the Software. 14 * 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 * SOFTWARE. 23 */ 24 25 /* 26 #ifdef AVB_INSIDE_LIBAVB_H 27 #error "You can't include avb_sha.h in the public header libavb.h." 28 #endif 29 */ 30 31 /* 32 #ifndef AVB_COMPILATION 33 #error "Never include this file, it may only be used from internal avb code." 34 #endif 35 */ 36 37 #ifndef AVB_CMDLINE_H_ 38 #define AVB_CMDLINE_H_ 39 40 #include <android_avb/avb_ops.h> 41 #include <android_avb/avb_slot_verify.h> 42 43 /* Maximum allow length (in bytes) of a partition name, including 44 * ab_suffix. 45 */ 46 #define AVB_PART_NAME_MAX_SIZE 32 47 48 /* Substitutes all variables (e.g. $(ANDROID_SYSTEM_PARTUUID)) with 49 * values. Returns NULL on OOM, otherwise the cmdline with values 50 * replaced. 51 */ 52 char* avb_sub_cmdline(AvbOps* ops, const char* cmdline, const char* ab_suffix, 53 bool using_boot_for_vbmeta); 54 55 AvbSlotVerifyResult avb_append_options( 56 AvbOps* ops, 57 AvbSlotVerifyData* slot_data, 58 AvbVBMetaImageHeader* toplevel_vbmeta, 59 AvbAlgorithmType algorithm_type, 60 AvbHashtreeErrorMode hashtree_error_mode); 61 62 #endif 63