WEBVTT

00:05.420 --> 00:09.830
So in the last video, we learned how the bootstrappers environment works and now we're going to learn

00:09.830 --> 00:12.080
how to create our own bootstrappers environment.

00:12.470 --> 00:16.250
So to do that, we need to download the bootstrappers program.

00:16.250 --> 00:19.920
And when you download it, you're going to get a directory that looks like this.

00:20.570 --> 00:27.500
And so what we have here is we have a make dmg shell script, and that's what makes the bootstrappers

00:27.500 --> 00:28.220
disk image.

00:28.580 --> 00:35.930
Now, the bootstrappers disk image is the image that we copied in our demo to the monkey server, and

00:35.930 --> 00:39.720
that's the image that we mounted when we were in recovery.

00:40.700 --> 00:41.120
All right.

00:41.130 --> 00:45.080
So you can see that there's also a directory called Bootstrap.

00:45.170 --> 00:51.410
And if we go into that directory and take a listing, you can see that we have an alias called Run that

00:51.410 --> 00:53.420
runs the bootstrappers shell script.

00:53.840 --> 00:58.850
And that script is what basically runs the packages in the package folder.

00:59.420 --> 00:59.840
All right.

00:59.840 --> 01:07.850
So let's go to the packages folder and inside the packages folder, we have a list of packages and scripts

01:08.120 --> 01:10.010
that are going to run in alphabetical order.

01:10.850 --> 01:15.140
Now, I went ahead and numbered mine in the order I want to go in.

01:15.380 --> 01:21.980
And when a system runs things in alphabetical order and you rename them numerically like I have, then

01:21.980 --> 01:24.830
it will basically run in numerical order.

01:24.980 --> 01:29.360
The first thing that this does is it runs a script called Rename.

01:29.570 --> 01:31.700
And now this is a script that I wrote.

01:31.760 --> 01:37.190
Basically what it does is it renames the computer, but it does it, I think, in a kind of a unique

01:37.190 --> 01:37.530
way.

01:38.030 --> 01:43.570
So what we're going to do is we're going to ask the user to enter a computer name and then assign it

01:43.580 --> 01:45.000
the variable new name.

01:45.290 --> 01:51.140
Now, how it actually names the computer, because remember, we are booted in recovery mode.

01:51.140 --> 01:54.590
We're not booted from the hard disk that we're going to be using in production.

01:54.590 --> 02:00.230
And that's why we're going to do what's called a TERU now, which basically logs you in.

02:00.380 --> 02:03.420
So you're using a different file system.

02:03.740 --> 02:10.320
So what we're doing is we're going to take root as user root to the Macintosh hard drive volume.

02:10.730 --> 02:17.630
Now, when this whole procedure is done and we reboot the computer, we're booting from the Macintosh

02:17.630 --> 02:18.680
hard drive volume.

02:18.830 --> 02:24.830
But the commands that we run in the Chubut environment are going to affect that Macintosh hard drive

02:24.830 --> 02:25.240
volume.

02:25.520 --> 02:31.880
So as you can see, we're going to be running a command studio set computer named Variable.

02:32.150 --> 02:37.970
We're going to be executing that command onto the Macintosh hard drive, not the hard drive from the

02:37.970 --> 02:41.630
computer in which we're booted, which is the recovery partition.

02:42.110 --> 02:46.310
So we're going to set all three computer names to our new name, variable.

02:46.520 --> 02:49.430
And then the last line just prints that variable out.

02:51.110 --> 02:57.440
All right, so the next thing that we do is we installed the Monkey Tools package, and this is the

02:57.440 --> 02:59.770
package that you can download from the Monkey website.

02:59.780 --> 03:05.150
It's the same one we've used to install Monkey on our admin machine and our client machine.

03:05.660 --> 03:11.410
And then the next package, it gets installed as Monkey Kickstart, also available from the Monkey website.

03:11.690 --> 03:16.150
And this is what puts the computer in monkey bootstrap mode, which we talked about earlier.

03:17.230 --> 03:22.630
Now, the fourth package, Skip Apple, set up assistant, that's a package that I downloaded from the

03:22.630 --> 03:27.540
Internet that's designed to skip the prompts when a user logs in for the first time.

03:28.530 --> 03:31.410
And then create administrator package.

