Skip to content

Commit cca61df

Browse files
pelwellJamesH65
authored andcommitted
Add instructions for downloading other branches (raspberrypi#992)
* Add instructions for downloading other branches * copy edits * Remove redundant line. Not only was the line unnecessary, it included a broken link.
1 parent 4038c06 commit cca61df

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

linux/kernel/building.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,27 @@ Next get the sources, which will take some time:
1818
git clone --depth=1 https://github.com/raspberrypi/linux
1919
```
2020

21+
<a name="choosing_sources"></a>
22+
23+
### Choosing sources
24+
25+
The `git clone` command above will download the current active branch (the one we are building Raspbian images from) without any history. Omitting the `--depth=1` will download the entire repository, including the full history of all branches, but this takes much longer and occupies much more storage.
26+
27+
To download a different branch (again with no history), use the `--branch` option:
28+
29+
```bash
30+
git clone --depth=1 --branch rpi-4.18.y https://github.com/raspberrypi/linux
31+
```
32+
33+
Refer to the [original GitHub repository](https://github.com/raspberrypi/linux) for information about the available branches.
34+
35+
### Kernel configuration
36+
2137
Configure the kernel; as well as the default configuration, you may wish to [configure your kernel in more detail](configuring.md) or [apply patches from another source](patching.md), to add or remove required functionality:
2238

2339
Run the following commands, depending on your Raspberry Pi version.
2440

25-
### Raspberry Pi 1, Pi 0, Pi 0W, and Compute Module default build configuration
41+
### Raspberry Pi 1, Pi Zero, Pi Zero W, and Compute Module default build configuration
2642

2743
```bash
2844
cd linux
@@ -76,22 +92,23 @@ If you are on a 64-bit host system, you should use:
7692
echo PATH=\$PATH:~/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin >> ~/.bashrc
7793
source ~/.bashrc
7894
```
79-
8095
### Get sources
8196

82-
To get the sources, refer to the original [GitHub](https://github.com/raspberrypi/linux) repository for the various branches.
97+
To download the minimal source tree for the current branch, run:
8398

99+
```bash
100+
git clone --depth=1 https://github.com/raspberrypi/linux
84101
```
85-
$ git clone --depth=1 https://github.com/raspberrypi/linux
86-
```
102+
103+
See [**Choosing sources**](#choosing_sources) above for instructions on how to choose a different branch.
87104

88105
### Build sources
89106

90107
To build the sources for cross-compilation, there may be extra dependencies beyond those you've installed by default with Ubuntu. If you find you need other things, please submit a pull request to change the documentation.
91108

92109
Enter the following commands to build the sources and Device Tree files:
93110

94-
For Pi 1, Pi 0, Pi 0 W, or Compute Module:
111+
For Pi 1, Pi Zero, Pi Zero W, or Compute Module:
95112

96113
```bash
97114
cd linux

0 commit comments

Comments
 (0)