1
00:00:00,120 --> 00:00:01,290
In this demonstration,

2
00:00:01,290 --> 00:00:02,640
we're going to walk through the process

3
00:00:02,640 --> 00:00:05,463
of installing and configuring a Linux module.

4
00:00:06,330 --> 00:00:08,370
A kernel module is a system level object

5
00:00:08,370 --> 00:00:10,950
that extends the functionality of the kernel.

6
00:00:10,950 --> 00:00:12,840
It can be dynamically loaded into the kernel

7
00:00:12,840 --> 00:00:15,870
or unloaded from the kernel as required.

8
00:00:15,870 --> 00:00:17,670
Also modules allow the kernel to update

9
00:00:17,670 --> 00:00:20,100
without requiring a system to reboot.

10
00:00:20,100 --> 00:00:21,360
Now, some of the advantage

11
00:00:21,360 --> 00:00:23,850
of kernel modules are they reduce the burden of the kernel

12
00:00:23,850 --> 00:00:26,923
because otherwise all of the modules' functionality

13
00:00:26,923 --> 00:00:29,220
will have to be included directly into the kernel.

14
00:00:29,220 --> 00:00:32,490
It also allows us to dynamically load the modules.

15
00:00:32,490 --> 00:00:35,400
So that means there's a lot less memory consumption.

16
00:00:35,400 --> 00:00:37,110
So for this example, we're just going to walk

17
00:00:37,110 --> 00:00:39,576
through how to install a basic Bluetooth module

18
00:00:39,576 --> 00:00:43,410
into the kernel so we can get that Bluetooth functionality.

19
00:00:43,410 --> 00:00:44,400
So the first thing we want to do,

20
00:00:44,400 --> 00:00:46,740
we're going to list out the current running modules.

21
00:00:46,740 --> 00:00:48,300
Okay?

22
00:00:48,300 --> 00:00:49,133
I'm make it less.

23
00:00:49,133 --> 00:00:50,853
So let's scroll through this.

24
00:00:52,590 --> 00:00:54,472
Now we see this is what's currently running

25
00:00:54,472 --> 00:00:57,663
as a Linux module on our current system.

26
00:00:58,770 --> 00:00:59,760
Typically, when you're looking

27
00:00:59,760 --> 00:01:02,130
for something in these vas files

28
00:01:02,130 --> 00:01:04,290
we're going to pipe it with the grip command.

29
00:01:04,290 --> 00:01:05,123
We learned that earlier.

30
00:01:05,123 --> 00:01:06,540
So we're going to let's

31
00:01:06,540 --> 00:01:07,770
we're going to pipe it with the grip command.

32
00:01:07,770 --> 00:01:10,320
See if we can find anything related to a Bluetooth.

33
00:01:11,730 --> 00:01:14,340
Okay. Seems like there has no results there.

34
00:01:14,340 --> 00:01:18,150
These names, aren't always going to have a alias

35
00:01:18,150 --> 00:01:19,980
exactly how we like them.

36
00:01:19,980 --> 00:01:21,510
We're going to walk through later how to actually

37
00:01:21,510 --> 00:01:24,690
configure a file to change the alias for future references

38
00:01:24,690 --> 00:01:26,670
or anyone else that's using these machines.

39
00:01:26,670 --> 00:01:29,070
So we can easily group categorize

40
00:01:29,070 --> 00:01:33,360
and search different modules based on their functionality.

41
00:01:33,360 --> 00:01:35,610
So first we're going to use the you name command.

42
00:01:35,610 --> 00:01:37,770
That's going to have us retrieve the exact version

43
00:01:37,770 --> 00:01:39,720
of the kernel that we're currently running.

44
00:01:39,720 --> 00:01:41,190
Now, at this point, this one

45
00:01:41,190 --> 00:01:42,480
we'll start doing some research

46
00:01:42,480 --> 00:01:44,250
probably a quick Google search.

47
00:01:44,250 --> 00:01:46,320
You know, some things that are compatible

48
00:01:46,320 --> 00:01:48,570
with this particular version of Linux.

49
00:01:48,570 --> 00:01:51,660
Now for this Bluetooth functionality

