1
00:00:00,005 --> 00:00:04,006
- [Instructor] Let's look at configuring your Linux kernel.

2
00:00:04,006 --> 00:00:07,004
So there's a variety of tools for that.

3
00:00:07,004 --> 00:00:12,001
My favorite one is the old school make menuconfig.

4
00:00:12,001 --> 00:00:14,005
So notice we're using the make command.

5
00:00:14,005 --> 00:00:18,001
When you say make menuconfig the first time,

6
00:00:18,001 --> 00:00:22,007
then it will get compiled and built as an executable.

7
00:00:22,007 --> 00:00:26,000
So you might have to have some extra stuff installed

8
00:00:26,000 --> 00:00:28,009
for that to happen.

9
00:00:28,009 --> 00:00:30,000
And then when it runs,

10
00:00:30,000 --> 00:00:33,002
you're going to get this sort of interface,

11
00:00:33,002 --> 00:00:35,008
and you can move around with your arrow keys

12
00:00:35,008 --> 00:00:38,000
and so forth, right?

13
00:00:38,000 --> 00:00:40,001
So it's not mouse-oriented.

14
00:00:40,001 --> 00:00:42,007
It's ncurses-oriented.

15
00:00:42,007 --> 00:00:44,000
That's a package you install

16
00:00:44,000 --> 00:00:47,002
so you can use your arrow keys.

17
00:00:47,002 --> 00:00:50,002
And there's a whole tree of choices,

18
00:00:50,002 --> 00:00:51,007
so you can hit Enter

19
00:00:51,007 --> 00:00:54,008
to go down through the trees and so forth

20
00:00:54,008 --> 00:00:57,004
and Escape to go back up.

21
00:00:57,004 --> 00:01:01,009
I'll demo this all for you a little bit later.

22
00:01:01,009 --> 00:01:05,002
If you look at the interface, you will see for choices,

23
00:01:05,002 --> 00:01:09,009
there's sometimes less than greater than or angle brackets,

24
00:01:09,009 --> 00:01:13,007
and sometimes there's square brackets.

25
00:01:13,007 --> 00:01:15,001
When there's angle brackets,

26
00:01:15,001 --> 00:01:17,002
that means there's three choices.

27
00:01:17,002 --> 00:01:22,005
You can have an asterisk, an M, or blank.

28
00:01:22,005 --> 00:01:28,005
Blank means that configuration option is not turned on.

29
00:01:28,005 --> 00:01:32,000
M means you've chosen it to be compiled

30
00:01:32,000 --> 00:01:34,006
as a loadable kernel module.

31
00:01:34,006 --> 00:01:37,003
And asterisk means you've chosen it

32
00:01:37,003 --> 00:01:41,007
to be built into the kernel image itself.

33
00:01:41,007 --> 00:01:43,006
When it's square brackets,

34
00:01:43,006 --> 00:01:45,006
all right, it's an asterisk or blank.

35
00:01:45,006 --> 00:01:47,002
Either you have it or you don't.

36
00:01:47,002 --> 00:01:49,008
That's just a Boolean.

37
00:01:49,008 --> 00:01:52,002
Sometimes you'll see options grayed out

38
00:01:52,002 --> 00:01:55,002
or maybe not even showing up that you know that are there.

39
00:01:55,002 --> 00:01:58,001
That's a little bit confusing.

40
00:01:58,001 --> 00:02:00,001
It turns out there's dependencies

41
00:02:00,001 --> 00:02:02,002
between configuration options.

42
00:02:02,002 --> 00:02:04,005
You might have to enable one thing

43
00:02:04,005 --> 00:02:08,004
for something else to even be possible.

44
00:02:08,004 --> 00:02:13,000
So although your choices are all saved in .config,

45
00:02:13,000 --> 00:02:15,008
you typically don't want to edit .config by hand

46
00:02:15,008 --> 00:02:20,007
because, for one thing, you might mess up the dependencies.

47
00:02:20,007 --> 00:02:24,002
So generally, use one of the config tools

48
00:02:24,002 --> 00:02:27,008
or a command line way to edit stuff,

49
00:02:27,008 --> 00:02:31,006
but mostly I use make menuconfig.

50
00:02:31,006 --> 00:02:33,007
The kind of primitive interface

51
00:02:33,007 --> 00:02:35,008
in make menuconfig does have a search.

52
00:02:35,008 --> 00:02:39,000
You can say / and then give a string,

53
00:02:39,000 --> 00:02:41,005
and it will find you the configuration options

54
00:02:41,005 --> 00:02:43,002
with that string.

55
00:02:43,002 --> 00:02:45,006
And it gives you a little bit of documentation,

56
00:02:45,006 --> 00:02:46,009
like where they are,

57
00:02:46,009 --> 00:02:49,009
underneath what part of the configuration tree

58
00:02:49,009 --> 00:02:51,009
and it's type.

59
00:02:51,009 --> 00:02:53,005
A Boolean means it's going to be

60
00:02:53,005 --> 00:02:56,001
in square brackets, for example.

61
00:02:56,001 --> 00:02:57,008
And all this information

62
00:02:57,008 --> 00:03:02,009
that make menuconfig uses comes from Kconfig files

63
00:03:02,009 --> 00:03:05,000
spread out all through the file system.

64
00:03:05,000 --> 00:03:07,002
So when you look at Kconfig files in a directory,

65
00:03:07,002 --> 00:03:10,004
you can see what in that directory

66
00:03:10,004 --> 00:03:13,004
can be configured and how.

67
00:03:13,004 --> 00:03:17,007
The developers have often kindly added some advice

68
00:03:17,007 --> 00:03:21,009
about choices for configuration, some help information.

69
00:03:21,009 --> 00:03:25,001
Sometimes there isn't any, but oftentimes there is,

70
00:03:25,001 --> 00:03:26,003
and it gives you some information

71
00:03:26,003 --> 00:03:28,005
about what that option does

72
00:03:28,005 --> 00:03:30,005
and some advice as to whether,

73
00:03:30,005 --> 00:03:31,004
if you don't know what it is,

74
00:03:31,004 --> 00:03:32,008
whether you should do it or not.

75
00:03:32,008 --> 00:03:34,007
Sometimes it says, "If you don't know what this is,

76
00:03:34,007 --> 00:03:36,008
don't do it."

77
00:03:36,008 --> 00:03:39,008
With make menuconfig,

78
00:03:39,008 --> 00:03:44,000
you exit out with escaping

79
00:03:44,000 --> 00:03:46,002
and hitting the exit on the bottom.

80
00:03:46,002 --> 00:03:50,001
And at the very end, the top level,

81
00:03:50,001 --> 00:03:51,006
it will ask you if you want to save,

82
00:03:51,006 --> 00:03:53,004
and it'll save to the .config.

83
00:03:53,004 --> 00:03:54,003
That's the default.

84
00:03:54,003 --> 00:03:55,003
That's the usual thing you do.

85
00:03:55,003 --> 00:03:57,003
You just exit out.

86
00:03:57,003 --> 00:04:00,001
You can save to an alternate config file

87
00:04:00,001 --> 00:04:02,007
if you want to make a copy of it.

88
00:04:02,007 --> 00:04:08,000
And it's also possible to load an alternate config file,

89
00:04:08,000 --> 00:04:10,008
but typically, I just exit out

90
00:04:10,008 --> 00:04:14,000
and accept saving to .config.

