Skip to content

Commit eacfff6

Browse files
roypatShadowCurse
authored andcommitted
doc: do not clone entire linux repo to regenerate bindings
When generating bindings, we need a specific revision of the linux kernel, so there is no need to downloads gigabytes of git history. Update the instructions to save some time and bandwidth. Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
1 parent a4bc625 commit eacfff6

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

kvm-bindings/CONTRIBUTING.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ cargo install bindgen-cli --vers 0.70.1
1111

1212
### Linux Kernel
1313
Generating bindings depends on the Linux kernel, so you need to have the
14-
repository on your machine:
14+
repository on your machine. Replace `v6.9` with the kernel release for
15+
which you wish to generate bindings:
1516

1617
```bash
17-
git clone https://github.com/torvalds/linux.git
18+
git clone https://github.com/torvalds/linux.git --branch v6.9 --depth 1
1819
```
1920

2021
## Updating bindings / adding a new architecture
@@ -33,12 +34,9 @@ pushd kvm-bindings
3334
mkdir src/arm64
3435
popd
3536

36-
# linux is the repository that you cloned at the previous step.
3737
pushd linux
38-
# Step 2: Checkout the version you want to generate the bindings for.
39-
git checkout v6.9
4038

41-
# Step 3: Generate the bindings.
39+
# Step 2: Generate the bindings.
4240
# This will generate the headers for the targeted architecture and place them
4341
# in the user specified directory
4442

@@ -51,13 +49,13 @@ bindgen include/linux/kvm.h -o bindings.rs \
5149
-- -Iinclude
5250
popd
5351

54-
# Step 4: Copy the generated file to the arm64 module.
52+
# Step 3: Copy the generated file to the arm64 module.
5553
popd
5654
cp linux/"$ARCH"_headers/bindings.rs kvm-bindings/src/arm64
5755

5856
```
5957

60-
Steps 2, 3 and 4 must be repeated for all existing architectures.
58+
Steps 2 and 3 must be repeated for all existing architectures.
6159

6260
Now that we have the bindings generated, for a new architecture we can copy the
6361
module file from one of the existing modules.

0 commit comments

Comments
 (0)