In this demonstration,
we're going to walk through the process
of installing and configuring a Linux module.
A kernel module is a system level object
that extends the functionality of the kernel.
It can be dynamically loaded into the kernel
or unloaded from the kernel as required.
Also modules allow the kernel to update
without requiring a system to reboot.
Now, some of the advantage
of kernel modules are they reduce the burden of the kernel
because otherwise all of the modules' functionality
will have to be included directly into the kernel.
It also allows us to dynamically load the modules.
So that means there's a lot less memory consumption.
So for this example, we're just going to walk
through how to install a basic Bluetooth module
into the kernel so we can get that Bluetooth functionality.
So the first thing we want to do,
we're going to list out the current running modules.
Okay?
I'm make it less.
So let's scroll through this.
Now we see this is what's currently running
as a Linux module on our current system.
Typically, when you're looking
for something in these vas files
we're going to pipe it with the grip command.
We learned that earlier.
So we're going to let's
we're going to pipe it with the grip command.
See if we can find anything related to a Bluetooth.
Okay. Seems like there has no results there.
These names, aren't always going to have a alias
exactly how we like them.
We're going to walk through later how to actually
configure a file to change the alias for future references
or anyone else that's using these machines.
So we can easily group categorize
and search different modules based on their functionality.
So first we're going to use the you name command.
That's going to have us retrieve the exact version
of the kernel that we're currently running.
Now, at this point, this one
we'll start doing some research
probably a quick Google search.
You know, some things that are compatible
with this particular version of Linux.
Now for this Bluetooth functionality
we're just really looking for the driver.
And so there's a special folder for this in Linux.
So we're going to go to the library.
I'm going to look at the modules, okay.
And they want to use the kernel that we currently have, right?
Remember tab through kernel drivers.
Now in this particular folder, we're going to look
and see if they have anything relative to Bluetooth.
So we see there's a folder here that should have
the modules slash drivers that we're looking
for relative to Bluetooth.
So we're going to go
into this folder and we're going to list it out.
We're going to see what we have here.
They're trying to best to name 'em as close
to possible as some of their functionality.
So we're trying to use in this example
a Bluetooth that's attached to a USB device.
So BT USB is close enough to get us kind of
know where we need to be, but again
we're going to need more research, but for this example
that's going to be the correct one.
So we're going to go over the mod info command,
which pretty much just lists out a lot of the information
about the particular device that we're trying to use.
That's okay.
I'm going to do here T USB.
All right.
And so we see this, some of the key points, right?
It's no version, aliases, in the description.
This is just a generic Bluetooth USB driver.
Now what's important when we're installing modules
is understanding that a lot
of modules are dependent upon other modules.
So we're going to have to update this file and we're going to do
that by using a sudo dependency module command
but updates the system.
Cause we're going to use this mod probe command.
So now we have an accurate representation
of which modules depend on which other modules.
Now we're going to walk through
how to configure a alias for that module.
So we see earlier that we went through and we saw the name
and it, the alias is for that Bluetooth device.
If we want to go back to this command,
we see it wasn't that helpful.
So we're going to create alias ourself
but we first have to CD to the etc mod pro directory.
Okay, and go there.
Now within this folder,
this is where we're going to create the aliases.
All right.
So this file is already in here.
I created for us earlier.
So simply all we have to do to make this alias
is type alias.
The next field is going to be what we want to name it.
And the third field is going to be the name
of the actual driver
or module that we're creating an alias for.
So again, alias to let the file know that,
"Hey we're referring to the, alias of this blue,
so that we're going to call it BTUSB is the name
of the actual module that we're going to be referencing.
So let's quit out of this.
All right.
So next we're going to do is go ahead
and add slash install this module.
Remember we created alias, we named it blue
and we see a command went through successfully.
Now we're going to list out this mod
and we're going to search for it using our grep search tool.
And we're going to look for anything relative to BTUSB.
And we can now see that this module is currently running.
Now, if you look, that's a few other modules that are
running now, remember we searched earlier for Bluetooth.
We couldn't see any, but now we see a Bluetooth module
is currently running, but you have to realize
remember when we did the update to the dependencies
it automatically installed for us with
the mod probe command.
Now the other commands that you can use to install modules.
So a couple of 'em are the insert mod.
So insmod or the remove mod, rmmod
the reason most people use the mod probe is
because it allows us to do both, but it also simultaneously
installs the dependencies that are necessary
for the particular device to function.
In this walkthrough.
We went over the benefits of the kernel modules.
We went over how to install a Bluetooth driver slash module.
We discovered how to search some
of the files and the locations that some
of the information will be and how to update the aliases.
And also the dependency table.
That's going to be required when we use our, my pro command.
And I'll see you
in the next one.