50
00:01:51,660 --> 00:01:53,850
we're just really looking for the driver.

51
00:01:53,850 --> 00:01:57,450
And so there's a special folder for this in Linux.

52
00:01:57,450 --> 00:01:59,763
So we're going to go to the library.

53
00:02:01,110 --> 00:02:04,963
I'm going to look at the modules, okay.

54
00:02:04,963 --> 00:02:08,160
And they want to use the kernel that we currently have, right?

55
00:02:08,160 --> 00:02:12,483
Remember tab through kernel drivers.

56
00:02:14,670 --> 00:02:16,920
Now in this particular folder, we're going to look

57
00:02:16,920 --> 00:02:19,313
and see if they have anything relative to Bluetooth.

58
00:02:23,610 --> 00:02:25,260
So we see there's a folder here that should have

59
00:02:25,260 --> 00:02:27,810
the modules slash drivers that we're looking

60
00:02:27,810 --> 00:02:29,133
for relative to Bluetooth.

61
00:02:30,360 --> 00:02:31,193
So we're going to go

62
00:02:31,193 --> 00:02:33,120
into this folder and we're going to list it out.

63
00:02:33,120 --> 00:02:34,410
We're going to see what we have here.

64
00:02:34,410 --> 00:02:36,270
They're trying to best to name 'em as close

65
00:02:36,270 --> 00:02:38,700
to possible as some of their functionality.

66
00:02:38,700 --> 00:02:41,670
So we're trying to use in this example

67
00:02:41,670 --> 00:02:45,570
a Bluetooth that's attached to a USB device.

68
00:02:45,570 --> 00:02:50,310
So BT USB is close enough to get us kind of

69
00:02:50,310 --> 00:02:52,170
know where we need to be, but again

70
00:02:52,170 --> 00:02:54,270
we're going to need more research, but for this example

71
00:02:54,270 --> 00:02:55,440
that's going to be the correct one.

72
00:02:55,440 --> 00:02:58,170
So we're going to go over the mod info command,

73
00:02:58,170 --> 00:03:00,270
which pretty much just lists out a lot of the information

74
00:03:00,270 --> 00:03:03,750
about the particular device that we're trying to use.

75
00:03:03,750 --> 00:03:04,583
That's okay.

76
00:03:04,583 --> 00:03:06,633
I'm going to do here T USB.

77
00:03:10,740 --> 00:03:12,090
All right.

78
00:03:12,090 --> 00:03:15,030
And so we see this, some of the key points, right?

79
00:03:15,030 --> 00:03:18,690
It's no version, aliases, in the description.

80
00:03:18,690 --> 00:03:21,393
This is just a generic Bluetooth USB driver.

81
00:03:22,590 --> 00:03:25,470
Now what's important when we're installing modules

82
00:03:25,470 --> 00:03:26,940
is understanding that a lot

83
00:03:26,940 --> 00:03:30,270
of modules are dependent upon other modules.

84
00:03:30,270 --> 00:03:32,640
So we're going to have to update this file and we're going to do

85
00:03:32,640 --> 00:03:37,590
that by using a sudo dependency module command

86
00:03:37,590 --> 00:03:39,030
but updates the system.

87
00:03:39,030 --> 00:03:42,090
Cause we're going to use this mod probe command.

88
00:03:42,090 --> 00:03:43,770
So now we have an accurate representation

89
00:03:43,770 --> 00:03:46,593
of which modules depend on which other modules.

90
00:03:47,520 --> 00:03:48,360
Now we're going to walk through

91
00:03:48,360 --> 00:03:51,780
how to configure a alias for that module.

92
00:03:51,780 --> 00:03:54,990
So we see earlier that we went through and we saw the name

93
00:03:54,990 --> 00:03:59,216
and it, the alias is for that Bluetooth device.

94
00:03:59,216 --> 00:04:00,863
If we want to go back to this command,

95
00:04:02,130 --> 00:04:03,810
we see it wasn't that helpful.

96
00:04:03,810 --> 00:04:05,220
So we're going to create alias ourself

97
00:04:05,220 --> 00:04:10,220
but we first have to CD to the etc mod pro directory.

98
00:04:10,440 --> 00:04:11,913
Okay, and go there.

