1
00:00:00,001 --> 00:00:05,005
(upbeat music)

2
00:00:05,005 --> 00:00:06,003
- [Instructor] So we get

3
00:00:06,003 --> 00:00:10,008
to use some loadable kernel commands.

4
00:00:10,008 --> 00:00:13,009
All right, so we're supposed to find out

5
00:00:13,009 --> 00:00:15,009
how many are dynamically loaded.

6
00:00:15,009 --> 00:00:18,004
So the lsmod command shows us those.

7
00:00:18,004 --> 00:00:22,005
So if we do lsmod, pipe it into WC minus L,

8
00:00:22,005 --> 00:00:24,000
we get 64.

9
00:00:24,000 --> 00:00:27,009
And just a reminder, there is one line ahead of there.

10
00:00:27,009 --> 00:00:31,004
So it looks like we have 63 modules loaded in here

11
00:00:31,004 --> 00:00:36,006
and we had over 800 modules installed on the system.

12
00:00:36,006 --> 00:00:39,009
What about the last module loaded?

13
00:00:39,009 --> 00:00:42,000
Well, that was the top there,

14
00:00:42,000 --> 00:00:44,003
but the question is, what was the first one?

15
00:00:44,003 --> 00:00:49,005
So the first one would be, pipe this into tail.

16
00:00:49,005 --> 00:00:54,000
And it looks like autofs4 was the first one loaded.

17
00:00:54,000 --> 00:00:57,002
As a little aside, it's possible

18
00:00:57,002 --> 00:00:59,009
that you have a module loaded in your kernel

19
00:00:59,009 --> 00:01:03,007
that does not exist in your file system

20
00:01:03,007 --> 00:01:08,007
because when your Linux system boots, it typically starts

21
00:01:08,007 --> 00:01:13,007
with an initial file system in RAM

22
00:01:13,007 --> 00:01:17,006
and that can have modules in it that don't exist

23
00:01:17,006 --> 00:01:20,008
in your disk file system.

24
00:01:20,008 --> 00:01:25,009
So in case you find that mystery, there's the answer for it.

25
00:01:25,009 --> 00:01:26,008
All right, now we wanted

26
00:01:26,008 --> 00:01:32,002
to look at a module called msdos.

27
00:01:32,002 --> 00:01:34,004
So let's see if that's loaded.

28
00:01:34,004 --> 00:01:38,002
Lsmod, grep msdos.

29
00:01:38,002 --> 00:01:41,002
Nope, not loaded on my system, so I'm going to load it.

30
00:01:41,002 --> 00:01:51,006
So that is a standard module, so mod probe for loading that.

31
00:01:51,006 --> 00:01:56,004
It's loaded, got a size, no dependencies,

32
00:01:56,004 --> 00:01:59,004
and the use count is zero.

33
00:01:59,004 --> 00:02:05,002
Okay, so we can remove it.

34
00:02:05,002 --> 00:02:08,003
No complaints there.

35
00:02:08,003 --> 00:02:11,001
Looks like it's gone, all looks good.

36
00:02:11,001 --> 00:02:14,009
Then we wanted to look at some module information

37
00:02:14,009 --> 00:02:16,009
for the Sun RPC module.

38
00:02:16,009 --> 00:02:21,001
So the command for that is modinfo,

39
00:02:21,001 --> 00:02:22,006
and I'm going to pipe that into more

40
00:02:22,006 --> 00:02:25,004
because it produces quite a bit of stuff.

41
00:02:25,004 --> 00:02:26,006
We start at the top there.

42
00:02:26,006 --> 00:02:30,009
The second line says the license is GPL.

43
00:02:30,009 --> 00:02:34,004
Okay and we need to look for version magic.

44
00:02:34,004 --> 00:02:39,004
And if we go down a number of lines, I see vermagic

45
00:02:39,004 --> 00:02:41,007
and I see the kernel version string.

46
00:02:41,007 --> 00:02:44,004
That's the kernel I'm booted into right now.

47
00:02:44,004 --> 00:02:47,001
And then some kernel configuration options

48
00:02:47,001 --> 00:02:48,007
that have to match.

49
00:02:48,007 --> 00:02:52,003
So if I tried to load this module into a kernel,

50
00:02:52,003 --> 00:02:54,001
that same kernel version,

51
00:02:54,001 --> 00:02:57,008
but was not SMP, then it wouldn't work.

52
00:02:57,008 --> 00:03:01,009
And then if we scroll down some more,

53
00:03:01,009 --> 00:03:04,009
at the bottom we see some parms.

54
00:03:04,009 --> 00:03:10,005
And if I count those, I count 2, 4, 6, 8, 9, 10, I count 10.

55
00:03:10,005 --> 00:03:15,004
So it looks like the Sun RPC module has 10 parameters

56
00:03:15,004 --> 00:03:20,001
that could be set when we load the module.

57
00:03:20,001 --> 00:03:23,007
And incidentally, potentially those parameters could show up

58
00:03:23,007 --> 00:03:28,000
underneath the sysfile system and we could look at 'em

59
00:03:28,000 --> 00:03:31,001
or potentially even change 'em later on.

60
00:03:31,001 --> 00:03:32,004
I haven't looked for this module,

61
00:03:32,004 --> 00:03:35,009
but some modules support that too.

62
00:03:35,009 --> 00:03:37,000
All right, good luck.

