1/* 2 * Copyright (c) 2008 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: bootfiles.h 25 * AUTH: Soren Spies (sspies) 26 * DATE: 22 March 2006 (Copyright Apple Computer, Inc) 27 * DESC: constants for boot caches 28 */ 29 30#ifndef __BOOTFILES_H__ 31#define __BOOTFILES_H__ 32 33#include <paths.h> 34 35/* Boot != Root directories in Apple_Boot */ 36#define kBootDirR "com.apple.boot.R" 37#define kBootDirP "com.apple.boot.P" 38#define kBootDirS "com.apple.boot.S" 39 40/* Boot != Root key for firmware's /chosen */ 41#define kBootRootActiveKey "bootroot-active" 42 43/* Recovery OS directory in Apple_Boot */ 44#define kRecoveryBootDir "com.apple.recovery.boot" 45 46/* Recovery boot hints */ 47 48/* With minor exceptions for things like reanimation, efiboot will 49 bypass primary OS booting in favor of executing the booter from 50 com.apple.recovery.boot any time the NVRAM variable recovery-boot-mode 51 is set to any value. The Recovery OS is generally responsible for 52 interpreting these values and unsetting the variable as appropriate. 53 See comments for each value as to which components set which values. 54*/ 55#define kRecoveryBootVar "recovery-boot-mode" // how to boot Recovery 56 57/* Recovery-based Guest Mode is used on FDE systems. 58 Set by: any login panel (EFI, OS, or screen lock) when "guest" is selected 59 Cleared by: Recovery OS (which component?), presumably on entry 60 61 Guest mode can be enabled in Users & Groups, but is also implicitly 62 enabled by Find My Mac (FMM). FMM needs guest mode so that people who 63 find FDE machines can get them online to receive "good samaritan," 64 "lock," and "wipe" messages. Guest mode is restrictive and generally 65 only allows connecting to networks and running Safari. 66*/ 67#define kRecoveryBootModeGuest "guest" // guest boot (usu. once) 68 69/* Locked mode is used by Find My Mac to restrict access to a machine. 70 Set by: Find My Mac 71 Cleared by: Find My Mac only with the locking user's authorization. 72 73 When Find My Mac receives a remote message to lock the computer, FMM 74 sets this variable and reboots. The Recovery OS enters a highly 75 restrictive mode which only displays a prompt for a PIN code. This 76 variable is only unset when the original user unlocks FMM. 77*/ 78#define kRecoveryBootModeLocked "locked" // system is FMM-locked 79 80/* FDE password reset mode helps users reset their passwords. 81 Set by: efiboot 82 Cleared by: Recovery OS on entry 83 84 If a user has trouble remembering their password, they can click on 85 "reset my password using iCloud" at EFI Login. efiboot then sets this 86 variable and boots the Recovery OS, which takes the user directly to 87 a "reset password" panel. 88*/ 89#define kRecoveryBootModeFDEPasswordReset "fde-password-reset" // forgot 90 91/* FDE Recovery mode helps solve EFI Login issues 92 Set by: efiboot 93 Cleared by: Recovery OS on entry 94 95 Users having trouble entering passwords at EFI Login can force power 96 off while an "if you are having trouble" message is showing. efiboot 97 will notice that the message was visible when power was forced off and 98 the next power-on will go to the Recovery OS with the variable set to 99 this value. The Recovery OS then guides the user towards a password 100 change or disabling FDE. The latter accomodates those with with 101 hardware or software issues that prevent them from using FDE. 102*/ 103#define kRecoveryBootModeFDERecovery "fde-recovery" // help! 104 105/* A generic mode is defined, but has not yet been meaningfully used. */ 106// #define kRecoveryBootModeGeneric "generic" 107#define kRcevoeryBootModeRecovery "unused" 108 109 110/* The kernel */ 111#define kDefaultKernelPath "/System/Library/Kernels/kernel" 112#define kDefaultKernel "/mach_kernel" 113#define kKernelSymfile (_PATH_VARRUN "mach.sym") 114// kKernelSymfile obsolete, remove when load.c deleted 115 116/* The system extensions folder */ 117#define kSystemExtensionsDir "/System/Library/Extensions" 118/* The library extensions folder */ 119#define kLibraryExtensionsDir "/Library/Extensions" 120 121 122/* The booter configuration file */ 123#define kBootConfig "/Library/Preferences/SystemConfiguration/com.apple.Boot.plist" 124#define kKernelFlagsKey "Kernel Flags" 125#define kMKextCacheKey "MKext Cache" 126#define kKernelNameKey "Kernel" 127#define kKernelCacheKey "Kernel Cache" 128#define kRootUUIDKey "Root UUID" 129#define kRootMatchKey "Root Match" 130 131#endif /* __BOOTFILES_H__ */ 132