Skip to content

Commit

Permalink
openwrt: update build docs to leverage git rev-parse
Browse files Browse the repository at this point in the history
  • Loading branch information
sarcasticadmin committed Jan 26, 2025
1 parent 6ea4420 commit 0f24be7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions openwrt/docs/BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ for all members of the tech team.
To start building:

```
# Make sure to mount the git root inside this container
# Make sure to mount the git rev-parse --show-toplevel) inside this container
docker run -v $(git rev-parse --show-toplevel):/home/openwrt/scale-network --rm -it sarcasticadmin/openwrt-build@sha256:3fab43fea9e698bade514af0b84192ec447708c8f24d7c5a5e383464e9c44922 /bin/bash
cd /home/openwrt/scale-network
```
Expand Down Expand Up @@ -255,7 +255,7 @@ rm -f *.config
If you already have a true common config (meaning no specific arch or arch packages inside) you can copy it in:

```
cp $(git root)/openwrt/configs/common.config ./.config
cp $(git rev-parse --show-toplevel)/openwrt/configs/common.config ./.config
```

Or create a new one:
Expand All @@ -270,29 +270,29 @@ Install only packages which are utilities and non arch specific things. We dont
the `common.config`

```
./scripts/diffconfig.sh | tee .diffconfig | grep -v CONFIG_TARGET > $(git root)/openwrt/configs/common.config
./scripts/diffconfig.sh | tee .diffconfig | grep -v CONFIG_TARGET > $(git rev-parse --show-toplevel)/openwrt/configs/common.config
```

```
comm -23 <(sort ./.diffconfig) <(sort $(git root)/openwrt/configs/common.config) > $(git root)/openwrt/configs/x86-generic.config
comm -23 <(sort ./.diffconfig) <(sort $(git rev-parse --show-toplevel)/openwrt/configs/common.config) > $(git rev-parse --show-toplevel)/openwrt/configs/x86-generic.config
```

Now we have the `common.config` and `x86-generic.config`. To add in a specific board:

```
cd <build source>
cat $(git root)/openwrt/configs/common.config > ./.config
cat $(git root)/openwrt/configs/x86_generic.config >> ./.config
cat $(git rev-parse --show-toplevel)/openwrt/configs/common.config > ./.config
cat $(git rev-parse --show-toplevel)/openwrt/configs/x86_generic.config >> ./.config
```

Run `make menuconfig` and change the arch from x86 to target arch:

```
./scripts/diffconfig.sh | tee .diffconfig | grep -v CONFIG_TARGET > $(git root)/openwrt/configs/common.config
./scripts/diffconfig.sh | tee .diffconfig | grep -v CONFIG_TARGET > $(git rev-parse --show-toplevel)/openwrt/configs/common.config
```

```
comm -23 <(sort ./.diffconfig) <(sort $(git root)/openwrt/configs/common.config) > $(git root)/openwrt/configs/mt7622-generic.config
comm -23 <(sort ./.diffconfig) <(sort $(git rev-parse --show-toplevel)/openwrt/configs/common.config) > $(git rev-parse --show-toplevel)/openwrt/configs/mt7622-generic.config
```

> Assuming mt7622 is our target arch
Expand Down

0 comments on commit 0f24be7

Please sign in to comment.