03:31.590 --> 03:38.500
This is a package that will create that creates the first user account on the system and our demo case

03:38.580 --> 03:41.360
administrator and it assigns it a password.

03:41.700 --> 03:47.950
And how this package was created was using a program called P, why create a user package?

03:49.230 --> 03:55.560
Now, when you download this program, you get a folder that looks like this and basically you're just

03:55.560 --> 03:58.490
going to be running the create user package program.

03:58.860 --> 04:05.940
And when you do that without any arguments, then you get a list of available options.

04:06.390 --> 04:12.360
So what we're going to do is we're going to create user package and then we're going to go hyphen and

04:12.360 --> 04:16.200
for administrator and then hyphen you for you.

04:16.320 --> 04:19.920
And we're going to use the UID of five, one in five.

04:20.020 --> 04:26.790
One is the other that gets assigned to whatever account you create when you run the apple set up system,

04:26.790 --> 04:28.520
when you take the computer out of the box.

04:28.830 --> 04:32.730
So our packages are going to basically recreate that process.

04:33.250 --> 04:38.100
Then we're going to do hyphen B for version number and that's going to be the version of this package.

04:38.100 --> 04:44.760
If you upgrade this package in the future, then you can just upgrade the version number and then we're

04:44.760 --> 04:52.470
going to need a unique identifier and we're going to just call it a automata administrator.

04:53.310 --> 04:58.360
And now we need to enter a password and so we can just type our password in.

04:58.410 --> 05:02.190
Then there's some other options that you can enter, such as a full name.

05:03.030 --> 05:07.020
And so the last option that I'm going to pick is hyphen a four Adnen.

05:07.020 --> 05:10.620
So this is going to make this account an administrator account.

05:10.950 --> 05:14.910
And then the last thing you need to do is give it a file name.

05:14.910 --> 05:22.890
So we're going to go ahead and say create admin that package and then it's going to go ahead and create

05:23.070 --> 05:24.030
a package file.

05:24.330 --> 05:29.850
So if I do a listing, you can see I've got to create an ID package now and we need what we need to

05:29.850 --> 05:37.080
do is basically take this package file and copy it to the packages folder in our bootstrap directory.

05:37.940 --> 05:43.730
All right, so with the administrator account created, then the next thing that I'm running is another

05:43.730 --> 05:49.550
script that I wrote, and this is the script that asks the user for the name in the manifest they wanted

05:49.550 --> 05:50.090
to use.

05:51.890 --> 06:00.470
So the there's a note in here basically that says to run this command and the Manifest Util Command

06:00.470 --> 06:06.920
is a command from monkey tools and what it does is it it lists the manifest.

06:06.920 --> 06:13.430
And I'm going to take that listing and I'm going to write it to a file on our monkey server.

06:14.310 --> 06:20.100
Now, if I go ahead and take a look at that file in its current state.

06:22.960 --> 06:25.420
Then you will see that I have.

06:26.400 --> 06:33.660
Two manifests that are in my monkey server now, if I go ahead and create a new manifest.

06:37.280 --> 06:38.450
And I say that.

06:39.370 --> 06:41.230
And then I run this command.

06:43.560 --> 06:50.400
And now I take a look at that file again, you can see that I've now I've got the three manifests that

06:50.430 --> 06:51.440
are in Monkey.

06:52.020 --> 06:52.400
All right.

06:52.410 --> 06:59.730
Now, if you remember when we ran bootstrappers, it also offered us a couple more manifest names.

06:59.730 --> 07:01.850
And we'll go ahead and get to that in a moment.

07:02.310 --> 07:08.850
So as you can see on this line over here, we're downloading that file, but we're writing it to the

07:08.850 --> 07:12.120
Macintosh hard drive volume in a temp folder.

07:13.750 --> 07:22.210
And then over here, what we're going to do is we're going to assign a variable new name to our computers

07:22.210 --> 07:24.940
computer name, but remember, the computer name isn't.

07:26.070 --> 07:31.470
On the computer we're booting from it's we said it to the volume in which we're going to be booting

07:31.470 --> 07:33.610
to after bootstrappers done.

07:33.840 --> 07:36.270
So, again, I have to use that cheroot command.

07:36.570 --> 07:39.510
And then what we're going to do here is we're going to write that variable.

