1
00:00:00,007 --> 00:00:03,005
- [Instructor] I'm in a GUI environment here

2
00:00:03,005 --> 00:00:05,002
and let's look at some stuff.

3
00:00:05,002 --> 00:00:11,005
Let's start with doing a make xconfig.

4
00:00:11,005 --> 00:00:15,001
And I'm in the Ubuntu kernel source here.

5
00:00:15,001 --> 00:00:19,003
So we see the big menu of stuff there.

6
00:00:19,003 --> 00:00:23,004
Let's look for something, let's do a edit find.

7
00:00:23,004 --> 00:00:26,007
Let's look for our ethernet driver.

8
00:00:26,007 --> 00:00:33,009
So that was mlx5_core.

9
00:00:33,009 --> 00:00:35,009
And I hit enter

10
00:00:35,009 --> 00:00:41,003
and it shows me that little cryptic list there.

11
00:00:41,003 --> 00:00:46,008
And then let's go up to option, show name,

12
00:00:46,008 --> 00:00:50,003
and that shows the names here.

13
00:00:50,003 --> 00:00:54,001
And when I click on one here,

14
00:00:54,001 --> 00:00:58,007
then it brings it up

15
00:00:58,007 --> 00:01:02,007
and we've got the help, and we've got it

16
00:01:02,007 --> 00:01:05,008
and we can select right there.

17
00:01:05,008 --> 00:01:10,009
And I did a dot. And that turns it into a module.

18
00:01:10,009 --> 00:01:12,008
Let's turn it off.

19
00:01:12,008 --> 00:01:18,008
So we're not going to have that driver selected at all.

20
00:01:18,008 --> 00:01:21,009
So let's just do that. We'll save that out.

21
00:01:21,009 --> 00:01:23,009
If you look at the little window back there,

22
00:01:23,009 --> 00:01:29,007
it says it wrote to .config, a couple other little errors

23
00:01:29,007 --> 00:01:33,007
that we're going to ignore, and then we're going to quit.

24
00:01:33,007 --> 00:01:38,000
And now it looks like we changed the Mellanox

25
00:01:38,000 --> 00:01:40,007
to not be selected.

26
00:01:40,007 --> 00:01:45,004
Let's grep that

27
00:01:45,004 --> 00:01:48,003
in our .config.

28
00:01:48,003 --> 00:01:54,000
And what happens is it adds a comment saying it's not set.

29
00:01:54,000 --> 00:01:57,006
If it was a module, as we saw before with modules,

30
00:01:57,006 --> 00:01:58,007
it would be in there

31
00:01:58,007 --> 00:02:03,007
and would say equals M, right?

32
00:02:03,007 --> 00:02:12,000
So let's try a make menuconfig now.

33
00:02:12,000 --> 00:02:13,008
Let me get this interface.

34
00:02:13,008 --> 00:02:23,008
Let's look for the Mellanox in here.

35
00:02:23,008 --> 00:02:28,004
And it tells us where it is, but doesn't bring us to it.

36
00:02:28,004 --> 00:02:30,008
So it's underneath the device drivers,

37
00:02:30,008 --> 00:02:32,005
network device support,

38
00:02:32,005 --> 00:02:36,005
ethernet driver support, Mellanox devices.

39
00:02:36,005 --> 00:02:38,006
And then it's the Mellanox 5th generation

40
00:02:38,006 --> 00:02:41,003
network adapters.

41
00:02:41,003 --> 00:02:46,003
And the name up here is MLX5_CORE.

42
00:02:46,003 --> 00:02:47,005
And this is tristate.

43
00:02:47,005 --> 00:02:51,007
So it could be a module, static, or not at all.

44
00:02:51,007 --> 00:02:53,007
Now whether it could be static

45
00:02:53,007 --> 00:02:55,008
or not can depend on configuration

46
00:02:55,008 --> 00:03:00,006
because if something it depends on is a module,

47
00:03:00,006 --> 00:03:02,000
then it has to be a module.

