-
Notifications
You must be signed in to change notification settings - Fork 9
/
README.txt
130 lines (66 loc) · 5.32 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
First Boot Package Install is an installer package that enables other packages to be installed at first boot. It's designed for use with createOSXinstallPkg with the goal of allowing installer packages that can't run in the OS X Install environment to be incorporated into a createOSXinstallPkg-using deployment workflow.
Usage
------
1. Download the First_Boot_Package_Install.zip file from the "installer" directory.
2. Once downloaded and unzipped, right-click on the package and choose "Show Package Contents".
3. Go to Contents: Resources: fb_installers
4. Add one installer package to each numbered directory. The number of the directory indicates the install order, with 00 being the first. As needed, more numbered directories may be added. For numbers 9 or less, make sure to label the directory with a leading zero (For example, 06).
NOTE: createOSXinstallPkg has an upper limit of 350 MBs of available space for added packages. This is sufficient space for basic configuration, payload-free or bootstrapping packages, but it's not a good idea to add Microsoft Office or similar large installers to this installer.
5. Once finished adding installers to the numbered directories, First Boot Package Install.pkg is ready to be added to a deployment workflow.
Operation
---------
When First Boot Package Install.pkg is installed via createOSXinstallPkg, it does the following:
1. Copies First Boot Package Install.pkg/Contents/Resources/fb_installers to /Users/Shared/fb_installers
2. The following files are installed:
/Library/LaunchDaemons/com.company.firstbootpackageinstall.plist
/Library/LaunchAgents/com.company.LoginLog.plist
/Library/PrivilegedHelperTools/LoginLog.app
/var/firstbootpackageinstall.sh
After OS X is installed by createOSXinstallPkg and reboots, the following process occurs:
1. com.company.firstbootpackageinstall LaunchDaemon triggers /var/firstbootpackageinstall.sh to run.
2. /var/firstbootpackageinstall.sh stops the login window from loading and checks for the existence of /Users/Shared/fb_installers.
If /Users/Shared/fb_installers is not found, the following actions take place:
A. The login window is allowed to load
B. The following files are deleted by /var/firstbootpackageinstall.sh:
/Library/LaunchDaemons/com.company.firstbootpackageinstall.plist
/Library/LaunchAgents/com.company.LoginLog.plist
/Library/PrivilegedHelperTools/LoginLog.app
C. /var/firstbootpackageinstall.sh checks for an existing /var/log/firstbootpackageinstall.log logfile and renames the existing logfile to include the current date and time.
D. /var/firstbootpackageinstall.sh deletes itself.
If /Users/Shared/fb_installers is found, the following actions take place:
A. If /Users/Shared/fb_installers exists, the login window is allowed to load
B. A log is created to record the actions taken by /var/firstbootpackageinstall.sh. By default, this logfile named firstbootpackageinstall.log and is stored in /var/log.
C. /Library/LaunchAgents/com.company.LoginLog.plist loads and launches /Library/PrivilegedHelperTools/LoginLog.app
D. /Library/PrivilegedHelperTools/LoginLog.app opens a window over the Mac's login window and displays the logfile
E. A network check is run, to ensure that the Mac has a network address other than 127.0.0.1 or 0.0.0.0 (which are otherwise known as loopback addresses.) This network check will check every five seconds for the next 60 minutes for a working network connection.
Network check fails - If only loopback addresses are detected within 60 minutes, the script will take the following actions:
• Log a failure message to the log
• Delete /Users/Shared/fb_installers
• Restart.
• On restart, the "if /Users/Shared/fb_installers is not found" actions occur.
Network check succeeds - If a non-loopback address is detected, the script will take the following actions:
• Log a success message to the log and proceed with the rest of the script.
F. The packages are installed, using the numbered subdirectories to set the order of installation
G. Once installation has finished, /Users/Shared/fb_installers is deleted
H. The Mac is restarted
I. On restart, the "if /Users/Shared/fb_installers is not found" actions occur.
End Result
-----------
The installer package is designed to install packages in the desired order, then remove all traces. All actions occur while access to the OS X login window is blocked.
Components
-----------
If you want to modify the installer package for your own users, the components are included in the following directories:
Iceberg project files - Available in Iceberg_project_files as First_Boot_Package_Install.zip
LaunchDaemon - Available in launchd_items/LaunchDaemons as com.company.firstbootpackageinstall.plist
LaunchAgent - Available in launchd_items/LaunchAgents as com.company.LoginLog.plist
LoginLog application - Available in loginlog_application as LoginLog-1.1.dmg
Scripts - Both the installer postflight and firstbootpackageinstall.sh are available in the following directories:
• Installer Postflight - Available in scripts/installer_postflight as postflight
• firstbootpackageinstall.sh - Available in scripts as firstbootpackageinstall.sh
Special Thanks
---------------
Thanks to Per Olofsson (MagerValp) for creating LoginLog:
https://github.com/MagerValp/LoginLog
Blog Posts
-----------
http://derflounder.wordpress.com/category/first-boot-package-install/