1/*
2 * Copyright (c) 2007 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23/*
24 * FILE: bootroot_internal.h
25 * AUTH: Soren Spies (sspies)
26 * DATE: 8 June 2006 (as update_boot.h)
27 * DESC: routines for implementing 'kextcache -u' functionality (4252674)
28 *       in which bootcaches.plist files get copied to any Apple_Boots
29 */
30
31#ifndef _BOOTROOT_INTERNAL_H_
32#define _BOOTROOT_INTERNAL_H_
33
34#include <CoreFoundation/CoreFoundation.h>
35
36#include "bootroot.h"
37
38// internal options for "update" operations
39typedef enum {
40    // BROptsNone          = 0x0,       // in bootroot.h
41
42    // command-line options
43    kBRUForceUpdateHelpers = 1 << 0,    // -f: ignore bootstamps, update helpers
44
45    kBRUCachesOnly         = 1 << 1,    // -caches-only: don't update helpers
46    kBRUHelpersOptional    = 1 << 2,    // -Installer: helper updates !req'd
47    kBRUExpectUpToDate     = 1 << 3,    // -U: successful updates -> EX_OSFILE
48    kBRUEarlyBoot          = 1 << 4,    // -Boot: launch* calling us
49
50    kBRUInvalidateKextcache = 1 << 5,   // -i: mimic sudo touch /S/L/Extensions
51
52    // needUpdates() opt (default is all caches, default-bootable)
53    kBRUCachesAnyRoot       = 1 << 6,   // non-default B!=R configs okay
54
55    // copy files opts
56    // kBRAnyBootStamps = 0x10000 (1<<16) // in bootroot.h
57} BRUpdateOpts_t;
58
59// in update_boot.c
60
61/*
62 * Update all caches and any helper partitions (kextcache -u).
63 * Except when kForceUpdateHelpers is specified, unrecognized
64 * bootcaches.plist causes immediate success.
65 */
66int checkUpdateCachesAndBoots(CFURLRef volumeURL, BRUpdateOpts_t flags);
67
68// "put" and "take" let routines decide if a lock is needed (e.g. if no kextd)
69// Only used by volume lockers (kextcache, libBootRoot clients, !kextd)
70int takeVolumeForPath(const char *volPath);
71int putVolumeForPath(const char *path, int status);
72
73#endif  // _BOOTROOT_INTERNAL_H_
74