07:39.510 --> 07:45.720
So the computer running from the cheroot environment and we're adding it to the list of the monkey manifest

07:45.720 --> 07:48.780
file that we downloaded from our monkey server.

07:49.170 --> 07:51.180
And we're going to do the exact same thing.

07:51.180 --> 07:57.150
But for the serial number and that's how we got all of those options in the monkey manifest.

07:57.930 --> 07:58.460
All right.

07:58.470 --> 08:07.230
So this part, this code over here, this basically asks the user which monkey manifest that they want

08:07.230 --> 08:12.540
to use and then it gives them the options from the file and it waits for input.

08:12.900 --> 08:19.620
And then once it gets input, it will write the right manifest that you choose to the manifest file.

08:20.280 --> 08:25.950
So over here, the last bit of code, this is where we're writing the manifest preference or this is

08:25.950 --> 08:28.010
where we're writing the monkey preference file.

08:28.560 --> 08:34.890
So we're going to route into the Macintosh hard drive and we're going to use the default rights command

08:34.890 --> 08:37.710
that we used when we learned about installing monkey earlier.

08:37.920 --> 08:43.260
And we're going to sign it a monkey repo and we're going to sign it and manifest and we're going to

08:43.260 --> 08:45.170
suppress the user notification.

08:45.690 --> 08:52.470
And then when everything is done, we're going to erase that monkey manifest list file from the computer.

08:55.330 --> 09:00.670
All right, so when that's done, then here's a script that another script I found on the Internet,

09:00.670 --> 09:06.490
and this suppresses the question that new user gets asked about sending diagnostics to Apple.

09:06.940 --> 09:12.850
Now, I had to change the script so it would write all of this stuff to the Macintosh hard drive.

09:12.850 --> 09:15.340
So I had to do it in the cheroot environment.

09:18.310 --> 09:26.260
Now, a lot of these things could be just done in Monkey, so the renamed script actually has to be

09:26.260 --> 09:32.920
done in bootstrappers, installing monkey tools and Monkey Kickstart has to be done in bootstrap or

09:33.490 --> 09:42.160
this skipping the apple setup assistant and the administrator package could be done in just in monkey

09:42.160 --> 09:45.190
itself and the supressed diagnostics.

09:45.190 --> 09:48.860
Also, that script could be run from monkey by itself.

09:49.180 --> 09:56.320
Now choosing the monkey manifest and writing the preference file for Monkey itself does have to be done

09:56.320 --> 09:57.140
in bootstrappers.

09:57.460 --> 10:03.820
Now, if you don't if you want these other packages to be in your monkey environment, you could pull

10:03.820 --> 10:05.340
them out of the strapper.

10:05.590 --> 10:12.150
But when you build your bootstrap environment, just think about what actually has to be run in bootstrappers,

10:12.160 --> 10:14.050
in what can be run and monkey.

10:14.740 --> 10:15.150
All right.

10:15.160 --> 10:20.140
So now that we have everything that we want in our bootstrappers environment, we need to build the

10:20.140 --> 10:21.950
disk image for bootstrappers.

10:22.540 --> 10:29.320
So what we're going to do is we're going to get out of this directory and get back to the bootstrap

10:29.320 --> 10:32.950
our master home directory where the shelf script is.

10:33.250 --> 10:39.640
And then we're just going to go ahead and run the Shell script and it's going to generate a bootstrap

10:39.940 --> 10:40.980
DMG file.

10:41.350 --> 10:47.320
And now that bootstrap that DMG file, we just need to copy to a Web server someplace.

10:47.320 --> 10:48.610
And you saw my demo.

10:48.610 --> 10:51.850
I copied it to our monkey server.

10:52.180 --> 10:56.950
And so then when whoever is going to be setting up the computer, they can take the computer out of

10:56.950 --> 11:04.360
the box, go to recovery, they can go right to the terminal and then do HDI util attach and then the

11:04.360 --> 11:09.310
path to this bootstrap dmg and then run the run command.

11:09.640 --> 11:15.730
And however your environment is set up, it will prompt the user if there's any prompts or it will just

11:15.730 --> 11:16.960
install packages.

11:17.140 --> 11:23.230
And then once it's reboot, then the computer will reboot and do whatever it is that monkey tells it

11:23.230 --> 11:23.650
to do.
