1
00:00:00,005 --> 00:00:02,001
- [Instructor] So we've already mentioned

2
00:00:02,001 --> 00:00:08,009
that your config options are stored in the .config file,

3
00:00:08,009 --> 00:00:11,000
and you overwrite that

4
00:00:11,000 --> 00:00:14,001
whenever you make a change with make menuconfig

5
00:00:14,001 --> 00:00:17,005
or make xconfig and save it.

6
00:00:17,005 --> 00:00:20,004
So all your choices are in that one text file.

7
00:00:20,004 --> 00:00:22,002
So you can make a copy of that,

8
00:00:22,002 --> 00:00:26,004
or someone could give you one to start with.

9
00:00:26,004 --> 00:00:28,008
So you could overwrite .config with a copy of something,

10
00:00:28,008 --> 00:00:30,008
then do make menuconfig,

11
00:00:30,008 --> 00:00:33,006
and it would start with that.

12
00:00:33,006 --> 00:00:35,001
And if the one you got

13
00:00:35,001 --> 00:00:38,008
doesn't match your current kernel version,

14
00:00:38,008 --> 00:00:43,007
then make menuconfig typically will kind of touch it up

15
00:00:43,007 --> 00:00:45,007
to include everything

16
00:00:45,007 --> 00:00:48,002
because it's going to go through all the Kconfigs

17
00:00:48,002 --> 00:00:51,006
all through the tree and find all the choices.

18
00:00:51,006 --> 00:00:54,005
And if there's stuff not in your .config,

19
00:00:54,005 --> 00:00:59,003
then it will save out the defaults for you.

20
00:00:59,003 --> 00:01:03,007
Your distribution, like Ubuntu, may give you a config file.

21
00:01:03,007 --> 00:01:05,009
It might be in /boot.

22
00:01:05,009 --> 00:01:08,002
It's also possible that in /proc,

23
00:01:08,002 --> 00:01:12,000
there might be a compressed version of your config file

24
00:01:12,000 --> 00:01:13,007
for the kernel if the kernel was built

25
00:01:13,007 --> 00:01:16,002
with that particular option.

26
00:01:16,002 --> 00:01:19,000
So if your distro gives you one,

27
00:01:19,000 --> 00:01:21,001
then you probably want to start with that one.

28
00:01:21,001 --> 00:01:23,007
Now, you might need to tweak it a little bit.

29
00:01:23,007 --> 00:01:26,000
For example, for the Ubuntu one,

30
00:01:26,000 --> 00:01:29,005
it comes with some trust key paths in it

31
00:01:29,005 --> 00:01:31,004
that probably aren't right.

32
00:01:31,004 --> 00:01:35,005
So you might need to disable some of the keys

33
00:01:35,005 --> 00:01:40,004
or set the config variable system trusted keys

34
00:01:40,004 --> 00:01:41,008
to be blank.

35
00:01:41,008 --> 00:01:44,001
So you could do that with make menuconfig,

36
00:01:44,001 --> 00:01:48,003
or it turns out, from the kernel top level directory,

37
00:01:48,003 --> 00:01:51,001
there's a subdirectory called scripts

38
00:01:51,001 --> 00:01:53,006
and there's a script called config.

39
00:01:53,006 --> 00:01:54,009
And just on the command line,

40
00:01:54,009 --> 00:01:58,001
you can set some config options if you want.

41
00:01:58,001 --> 00:01:59,005
For the kernel source,

42
00:01:59,005 --> 00:02:02,000
it's also common that

43
00:02:02,000 --> 00:02:08,002
there's a whole bunch of predefined config files available.

44
00:02:08,002 --> 00:02:13,008
And there will be some for x86, x86-64,

45
00:02:13,008 --> 00:02:16,001
but typically, there's lots of them

46
00:02:16,001 --> 00:02:20,004
from other architectures, like maybe for ARM.

47
00:02:20,004 --> 00:02:22,001
So underneath the arch

48
00:02:22,001 --> 00:02:25,002
in a particular architecture directory,

49
00:02:25,002 --> 00:02:27,008
look for another subdirectory called configs,

50
00:02:27,008 --> 00:02:29,004
and you can look in there

51
00:02:29,004 --> 00:02:31,008
and see if there's a bunch of config files.

52
00:02:31,008 --> 00:02:36,002
Maybe there's one for the imx_v4_v5.

53
00:02:36,002 --> 00:02:42,002
And these config files have a suffix of _defconfig.

54
00:02:42,002 --> 00:02:45,003
And so you can do a make with that.

55
00:02:45,003 --> 00:02:47,004
And usually for different architecture,

56
00:02:47,004 --> 00:02:49,008
you would say make ARCH=

57
00:02:49,008 --> 00:02:51,007
and then the architecture space,

58
00:02:51,007 --> 00:02:53,006
then the name of the _defconfig.

59
00:02:53,006 --> 00:02:55,005
And the word ARCH is all in capital letters.

60
00:02:55,005 --> 00:02:58,005
So make space ARCH, all in capital letters,

61
00:02:58,005 --> 00:03:00,007
=arm, in lowercase,

62
00:03:00,007 --> 00:03:05,003
name of the directory underarch name of the _defconfig file.

63
00:03:05,003 --> 00:03:07,000
And then it will read that in,

64
00:03:07,000 --> 00:03:10,009
and it'll create the .config from that.

65
00:03:10,009 --> 00:03:12,001
And so like I said,

66
00:03:12,001 --> 00:03:14,009
you can potentially configure your kernel

67
00:03:14,009 --> 00:03:17,006
to save its config file.

68
00:03:17,006 --> 00:03:20,004
So underneath General Setup

69
00:03:20,004 --> 00:03:24,001
is a box for Kernel .config support.

70
00:03:24,001 --> 00:03:26,009
And then it will allow you to choose

71
00:03:26,009 --> 00:03:28,009
to make the .config available

72
00:03:28,009 --> 00:03:34,000
through a file in /proc called config.gz.

73
00:03:34,000 --> 00:03:36,006
I've often found that's not turned on,

74
00:03:36,006 --> 00:03:40,003
but it could be handy if it is.

75
00:03:40,003 --> 00:03:42,002
All throughout the kernel source tree

76
00:03:42,002 --> 00:03:44,003
are these files called Kconfig

77
00:03:44,003 --> 00:03:47,009
or Kconfig with some suffixes.

78
00:03:47,009 --> 00:03:50,001
And this is where all the information

79
00:03:50,001 --> 00:03:52,008
for menuconfig or xconfig is stored.

80
00:03:52,008 --> 00:03:54,007
So those are text files.

81
00:03:54,007 --> 00:03:55,005
You can read 'em,

82
00:03:55,005 --> 00:03:57,003
and you can find out the names of variables.

83
00:03:57,003 --> 00:04:01,000
You can see if they're tristate,

84
00:04:01,000 --> 00:04:04,001
meaning it could be a module or static or nothing,

85
00:04:04,001 --> 00:04:05,007
or whether it's Boolean,

86
00:04:05,007 --> 00:04:08,009
meaning either you get it or you don't,

87
00:04:08,009 --> 00:04:10,000
and the help.

88
00:04:10,000 --> 00:04:11,001
So all that information

89
00:04:11,001 --> 00:04:14,000
that you see in make menuconfig is coming

90
00:04:14,000 --> 00:04:16,002
from these Kconfig files

91
00:04:16,002 --> 00:04:19,000
all distributed throughout the file system.