48
00:03:02,000 --> 00:03:04,001
'Cause you can't statically link in something

49
00:03:04,001 --> 00:03:05,009
that doesn't have everything it needs

50
00:03:05,009 --> 00:03:08,004
already statically linked.

51
00:03:08,004 --> 00:03:10,002
So let's see if we can find it,

52
00:03:10,002 --> 00:03:12,001
if we can remember where that was.

53
00:03:12,001 --> 00:03:15,006
It was device drivers

54
00:03:15,006 --> 00:03:20,008
and then network.

55
00:03:20,008 --> 00:03:25,007
And then ethernet.

56
00:03:25,007 --> 00:03:28,001
See that star there saying we have general ethernet

57
00:03:28,001 --> 00:03:34,003
driver support in, and then we got to look for Mellanox.

58
00:03:34,003 --> 00:03:37,005
See how xconfig's so much easier?

59
00:03:37,005 --> 00:03:38,007
Looks like they're alphabetical,

60
00:03:38,007 --> 00:03:42,004
but it's the order they are in the Kconfig file.

61
00:03:42,004 --> 00:03:46,001
There we go. And what do we have there?

62
00:03:46,001 --> 00:03:51,000
So the Mellanox devices are underneath here.

63
00:03:51,000 --> 00:03:52,007
Oh, there it is. Right there.

64
00:03:52,007 --> 00:03:55,006
And it's off because with xconfig we turned it off.

65
00:03:55,006 --> 00:03:59,007
So I'm going to hit the space bar and now it's a module

66
00:03:59,007 --> 00:04:03,008
and some new options popped up of things we can add to that.

67
00:04:03,008 --> 00:04:05,009
But we'll just leave it at that.

68
00:04:05,009 --> 00:04:10,005
I exit out, I arrow over to exit, exit again,

69
00:04:10,005 --> 00:04:13,008
arrow over to exit, exit.

70
00:04:13,008 --> 00:04:14,007
And then it says,

71
00:04:14,007 --> 00:04:17,008
"Do you wish to save your new configuration?"

72
00:04:17,008 --> 00:04:20,004
And I'm going to hit enter for yes.

73
00:04:20,004 --> 00:04:24,003
And it writes to the .config.

74
00:04:24,003 --> 00:04:27,009
And if we grep in the .config for the MLX5_CORE,

75
00:04:27,009 --> 00:04:32,001
we see now it's set to an M.

76
00:04:32,001 --> 00:04:33,009
All right, couple other quick things.

77
00:04:33,009 --> 00:04:39,005
Let's go to a different kernel.

78
00:04:39,005 --> 00:04:42,000
Let's look at some defconfigs.

79
00:04:42,000 --> 00:04:47,009
So if I ls arch/arm/configs,

80
00:04:47,009 --> 00:04:50,006
I see a whole lot of defconfigs.

81
00:04:50,006 --> 00:04:54,009
So I could do something like make ARCH=arm

82
00:04:54,009 --> 00:04:56,004
and pick one of these.

83
00:04:56,004 --> 00:04:58,001
What's a nice easy one to type?

84
00:04:58,001 --> 00:05:01,008
hisi_defconfig.

85
00:05:01,008 --> 00:05:04,009
Let's see if that works.

86
00:05:04,009 --> 00:05:12,006
Yep, it saved all that out to .config.

87
00:05:12,006 --> 00:05:18,003
Let's go back to our Ubuntu kernel and,

88
00:05:18,003 --> 00:05:21,001
we would build a kernel image with that.

89
00:05:21,001 --> 00:05:23,006
We could do a J.

90
00:05:23,006 --> 00:05:27,009
I've already built it so it shouldn't take very long.

91
00:05:27,009 --> 00:05:30,001
And it tells you where it put it.

92
00:05:30,001 --> 00:05:37,000
If we do a long list on that,

93
00:05:37,000 --> 00:05:39,002
we see it, for example.

94
00:05:39,002 --> 00:05:43,000
All right, that was a little bit of practice.