99
00:04:15,540 --> 00:04:16,410
Now within this folder,

100
00:04:16,410 --> 00:04:18,653
this is where we're going to create the aliases.

101
00:04:21,690 --> 00:04:22,523
All right.

102
00:04:22,523 --> 00:04:24,600
So this file is already in here.

103
00:04:24,600 --> 00:04:25,950
I created for us earlier.

104
00:04:25,950 --> 00:04:29,160
So simply all we have to do to make this alias

105
00:04:29,160 --> 00:04:31,323
is type alias.

106
00:04:32,370 --> 00:04:35,340
The next field is going to be what we want to name it.

107
00:04:35,340 --> 00:04:37,500
And the third field is going to be the name

108
00:04:37,500 --> 00:04:38,730
of the actual driver

109
00:04:38,730 --> 00:04:41,160
or module that we're creating an alias for.

110
00:04:41,160 --> 00:04:44,563
So again, alias to let the file know that,

111
00:04:44,563 --> 00:04:47,910
"Hey we're referring to the, alias of this blue,

112
00:04:47,910 --> 00:04:50,910
so that we're going to call it BTUSB is the name

113
00:04:50,910 --> 00:04:54,153
of the actual module that we're going to be referencing.

114
00:04:55,020 --> 00:04:56,370
So let's quit out of this.

115
00:04:56,370 --> 00:04:57,203
All right.

116
00:04:57,203 --> 00:04:58,036
So next we're going to do is go ahead

117
00:04:58,036 --> 00:05:01,997
and add slash install this module.

118
00:05:04,170 --> 00:05:06,570
Remember we created alias, we named it blue

119
00:05:06,570 --> 00:05:08,340
and we see a command went through successfully.

120
00:05:08,340 --> 00:05:10,582
Now we're going to list out this mod

121
00:05:10,582 --> 00:05:13,432
and we're going to search for it using our grep search tool.

122
00:05:14,490 --> 00:05:17,583
And we're going to look for anything relative to BTUSB.

123
00:05:20,400 --> 00:05:23,400
And we can now see that this module is currently running.

124
00:05:23,400 --> 00:05:25,650
Now, if you look, that's a few other modules that are

125
00:05:25,650 --> 00:05:27,630
running now, remember we searched earlier for Bluetooth.

126
00:05:27,630 --> 00:05:30,780
We couldn't see any, but now we see a Bluetooth module

127
00:05:30,780 --> 00:05:33,000
is currently running, but you have to realize

128
00:05:33,000 --> 00:05:37,020
remember when we did the update to the dependencies

129
00:05:37,020 --> 00:05:38,610
it automatically installed for us with

130
00:05:38,610 --> 00:05:40,170
the mod probe command.

131
00:05:40,170 --> 00:05:43,590
Now the other commands that you can use to install modules.

132
00:05:43,590 --> 00:05:45,900
So a couple of 'em are the insert mod.

133
00:05:45,900 --> 00:05:50,900
So insmod or the remove mod, rmmod

134
00:05:51,030 --> 00:05:53,610
the reason most people use the mod probe is

135
00:05:53,610 --> 00:05:57,030
because it allows us to do both, but it also simultaneously

136
00:05:57,030 --> 00:05:59,250
installs the dependencies that are necessary

137
00:05:59,250 --> 00:06:00,960
for the particular device to function.

138
00:06:00,960 --> 00:06:01,793
In this walkthrough.

139
00:06:01,793 --> 00:06:04,200
We went over the benefits of the kernel modules.

140
00:06:04,200 --> 00:06:08,610
We went over how to install a Bluetooth driver slash module.

141
00:06:08,610 --> 00:06:09,720
We discovered how to search some

142
00:06:09,720 --> 00:06:11,520
of the files and the locations that some

143
00:06:11,520 --> 00:06:14,490
of the information will be and how to update the aliases.

144
00:06:14,490 --> 00:06:16,320
And also the dependency table.

145
00:06:16,320 --> 00:06:18,660
That's going to be required when we use our, my pro command.

146
00:06:18,660 --> 00:06:19,493
And I'll see you

147
00:06:19,493 --> 00:06:20,326
in the next one.

