1
00:00:00,005 --> 00:00:02,000
- [Instructor] Since we want to talk about

2
00:00:02,000 --> 00:00:03,006
using the kernel source,

3
00:00:03,006 --> 00:00:08,006
we need to start by talking about getting the kernel source.

4
00:00:08,006 --> 00:00:11,008
Well, if you want official kernel releases,

5
00:00:11,008 --> 00:00:14,001
I often get kernels from here.

6
00:00:14,001 --> 00:00:18,009
You can go to kernel.org, underneath pub/linux/kernel,

7
00:00:18,009 --> 00:00:20,000
various versions are there

8
00:00:20,000 --> 00:00:24,000
and you get tarballs of the source and you get patch files.

9
00:00:24,000 --> 00:00:26,005
I often download a tarball from there.

10
00:00:26,005 --> 00:00:29,005
For example, just using the wget like this

11
00:00:29,005 --> 00:00:32,000
would get the compressed tarball

12
00:00:32,000 --> 00:00:35,009
for the Linux kernel version 6.9.9.

13
00:00:35,009 --> 00:00:38,000
You can also use Git.

14
00:00:38,000 --> 00:00:44,000
Git clone, the official Torvalds Linux kernel tree,

15
00:00:44,000 --> 00:00:45,005
if you want to get the latest stuff

16
00:00:45,005 --> 00:00:47,009
and see all the changes and whatnot.

17
00:00:47,009 --> 00:00:50,008
All the cool things you can do with Git.

18
00:00:50,008 --> 00:00:54,009
If you want to get the Ubuntu kernel source code,

19
00:00:54,009 --> 00:00:58,003
then what they recommend is using Git

20
00:00:58,003 --> 00:01:01,006
and getting their Git tree

21
00:01:01,006 --> 00:01:06,004
and the version you get, you have to pick the codename

22
00:01:06,004 --> 00:01:08,005
for the distribution.

23
00:01:08,005 --> 00:01:11,007
If you want to get for your current distribution,

24
00:01:11,007 --> 00:01:15,003
you can look at the file, etc/lsb-release,

25
00:01:15,003 --> 00:01:18,006
and in there will be a variable set called

26
00:01:18,006 --> 00:01:21,003
DISTRIB_CODENAME.

27
00:01:21,003 --> 00:01:24,003
So this is a little bit of shell stuff,

28
00:01:24,003 --> 00:01:26,004
but if you source that file,

29
00:01:26,004 --> 00:01:32,000
it will set environment variables in your shell for you.

30
00:01:32,000 --> 00:01:35,009
And then you can use that variable

31
00:01:35,009 --> 00:01:38,004
and it'll be in capital letters perhaps.

32
00:01:38,004 --> 00:01:41,006
So I translate it to lowercase

33
00:01:41,006 --> 00:01:44,008
because that's what you want for the path name.

34
00:01:44,008 --> 00:01:48,004
So in mine the DISTRIB_CODENAME variable

35
00:01:48,004 --> 00:01:51,000
had the value NOBLE, all in uppercase.

36
00:01:51,000 --> 00:01:55,009
So this shell variable name will be noble in lowercase.

37
00:01:55,009 --> 00:01:58,001
And then I can just use that name

38
00:01:58,001 --> 00:02:01,009
and this Git clone with this will go to the internet

39
00:02:01,009 --> 00:02:04,005
and copy that old Git tree

40
00:02:04,005 --> 00:02:06,008
and that will probably be pretty big.

41
00:02:06,008 --> 00:02:12,000
That particular one was more than four gigabytes long.

42
00:02:12,000 --> 00:02:14,009
And it's got, because it's Git tree,

43
00:02:14,009 --> 00:02:18,005
all their different related kernel releases,

44
00:02:18,005 --> 00:02:20,006
and they've tagged them.

45
00:02:20,006 --> 00:02:24,000
So you can check out one of the tags if you want

46
00:02:24,000 --> 00:02:26,005
to look at a particular version.

47
00:02:26,005 --> 00:02:28,002
So they have a nice write up about it

48
00:02:28,002 --> 00:02:31,001
in their kernel Git guide if you want more information.

49
00:02:31,001 --> 00:02:33,003
And there's the path for that.

50
00:02:33,003 --> 00:02:35,006
All right, so go get yourself some source.

51
00:02:35,006 --> 00:02:37,000
We're going to need it.

