Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3ea090ba17 | |||
| c7803807e6 | |||
| 603f738f8a | |||
| f3869f8ae6 | |||
| a7f0cbea9c | |||
| 6d90c7ebca | |||
| 1e20f93562 | |||
| 719ef5ea40 | |||
| 14481a2939 | |||
| bacddccd76 | |||
| b95cd7b030 | |||
| d857eaad1c | |||
| 1230b7dd43 | |||
| 127eb68fd4 | |||
| e9e9c6cf07 | |||
| df4320a2ce | |||
| 956ec1dd44 | |||
| 237adc5efe | |||
| f6f5ce3e88 | |||
| c96999abed | |||
| 00e3ad2a80 | |||
| 002757909d | |||
| 7321394be1 | |||
| 16357f1941 | |||
| 0aaa51bed0 | |||
| 402ec9f263 | |||
| 8fe419c23d |
@@ -2,5 +2,6 @@ menu "RPI Common packages"
|
|||||||
|
|
||||||
source "$BR2_EXTERNAL_RPI_COMMON_PATH/package/my-shared-lib/Config.in"
|
source "$BR2_EXTERNAL_RPI_COMMON_PATH/package/my-shared-lib/Config.in"
|
||||||
source "$BR2_EXTERNAL_RPI_COMMON_PATH/package/my-common-tool/Config.in"
|
source "$BR2_EXTERNAL_RPI_COMMON_PATH/package/my-common-tool/Config.in"
|
||||||
|
source "$BR2_EXTERNAL_RPI_COMMON_PATH/package/gfxcanvas/Config.in"
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
|||||||
304
README.md
304
README.md
@@ -1,8 +1,13 @@
|
|||||||
# br2-external-common
|
# common-raspberrypi
|
||||||
|
|
||||||
Common Buildroot BR2_EXTERNAL tree for all Raspberry Pi projects. This
|
Common Buildroot BR2_EXTERNAL tree for Raspberry Pi projects. This repository
|
||||||
repository provides shared board support, packages, rootfs overlays, and
|
provides shared board support, packages, rootfs overlays, and patches that are
|
||||||
patches that are used across multiple projects.
|
used across multiple projects.
|
||||||
|
|
||||||
|
Supported boards:
|
||||||
|
|
||||||
|
- Raspberry Pi 1 Model B+
|
||||||
|
- Raspberry Pi Zero W
|
||||||
|
|
||||||
This repository also pins the upstream Buildroot version as a git submodule,
|
This repository also pins the upstream Buildroot version as a git submodule,
|
||||||
serving as the single source of truth for which Buildroot release is used. When
|
serving as the single source of truth for which Buildroot release is used. When
|
||||||
@@ -11,29 +16,61 @@ a project pulls in this repo, it transitively gets the tested Buildroot version.
|
|||||||
## Repository layout
|
## Repository layout
|
||||||
|
|
||||||
```
|
```
|
||||||
br2-external-common/
|
common-raspberrypi/
|
||||||
├── external.desc Buildroot external tree descriptor (name: RPI_COMMON)
|
├── external.desc Buildroot external tree descriptor (name: RPI_COMMON)
|
||||||
├── external.mk Includes all common package .mk files
|
├── external.mk Includes all common package .mk files
|
||||||
├── Config.in Top-level Kconfig menu for common packages
|
├── Config.in Top-level Kconfig menu for common packages
|
||||||
├── Makefile Wrapper for standalone build invocations
|
├── Makefile Wrapper for standalone build invocations
|
||||||
|
├── flash.sh SD card flashing helper script
|
||||||
├── buildroot/ [submodule] Upstream Buildroot, pinned to release tag
|
├── buildroot/ [submodule] Upstream Buildroot, pinned to release tag
|
||||||
├── board/
|
├── board/
|
||||||
│ └── raspberrypi/
|
│ └── raspberrypi/
|
||||||
│ ├── post_build.sh Shared post-build script (rootfs fixups)
|
│ ├── post-build.sh Shared post-build script (mdev rules, networking, build-info)
|
||||||
│ ├── post_image.sh Shared post-image script (genimage invocation)
|
│ ├── post-image.sh Shared post-image script (genimage invocation)
|
||||||
│ ├── genimage.cfg SD card partition layout
|
│ ├── genimage.cfg.in SD card partition layout template
|
||||||
│ └── overlay/ Shared rootfs overlay (copied into target rootfs)
|
│ ├── config_common.txt Raspberry Pi firmware config.txt
|
||||||
│ └── etc/
|
│ ├── cmdline_common.txt Kernel command line
|
||||||
│ └── network/
|
│ ├── extlinux.conf U-Boot extlinux boot configuration
|
||||||
│ └── interfaces
|
│ ├── linux_defconfig Custom Linux kernel configuration
|
||||||
├── package/
|
│ ├── uboot_defconfig Custom U-Boot configuration
|
||||||
│ ├── my-shared-lib/ Example shared library (CMake package)
|
│ ├── device_table.txt File permission fixups (SSH keys, mdev scripts)
|
||||||
│ └── my-common-tool/ Example shared tool (generic package)
|
│ ├── dtoverlay/ Custom device tree overlays
|
||||||
|
│ ├── uboot-patches/ Patches applied to U-Boot (DT overlay support)
|
||||||
|
│ └── rootfs-overlay/ Shared rootfs overlay (copied into target rootfs)
|
||||||
|
│ ├── etc/
|
||||||
|
│ │ ├── ssh/ Development SSH host keys
|
||||||
|
│ │ └── wpa_supplicant.conf
|
||||||
|
│ └── lib/
|
||||||
|
│ └── mdev/ Hotplug scripts (USB modeswitch, WLAN setup)
|
||||||
|
├── package/ Shared Buildroot packages
|
||||||
├── patches/ Patches to upstream Buildroot packages
|
├── patches/ Patches to upstream Buildroot packages
|
||||||
└── configs/
|
└── configs/
|
||||||
└── rpi_common_test_defconfig Minimal defconfig for standalone CI testing
|
└── raspberrypi_common_defconfig Defconfig for standalone builds
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Boot architecture
|
||||||
|
|
||||||
|
The system boots through the Raspberry Pi firmware into U-Boot, which then
|
||||||
|
loads the Linux kernel via extlinux:
|
||||||
|
|
||||||
|
1. **Raspberry Pi firmware** (`bootcode.bin`, `start.elf`) — reads
|
||||||
|
`config.txt` (generated from `config_common.txt`), loads `u-boot.bin`.
|
||||||
|
2. **U-Boot** — reads `extlinux/extlinux.conf`, loads the kernel (`zImage`),
|
||||||
|
device tree, and device tree overlays.
|
||||||
|
3. **Linux kernel** — boots with the command line from `extlinux.conf`.
|
||||||
|
|
||||||
|
U-Boot is patched (via `uboot-patches/`) to support device tree overlays.
|
||||||
|
The `genimage.cfg.in` template is expanded at build time by `post-image.sh`
|
||||||
|
to produce the final SD card image with a FAT boot partition and an ext4
|
||||||
|
rootfs partition.
|
||||||
|
|
||||||
|
### Board selection
|
||||||
|
|
||||||
|
The default device tree targets the Raspberry Pi 1 B+. To build for the
|
||||||
|
Raspberry Pi Zero W, edit `config_common.txt` and `extlinux.conf` to
|
||||||
|
uncomment the Zero W device tree and comment out the B+ one. See the comments
|
||||||
|
in those files for details.
|
||||||
|
|
||||||
## Standalone setup
|
## Standalone setup
|
||||||
|
|
||||||
Use this to develop and test the common tree without any project-specific
|
Use this to develop and test the common tree without any project-specific
|
||||||
@@ -52,40 +89,43 @@ sudo apt-get install -y build-essential gcc g++ bash patch gzip bzip2 \
|
|||||||
### Clone and initialize
|
### Clone and initialize
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
git clone git@github.com:your-org/br2-external-common.git
|
git clone git@github.com:your-org/common-raspberrypi.git
|
||||||
cd br2-external-common
|
cd common-raspberrypi
|
||||||
git submodule update --init
|
git submodule update --init
|
||||||
```
|
```
|
||||||
|
|
||||||
This pulls the Buildroot source into `buildroot/` at the pinned release tag.
|
This pulls the Buildroot source into `buildroot/` at the pinned release tag.
|
||||||
|
|
||||||
### Build the test image
|
### Build the image
|
||||||
|
|
||||||
The wrapper Makefile handles the Buildroot invocation:
|
The wrapper Makefile passes any target through to Buildroot:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
make defconfig # Loads rpi_common_test_defconfig
|
make raspberrypi_common_defconfig # Load the defconfig
|
||||||
make # Builds the full image (takes a while on first run)
|
make # Build the full image (takes a while on first run)
|
||||||
```
|
```
|
||||||
|
|
||||||
The SD card image will be at `output/images/sdcard.img`.
|
The SD card image will be at `output/images/sdcard.img`.
|
||||||
|
|
||||||
|
### Flash the SD card
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo ./flash.sh /dev/sdX
|
||||||
|
```
|
||||||
|
|
||||||
|
The script validates that the target device is removable, unmounts any
|
||||||
|
mounted partitions, and writes the image with progress output.
|
||||||
|
|
||||||
### Useful build commands
|
### Useful build commands
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
make menuconfig # Open Buildroot configuration menu
|
make menuconfig # Open Buildroot configuration menu
|
||||||
make savedefconfig # Save current .config back to the test defconfig
|
make savedefconfig # Save current .config back to the defconfig
|
||||||
make linux-rebuild # Rebuild just the kernel (any Buildroot target works)
|
make linux-rebuild # Rebuild just the kernel (any Buildroot target works)
|
||||||
make my-shared-lib-rebuild # Rebuild a specific package
|
|
||||||
make clean # Clean build artifacts
|
make clean # Clean build artifacts
|
||||||
make distclean # Remove the entire output directory
|
|
||||||
```
|
```
|
||||||
|
|
||||||
You can use a different defconfig by passing DEFCONFIG:
|
Any valid Buildroot target is passed through directly by the Makefile.
|
||||||
|
|
||||||
```sh
|
|
||||||
make defconfig DEFCONFIG=rpi_common_minimal_defconfig
|
|
||||||
```
|
|
||||||
|
|
||||||
## Creating a new project
|
## Creating a new project
|
||||||
|
|
||||||
@@ -96,15 +136,15 @@ project-specific packages, overlays, defconfigs, and board overrides.
|
|||||||
### Step 1: Create the project repository
|
### Step 1: Create the project repository
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
mkdir br2-external-myproject
|
mkdir myproject-raspberrypi
|
||||||
cd br2-external-myproject
|
cd myproject-raspberrypi
|
||||||
git init
|
git init
|
||||||
```
|
```
|
||||||
|
|
||||||
### Step 2: Add common as a submodule
|
### Step 2: Add common as a submodule
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
git submodule add git@github.com:your-org/br2-external-common.git common
|
git submodule add git@github.com:your-org/common-raspberrypi.git common
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -121,7 +161,17 @@ name: MY_PROJECT
|
|||||||
desc: My project-specific Buildroot configuration
|
desc: My project-specific Buildroot configuration
|
||||||
```
|
```
|
||||||
|
|
||||||
### Step 4: Create external.mk
|
### Step 4: Create supporting directories
|
||||||
|
|
||||||
|
```sh
|
||||||
|
mkdir -p rootfs-overlay/etc
|
||||||
|
mkdir -p package
|
||||||
|
mkdir -p configs
|
||||||
|
|
||||||
|
echo '/output/' > .gitignore
|
||||||
|
```
|
||||||
|
|
||||||
|
### Step 5: Create external.mk
|
||||||
|
|
||||||
This file includes only the project's own packages. The common packages are
|
This file includes only the project's own packages. The common packages are
|
||||||
handled by the common tree's own `external.mk` — Buildroot merges them
|
handled by the common tree's own `external.mk` — Buildroot merges them
|
||||||
@@ -131,108 +181,70 @@ automatically because both trees are passed as separate BR2_EXTERNAL paths.
|
|||||||
include $(sort $(wildcard $(BR2_EXTERNAL_MY_PROJECT_PATH)/package/*/*.mk))
|
include $(sort $(wildcard $(BR2_EXTERNAL_MY_PROJECT_PATH)/package/*/*.mk))
|
||||||
```
|
```
|
||||||
|
|
||||||
### Step 5: Create Config.in
|
### Step 6: Create Config.in
|
||||||
|
|
||||||
Same principle — only source the project's own package configs:
|
Same principle — only source the project's own package configs. This file
|
||||||
|
can start empty and be populated as packages are added:
|
||||||
|
|
||||||
```
|
```
|
||||||
menu "My Project packages"
|
menu "My Project packages"
|
||||||
|
|
||||||
source "$BR2_EXTERNAL_MY_PROJECT_PATH/package/my-app/Config.in"
|
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
```
|
```
|
||||||
|
|
||||||
### Step 6: Create a project defconfig
|
### Step 7: Create a project defconfig
|
||||||
|
|
||||||
Create `configs/rpi_myproject_defconfig`. Start by copying the common test
|
Create `configs/raspberrypi_myproject_defconfig`. Start by copying the common
|
||||||
defconfig and modify it:
|
defconfig and modify it:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cp common/configs/rpi_common_test_defconfig configs/rpi_myproject_defconfig
|
cp common/configs/raspberrypi_common_defconfig configs/raspberrypi_myproject_defconfig
|
||||||
```
|
```
|
||||||
|
|
||||||
Edit the defconfig to:
|
Edit the defconfig to add both overlays (common first, then project-specific):
|
||||||
|
|
||||||
1. Add both overlays (common first, then project-specific):
|
|
||||||
|
|
||||||
```
|
```
|
||||||
BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_RPI_COMMON_PATH)/board/raspberrypi/overlay $(BR2_EXTERNAL_MY_PROJECT_PATH)/overlay"
|
BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_RPI_COMMON_PATH)/board/raspberrypi/rootfs-overlay $(BR2_EXTERNAL_MY_PROJECT_PATH)/rootfs-overlay"
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Add project-specific packages:
|
### Step 8: Create the wrapper Makefile
|
||||||
|
|
||||||
```
|
Create a `Makefile` at the project root. Like the common Makefile, it uses a
|
||||||
BR2_PACKAGE_MY_APP=y
|
catch-all rule to pass any Buildroot target through directly:
|
||||||
```
|
|
||||||
|
|
||||||
The common packages (`BR2_PACKAGE_MY_SHARED_LIB`, etc.) remain as-is.
|
|
||||||
|
|
||||||
### Step 7: Create the wrapper Makefile
|
|
||||||
|
|
||||||
Create a `Makefile` at the project root:
|
|
||||||
|
|
||||||
```makefile
|
```makefile
|
||||||
BUILDROOT_DIR := $(CURDIR)/common/buildroot
|
BUILDROOT_DIR := $(CURDIR)/common/buildroot
|
||||||
OUTPUT_DIR := $(CURDIR)/output
|
OUTPUT_DIR := $(CURDIR)/output
|
||||||
BR2_EXTERNAL := $(CURDIR)/common:$(CURDIR)
|
BR2_EXTERNAL := $(CURDIR)/common:$(CURDIR)
|
||||||
|
|
||||||
DEFCONFIG ?= rpi_myproject_defconfig
|
|
||||||
|
|
||||||
CONFIG_EXISTS := $(wildcard $(OUTPUT_DIR)/.config)
|
CONFIG_EXISTS := $(wildcard $(OUTPUT_DIR)/.config)
|
||||||
|
|
||||||
.PHONY: all defconfig menuconfig savedefconfig clean distclean
|
.PHONY: all
|
||||||
|
|
||||||
all:
|
all:
|
||||||
ifeq ($(CONFIG_EXISTS),)
|
ifeq ($(CONFIG_EXISTS),)
|
||||||
@echo "No .config found. Run 'make defconfig' first."
|
@echo "No .config found. Load a defconfig first, e.g.:"
|
||||||
|
@echo " make raspberrypi_myproject_defconfig"
|
||||||
@exit 1
|
@exit 1
|
||||||
endif
|
endif
|
||||||
$(MAKE) -C $(BUILDROOT_DIR) BR2_EXTERNAL=$(BR2_EXTERNAL) O=$(OUTPUT_DIR)
|
$(MAKE) -C $(BUILDROOT_DIR) BR2_EXTERNAL=$(BR2_EXTERNAL) O=$(OUTPUT_DIR)
|
||||||
|
|
||||||
defconfig:
|
|
||||||
$(MAKE) -C $(BUILDROOT_DIR) BR2_EXTERNAL=$(BR2_EXTERNAL) O=$(OUTPUT_DIR) $(DEFCONFIG)
|
|
||||||
|
|
||||||
menuconfig:
|
|
||||||
$(MAKE) -C $(BUILDROOT_DIR) BR2_EXTERNAL=$(BR2_EXTERNAL) O=$(OUTPUT_DIR) menuconfig
|
|
||||||
|
|
||||||
savedefconfig:
|
|
||||||
$(MAKE) -C $(BUILDROOT_DIR) BR2_EXTERNAL=$(BR2_EXTERNAL) O=$(OUTPUT_DIR) savedefconfig \
|
|
||||||
BR2_DEFCONFIG=$(CURDIR)/configs/$(DEFCONFIG)
|
|
||||||
|
|
||||||
clean:
|
|
||||||
$(MAKE) -C $(BUILDROOT_DIR) BR2_EXTERNAL=$(BR2_EXTERNAL) O=$(OUTPUT_DIR) clean
|
|
||||||
|
|
||||||
distclean:
|
|
||||||
rm -rf $(OUTPUT_DIR)
|
|
||||||
|
|
||||||
%:
|
%:
|
||||||
$(MAKE) -C $(BUILDROOT_DIR) BR2_EXTERNAL=$(BR2_EXTERNAL) O=$(OUTPUT_DIR) $@
|
$(MAKE) -C $(BUILDROOT_DIR) BR2_EXTERNAL=$(BR2_EXTERNAL) O=$(OUTPUT_DIR) $@
|
||||||
```
|
```
|
||||||
|
|
||||||
Note the key difference from the common Makefile:
|
Note the key differences from the common Makefile:
|
||||||
|
|
||||||
- `BUILDROOT_DIR` points to `common/buildroot/` (nested submodule)
|
- `BUILDROOT_DIR` points to `common/buildroot/` (nested submodule)
|
||||||
- `BR2_EXTERNAL` lists both trees, colon-separated: `common:project`
|
- `BR2_EXTERNAL` lists both trees, colon-separated: `common:project`
|
||||||
|
|
||||||
### Step 8: Create supporting directories
|
|
||||||
|
|
||||||
```sh
|
|
||||||
mkdir -p overlay/etc
|
|
||||||
mkdir -p package
|
|
||||||
mkdir -p board
|
|
||||||
mkdir -p configs
|
|
||||||
|
|
||||||
echo '/output/' > .gitignore
|
|
||||||
```
|
|
||||||
|
|
||||||
### Step 9: Commit and build
|
### Step 9: Commit and build
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
git add -A
|
git add -A
|
||||||
git commit -m "Initial project skeleton"
|
git commit -m "Initial project skeleton"
|
||||||
|
|
||||||
make defconfig
|
make raspberrypi_myproject_defconfig
|
||||||
make
|
make
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -241,100 +253,74 @@ make
|
|||||||
After following these steps, your project should look like this:
|
After following these steps, your project should look like this:
|
||||||
|
|
||||||
```
|
```
|
||||||
br2-external-myproject/
|
myproject-raspberrypi/
|
||||||
├── external.desc
|
├── external.desc
|
||||||
├── external.mk
|
├── external.mk
|
||||||
├── Config.in
|
├── Config.in
|
||||||
├── Makefile
|
├── Makefile
|
||||||
├── .gitmodules
|
├── .gitmodules
|
||||||
├── .gitignore
|
├── .gitignore
|
||||||
├── common/ [submodule -> br2-external-common]
|
├── common/ [submodule -> common-raspberrypi]
|
||||||
│ ├── buildroot/ [nested submodule -> upstream Buildroot]
|
│ ├── buildroot/ [nested submodule -> upstream Buildroot]
|
||||||
│ ├── board/raspberrypi/
|
│ ├── board/raspberrypi/
|
||||||
│ ├── package/
|
│ ├── package/
|
||||||
│ └── ...
|
│ └── ...
|
||||||
├── configs/
|
├── configs/
|
||||||
│ └── rpi_myproject_defconfig
|
│ └── raspberrypi_myproject_defconfig
|
||||||
├── overlay/ Project-specific rootfs overlay
|
├── rootfs-overlay/ Project-specific rootfs overlay
|
||||||
├── package/ Project-specific packages
|
├── package/ Project-specific packages
|
||||||
│ └── my-app/
|
|
||||||
└── output/ Build output (gitignored)
|
└── output/ Build output (gitignored)
|
||||||
```
|
```
|
||||||
|
|
||||||
## Branching strategy
|
## Wireless networking
|
||||||
|
|
||||||
This repository uses long-lived branches to support multiple Buildroot
|
The build includes support for USB Wi-Fi adapters based on the Realtek
|
||||||
versions simultaneously, mirroring Buildroot's own LTS release model.
|
RTL8821CU chipset, as well as the Raspberry Pi Zero W's built-in Wi-Fi
|
||||||
|
(Broadcom BCM43430). Both paths end with wpa_supplicant handling
|
||||||
|
authentication and DHCP providing an IP address.
|
||||||
|
|
||||||
### Branch naming
|
### Raspberry Pi Zero W (built-in Wi-Fi)
|
||||||
|
|
||||||
- `main` — Tracks the latest Buildroot release (currently 2026.02). Active
|
The Zero W's Broadcom BCM43430 is connected via SDIO. The `brcmfmac` driver
|
||||||
development of shared packages happens here.
|
and firmware blobs (included via `BR2_PACKAGE_BRCMFMAC_SDIO_FIRMWARE_RPI`)
|
||||||
- `YYYY.MM.x` — Maintenance branches for older Buildroot LTS lines (e.g.,
|
are loaded at boot. The `wlan0` interface is brought up automatically by the
|
||||||
`2023.02.x`). These receive only bug fixes and minor Buildroot bumps within
|
`auto wlan0` stanza in `/etc/network/interfaces` (appended by
|
||||||
the same LTS series.
|
`post-build.sh`), which starts `wpa_supplicant` and obtains an IP via DHCP.
|
||||||
|
|
||||||
### Creating a maintenance branch
|
### USB RTL8821CU adapters
|
||||||
|
|
||||||
When a project needs to stay on an older Buildroot version:
|
RTL8821CU adapters require an extra USB modeswitch step, handled through
|
||||||
|
mdev hotplug rules:
|
||||||
|
|
||||||
```sh
|
1. **USB modeswitch** — the adapter initially enumerates as a CD-ROM device
|
||||||
# Start from the last commit that used the older Buildroot
|
(`0bda:1a2b`). An mdev rule triggers `usb_modeswitch` to switch it into
|
||||||
git checkout -b 2023.02.x <commit-hash>
|
Wi-Fi mode (`0bda:c820`).
|
||||||
|
2. **WLAN setup** — once the Wi-Fi device appears, a second mdev rule runs
|
||||||
|
`wlan_setup.sh`, which brings up `wlan0` and starts `wpa_supplicant`.
|
||||||
|
3. **DHCP** — the interface obtains an IP address via DHCP.
|
||||||
|
|
||||||
# Verify the buildroot submodule points to the right tag
|
### Configuring Wi-Fi credentials
|
||||||
cd buildroot
|
|
||||||
git log --oneline -1 # Should show 2023.02.x tag
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
git push -u origin 2023.02.x
|
Edit `board/raspberrypi/rootfs-overlay/etc/wpa_supplicant.conf` with the
|
||||||
|
target network's SSID and passphrase:
|
||||||
|
|
||||||
|
```
|
||||||
|
network={
|
||||||
|
ssid="MyNetwork"
|
||||||
|
psk="MyPassphrase"
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Bumping a minor Buildroot version on a maintenance branch
|
### Post-build rootfs modifications
|
||||||
|
|
||||||
For example, upgrading from 2023.02.1 to 2023.02.2:
|
The `post-build.sh` script makes the following modifications to the target
|
||||||
|
rootfs at build time:
|
||||||
|
|
||||||
```sh
|
- Adds mdev rules for USB modeswitch (`rtl8821cu_usb_modeswitch.sh`) and
|
||||||
git checkout 2023.02.x
|
WLAN setup (`wlan_setup.sh`).
|
||||||
|
- Appends `wlan0` configuration to `/etc/network/interfaces` (DHCP with
|
||||||
cd buildroot
|
wpa_supplicant).
|
||||||
git fetch --tags
|
- Generates `/etc/build-info` with the build user, date, and git revision.
|
||||||
git checkout 2023.02.2
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
git add buildroot
|
|
||||||
git commit -m "buildroot: bump to 2023.02.2"
|
|
||||||
git push
|
|
||||||
```
|
|
||||||
|
|
||||||
Then in the project that uses this branch:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cd common
|
|
||||||
git pull origin 2023.02.x
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
git add common
|
|
||||||
git commit -m "common: pick up buildroot 2023.02.2"
|
|
||||||
```
|
|
||||||
|
|
||||||
### Backporting shared package fixes
|
|
||||||
|
|
||||||
When a bug fix on `main` also applies to a maintenance branch:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
git checkout 2023.02.x
|
|
||||||
git cherry-pick <commit-hash-from-main>
|
|
||||||
# Resolve conflicts if the package versions have diverged
|
|
||||||
# Test with: make defconfig && make
|
|
||||||
git push
|
|
||||||
```
|
|
||||||
|
|
||||||
### End-of-life
|
|
||||||
|
|
||||||
When a legacy project is decommissioned, its maintenance branch can be
|
|
||||||
archived (renamed to `archive/2023.02.x`) or deleted. No other projects
|
|
||||||
are affected.
|
|
||||||
|
|
||||||
## Adding a new shared package
|
## Adding a new shared package
|
||||||
|
|
||||||
@@ -342,15 +328,15 @@ are affected.
|
|||||||
2. Add a `Config.in` with the Kconfig entry.
|
2. Add a `Config.in` with the Kconfig entry.
|
||||||
3. Add a `.mk` file with the Buildroot package recipe.
|
3. Add a `.mk` file with the Buildroot package recipe.
|
||||||
4. Source the new `Config.in` in the top-level `Config.in`.
|
4. Source the new `Config.in` in the top-level `Config.in`.
|
||||||
5. Enable the package in `configs/rpi_common_test_defconfig`.
|
5. Enable the package in `configs/raspberrypi_common_defconfig`.
|
||||||
6. Build and verify: `make my-new-package-rebuild`.
|
6. Build and verify: `make my-new-package-rebuild`.
|
||||||
|
|
||||||
See `package/my-shared-lib/` (CMake example) and `package/my-common-tool/`
|
|
||||||
(generic example) for reference.
|
|
||||||
|
|
||||||
## Adding patches to upstream Buildroot packages
|
## Adding patches to upstream Buildroot packages
|
||||||
|
|
||||||
Place patch files under `patches/<package-name>/`. Buildroot automatically
|
Place patch files under `patches/<package-name>/`. Buildroot automatically
|
||||||
applies patches from `BR2_EXTERNAL_RPI_COMMON_PATH/patches/<package-name>/`
|
applies patches from `BR2_EXTERNAL_RPI_COMMON_PATH/patches/<package-name>/`
|
||||||
during the package build. Patches must follow Buildroot's naming convention:
|
during the package build. Patches must follow Buildroot's naming convention:
|
||||||
`NNNN-description.patch` (e.g., `0001-fix-cross-compilation.patch`).
|
`NNNN-description.patch` (e.g., `0001-fix-cross-compilation.patch`).
|
||||||
|
|
||||||
|
U-Boot patches live separately under `board/raspberrypi/uboot-patches/` and
|
||||||
|
are applied via the `BR2_TARGET_UBOOT_PATCH` defconfig option.
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
# Please note that this is only a sample, we recommend you to change it to fit
|
|
||||||
# your needs.
|
|
||||||
# You should override this file using BR2_PACKAGE_RPI_FIRMWARE_CONFIG_FILE.
|
|
||||||
# See http://buildroot.org/manual.html#rootfs-custom
|
# See http://buildroot.org/manual.html#rootfs-custom
|
||||||
# and http://elinux.org/RPiconfig for a description of config.txt syntax
|
# and http://elinux.org/RPiconfig for a description of config.txt syntax
|
||||||
|
|
||||||
start_file=start.elf
|
start_file=start.elf
|
||||||
fixup_file=fixup.dat
|
fixup_file=fixup.dat
|
||||||
|
|
||||||
kernel=zImage
|
# Device tree to be used bu U-Boot:
|
||||||
|
device_tree=bcm2835-rpi-b-plus.dtb
|
||||||
|
#device_tree=bcm2835-rpi-zero-w.dtb
|
||||||
|
kernel=u-boot.bin
|
||||||
|
|
||||||
# To use an external initramfs file
|
# To use an external initramfs file
|
||||||
#initramfs rootfs.cpio.gz
|
#initramfs rootfs.cpio.gz
|
||||||
@@ -15,9 +15,10 @@ kernel=zImage
|
|||||||
# Disable overscan assuming the display supports displaying the full resolution
|
# Disable overscan assuming the display supports displaying the full resolution
|
||||||
# If the text shown on the screen disappears off the edge, comment this out
|
# If the text shown on the screen disappears off the edge, comment this out
|
||||||
disable_overscan=1
|
disable_overscan=1
|
||||||
|
enable_uart=1
|
||||||
|
|
||||||
# How much memory in MB to assign to the GPU on Pi models having
|
# How much memory in MB to assign to the GPU on Pi models having
|
||||||
# 256, 512 or 1024 MB total memory
|
# 256, 512 or 1024 MB total memory
|
||||||
gpu_mem_256=100
|
gpu_mem_256=64
|
||||||
gpu_mem_512=100
|
gpu_mem_512=64
|
||||||
gpu_mem_1024=100
|
gpu_mem_1024=128
|
||||||
|
|||||||
12
board/raspberrypi/device_table.txt
Normal file
12
board/raspberrypi/device_table.txt
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# <name> <type> <mode> <uid> <gid> <major> <minor> <start> <inc> <count>
|
||||||
|
|
||||||
|
# ssh keys
|
||||||
|
/etc/ssh/ssh_host_ecdsa_key f 600 0 0 - - - - -
|
||||||
|
/etc/ssh/ssh_host_ed25519_key f 600 0 0 - - - - -
|
||||||
|
/etc/ssh/ssh_host_rsa_key f 600 0 0 - - - - -
|
||||||
|
|
||||||
|
#rtl8821cu usb modeswitch script
|
||||||
|
/lib/mdev/rtl8821cu_usb_modeswitch.sh f 755 0 0 - - - - -
|
||||||
|
|
||||||
|
# WLAN setup
|
||||||
|
/lib/mdev/wlan_setup.sh f 755 0 0 - - - - -
|
||||||
20
board/raspberrypi/dtoverlay/broadcom/ssd1306.dtso
Normal file
20
board/raspberrypi/dtoverlay/broadcom/ssd1306.dtso
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
/dts-v1/;
|
||||||
|
/plugin/;
|
||||||
|
|
||||||
|
/ {
|
||||||
|
compatible = "brcm,bcm2835";
|
||||||
|
|
||||||
|
fragment@0 {
|
||||||
|
target = <&i2c1>;
|
||||||
|
__overlay__ {
|
||||||
|
ssd1306: oled@3c {
|
||||||
|
compatible = "solomon,ssd1306fb-i2c";
|
||||||
|
reg = <0x3c>;
|
||||||
|
solomon,width = <128>;
|
||||||
|
solomon,height = <64>;
|
||||||
|
solomon,page-offset = <0>;
|
||||||
|
solomon,com-invdir;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
9
board/raspberrypi/extlinux.conf
Normal file
9
board/raspberrypi/extlinux.conf
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
label buildroot
|
||||||
|
kernel /zImage
|
||||||
|
devicetree /bcm2835-rpi-b-plus.dtb
|
||||||
|
# devicetree /bcm2835-rpi-zero-w.dtb
|
||||||
|
devicetree-overlay /ssd1306.dtbo
|
||||||
|
append root=/dev/mmcblk0p2 rootwait console=tty1 console=ttyAMA0,115200
|
||||||
|
|
||||||
|
# In Raspberry Pi Zero W, the mini-uart is used for console instead of the PL011:
|
||||||
|
# append root=/dev/mmcblk0p2 rootwait console=tty1 console=ttyS1,115200
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
/* genimage.cfg - SD card image layout for Raspberry Pi
|
|
||||||
*
|
|
||||||
* Partition layout:
|
|
||||||
* - boot (FAT32, 64MB): kernel, device tree, bootloader files
|
|
||||||
* - rootfs (ext4, 256MB): root filesystem
|
|
||||||
*
|
|
||||||
* The final image is written to sdcard.img.
|
|
||||||
*
|
|
||||||
* Adjust partition sizes as needed for your project. Projects can
|
|
||||||
* override this file by providing their own genimage.cfg and setting
|
|
||||||
* GENIMAGE_CFG in their post-image script.
|
|
||||||
*/
|
|
||||||
|
|
||||||
image boot.vfat {
|
|
||||||
vfat {
|
|
||||||
files = {
|
|
||||||
"bcm2710-rpi-3-b.dtb",
|
|
||||||
"bcm2711-rpi-4-b.dtb",
|
|
||||||
"rpi-firmware/bootcode.bin",
|
|
||||||
"rpi-firmware/start.elf",
|
|
||||||
"rpi-firmware/fixup.dat",
|
|
||||||
"rpi-firmware/config.txt",
|
|
||||||
"rpi-firmware/cmdline.txt",
|
|
||||||
"Image"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
size = 64M
|
|
||||||
}
|
|
||||||
|
|
||||||
image rootfs.ext4 {
|
|
||||||
ext4 {
|
|
||||||
label = "rootfs"
|
|
||||||
}
|
|
||||||
|
|
||||||
size = 256M
|
|
||||||
}
|
|
||||||
|
|
||||||
image sdcard.img {
|
|
||||||
hdimage {
|
|
||||||
}
|
|
||||||
|
|
||||||
partition boot {
|
|
||||||
partition-type = 0xC
|
|
||||||
bootable = "true"
|
|
||||||
image = "boot.vfat"
|
|
||||||
}
|
|
||||||
|
|
||||||
partition rootfs {
|
|
||||||
partition-type = 0x83
|
|
||||||
image = "rootfs.ext4"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
25
board/raspberrypi/genimage.cfg.in
Normal file
25
board/raspberrypi/genimage.cfg.in
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
image boot.vfat {
|
||||||
|
vfat {
|
||||||
|
files = {
|
||||||
|
#BOOT_FILES#
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
size = 32M
|
||||||
|
}
|
||||||
|
|
||||||
|
image sdcard.img {
|
||||||
|
hdimage {
|
||||||
|
}
|
||||||
|
|
||||||
|
partition boot {
|
||||||
|
partition-type = 0xC
|
||||||
|
bootable = "true"
|
||||||
|
image = "boot.vfat"
|
||||||
|
}
|
||||||
|
|
||||||
|
partition rootfs {
|
||||||
|
partition-type = 0x83
|
||||||
|
image = "rootfs.ext4"
|
||||||
|
}
|
||||||
|
}
|
||||||
192
board/raspberrypi/linux_defconfig
Normal file
192
board/raspberrypi/linux_defconfig
Normal file
@@ -0,0 +1,192 @@
|
|||||||
|
# CONFIG_LOCALVERSION_AUTO is not set
|
||||||
|
CONFIG_SYSVIPC=y
|
||||||
|
CONFIG_NO_HZ_IDLE=y
|
||||||
|
CONFIG_HIGH_RES_TIMERS=y
|
||||||
|
CONFIG_PREEMPT_VOLUNTARY=y
|
||||||
|
CONFIG_BSD_PROCESS_ACCT=y
|
||||||
|
CONFIG_BSD_PROCESS_ACCT_V3=y
|
||||||
|
CONFIG_LOG_BUF_SHIFT=18
|
||||||
|
CONFIG_CFS_BANDWIDTH=y
|
||||||
|
CONFIG_RT_GROUP_SCHED=y
|
||||||
|
CONFIG_CGROUP_FREEZER=y
|
||||||
|
CONFIG_CGROUP_DEVICE=y
|
||||||
|
CONFIG_CGROUP_CPUACCT=y
|
||||||
|
CONFIG_CGROUP_PERF=y
|
||||||
|
CONFIG_NAMESPACES=y
|
||||||
|
CONFIG_SCHED_AUTOGROUP=y
|
||||||
|
CONFIG_RELAY=y
|
||||||
|
CONFIG_BLK_DEV_INITRD=y
|
||||||
|
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
|
||||||
|
CONFIG_EXPERT=y
|
||||||
|
CONFIG_KALLSYMS_ALL=y
|
||||||
|
CONFIG_PROFILING=y
|
||||||
|
CONFIG_KEXEC=y
|
||||||
|
CONFIG_ARCH_MULTI_V6=y
|
||||||
|
CONFIG_ARCH_BCM=y
|
||||||
|
CONFIG_ARCH_BCM2835=y
|
||||||
|
CONFIG_CPU_FREQ=y
|
||||||
|
CONFIG_CPU_FREQ_STAT=y
|
||||||
|
CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE=y
|
||||||
|
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
|
||||||
|
CONFIG_CPU_FREQ_GOV_USERSPACE=y
|
||||||
|
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
|
||||||
|
CONFIG_CPUFREQ_DT=y
|
||||||
|
CONFIG_ARM_RASPBERRYPI_CPUFREQ=y
|
||||||
|
CONFIG_VFP=y
|
||||||
|
# CONFIG_SUSPEND is not set
|
||||||
|
CONFIG_PM=y
|
||||||
|
CONFIG_JUMP_LABEL=y
|
||||||
|
# CONFIG_GCC_PLUGINS is not set
|
||||||
|
CONFIG_MODULES=y
|
||||||
|
CONFIG_MODULE_UNLOAD=y
|
||||||
|
# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
|
||||||
|
# CONFIG_COMPAT_BRK is not set
|
||||||
|
CONFIG_KSM=y
|
||||||
|
CONFIG_CMA=y
|
||||||
|
CONFIG_NET=y
|
||||||
|
CONFIG_PACKET=y
|
||||||
|
CONFIG_UNIX=y
|
||||||
|
CONFIG_INET=y
|
||||||
|
CONFIG_IP_PNP=y
|
||||||
|
CONFIG_IP_PNP_DHCP=y
|
||||||
|
CONFIG_NETWORK_SECMARK=y
|
||||||
|
CONFIG_NETFILTER=y
|
||||||
|
CONFIG_BT=y
|
||||||
|
CONFIG_BT_HCIUART=m
|
||||||
|
CONFIG_BT_HCIUART_BCM=y
|
||||||
|
CONFIG_CFG80211=y
|
||||||
|
CONFIG_MAC80211=y
|
||||||
|
CONFIG_DEVTMPFS=y
|
||||||
|
CONFIG_DEVTMPFS_MOUNT=y
|
||||||
|
# CONFIG_STANDALONE is not set
|
||||||
|
CONFIG_RASPBERRYPI_FIRMWARE=y
|
||||||
|
CONFIG_SCSI=y
|
||||||
|
CONFIG_BLK_DEV_SD=y
|
||||||
|
CONFIG_SCSI_CONSTANTS=y
|
||||||
|
CONFIG_SCSI_SCAN_ASYNC=y
|
||||||
|
CONFIG_NETDEVICES=y
|
||||||
|
CONFIG_BCMGENET=y
|
||||||
|
CONFIG_USB_LAN78XX=y
|
||||||
|
CONFIG_USB_USBNET=y
|
||||||
|
CONFIG_USB_NET_SMSC95XX=y
|
||||||
|
CONFIG_BRCMFMAC=m
|
||||||
|
CONFIG_RTW88=y
|
||||||
|
CONFIG_RTW88_8821CU=y
|
||||||
|
CONFIG_RTW88_DEBUG=y
|
||||||
|
CONFIG_RTW88_DEBUGFS=y
|
||||||
|
CONFIG_ZD1211RW=y
|
||||||
|
CONFIG_INPUT_EVDEV=y
|
||||||
|
# CONFIG_LEGACY_PTYS is not set
|
||||||
|
CONFIG_SERIAL_8250=y
|
||||||
|
CONFIG_SERIAL_8250_CONSOLE=y
|
||||||
|
CONFIG_SERIAL_8250_EXTENDED=y
|
||||||
|
CONFIG_SERIAL_8250_SHARE_IRQ=y
|
||||||
|
CONFIG_SERIAL_8250_BCM2835AUX=y
|
||||||
|
CONFIG_SERIAL_AMBA_PL011=y
|
||||||
|
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
|
||||||
|
CONFIG_SERIAL_DEV_BUS=y
|
||||||
|
CONFIG_TTY_PRINTK=y
|
||||||
|
CONFIG_I2C_CHARDEV=y
|
||||||
|
CONFIG_I2C_BCM2835=y
|
||||||
|
CONFIG_SPI=y
|
||||||
|
CONFIG_SPI_BCM2835=y
|
||||||
|
CONFIG_SPI_BCM2835AUX=y
|
||||||
|
CONFIG_GPIO_SYSFS=y
|
||||||
|
CONFIG_SENSORS_RASPBERRYPI_HWMON=m
|
||||||
|
CONFIG_THERMAL=y
|
||||||
|
CONFIG_BCM2711_THERMAL=y
|
||||||
|
CONFIG_BCM2835_THERMAL=y
|
||||||
|
CONFIG_WATCHDOG=y
|
||||||
|
CONFIG_BCM2835_WDT=y
|
||||||
|
CONFIG_MFD_SYSCON=y
|
||||||
|
CONFIG_REGULATOR=y
|
||||||
|
CONFIG_REGULATOR_FIXED_VOLTAGE=y
|
||||||
|
CONFIG_REGULATOR_GPIO=y
|
||||||
|
CONFIG_MEDIA_SUPPORT=y
|
||||||
|
CONFIG_DRM=y
|
||||||
|
CONFIG_DRM_V3D=y
|
||||||
|
CONFIG_DRM_VC4=y
|
||||||
|
CONFIG_DRM_SIMPLEDRM=y
|
||||||
|
CONFIG_DRM_SSD130X=y
|
||||||
|
CONFIG_DRM_SSD130X_I2C=y
|
||||||
|
CONFIG_FB=y
|
||||||
|
CONFIG_FB_SSD1307=y
|
||||||
|
CONFIG_SOUND=y
|
||||||
|
CONFIG_SND=y
|
||||||
|
CONFIG_SND_SOC=y
|
||||||
|
CONFIG_SND_BCM2835_SOC_I2S=y
|
||||||
|
CONFIG_USB=y
|
||||||
|
CONFIG_USB_OTG=y
|
||||||
|
CONFIG_USB_STORAGE=y
|
||||||
|
CONFIG_USB_DWC2=y
|
||||||
|
CONFIG_NOP_USB_XCEIV=y
|
||||||
|
CONFIG_USB_GADGET=y
|
||||||
|
CONFIG_USB_ETH=m
|
||||||
|
CONFIG_USB_ETH_EEM=y
|
||||||
|
CONFIG_USB_G_SERIAL=m
|
||||||
|
CONFIG_MMC=y
|
||||||
|
CONFIG_MMC_SDHCI=y
|
||||||
|
CONFIG_MMC_SDHCI_PLTFM=y
|
||||||
|
CONFIG_MMC_SDHCI_IPROC=y
|
||||||
|
CONFIG_MMC_BCM2835=y
|
||||||
|
CONFIG_NEW_LEDS=y
|
||||||
|
CONFIG_LEDS_CLASS=y
|
||||||
|
CONFIG_LEDS_GPIO=y
|
||||||
|
CONFIG_LEDS_TRIGGERS=y
|
||||||
|
CONFIG_LEDS_TRIGGER_TIMER=y
|
||||||
|
CONFIG_LEDS_TRIGGER_ONESHOT=y
|
||||||
|
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
|
||||||
|
CONFIG_LEDS_TRIGGER_CPU=y
|
||||||
|
CONFIG_LEDS_TRIGGER_GPIO=y
|
||||||
|
CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
|
||||||
|
CONFIG_LEDS_TRIGGER_TRANSIENT=y
|
||||||
|
CONFIG_LEDS_TRIGGER_CAMERA=y
|
||||||
|
CONFIG_DMADEVICES=y
|
||||||
|
CONFIG_DMA_BCM2835=y
|
||||||
|
CONFIG_STAGING=y
|
||||||
|
CONFIG_FB_TFT=y
|
||||||
|
CONFIG_FB_TFT_SSD1306=y
|
||||||
|
CONFIG_SND_BCM2835=m
|
||||||
|
CONFIG_VIDEO_BCM2835=m
|
||||||
|
CONFIG_CLK_RASPBERRYPI=y
|
||||||
|
CONFIG_MAILBOX=y
|
||||||
|
CONFIG_BCM2835_MBOX=y
|
||||||
|
# CONFIG_IOMMU_SUPPORT is not set
|
||||||
|
CONFIG_RASPBERRYPI_POWER=y
|
||||||
|
CONFIG_PWM=y
|
||||||
|
CONFIG_PWM_BCM2835=y
|
||||||
|
CONFIG_EXT2_FS=y
|
||||||
|
CONFIG_EXT2_FS_XATTR=y
|
||||||
|
CONFIG_EXT2_FS_POSIX_ACL=y
|
||||||
|
CONFIG_EXT3_FS=y
|
||||||
|
CONFIG_EXT3_FS_POSIX_ACL=y
|
||||||
|
CONFIG_FANOTIFY=y
|
||||||
|
CONFIG_MSDOS_FS=y
|
||||||
|
CONFIG_VFAT_FS=y
|
||||||
|
CONFIG_TMPFS=y
|
||||||
|
CONFIG_TMPFS_POSIX_ACL=y
|
||||||
|
# CONFIG_MISC_FILESYSTEMS is not set
|
||||||
|
CONFIG_NFS_FS=y
|
||||||
|
CONFIG_ROOT_NFS=y
|
||||||
|
CONFIG_NFSD=y
|
||||||
|
CONFIG_NLS_CODEPAGE_437=y
|
||||||
|
CONFIG_NLS_ASCII=y
|
||||||
|
CONFIG_NLS_ISO8859_1=y
|
||||||
|
CONFIG_NLS_UTF8=y
|
||||||
|
# CONFIG_XZ_DEC_ARM is not set
|
||||||
|
# CONFIG_XZ_DEC_ARMTHUMB is not set
|
||||||
|
CONFIG_DMA_CMA=y
|
||||||
|
CONFIG_CMA_SIZE_MBYTES=32
|
||||||
|
CONFIG_PRINTK_TIME=y
|
||||||
|
CONFIG_BOOT_PRINTK_DELAY=y
|
||||||
|
CONFIG_DYNAMIC_DEBUG=y
|
||||||
|
CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
|
||||||
|
CONFIG_DEBUG_FS=y
|
||||||
|
CONFIG_KGDB=y
|
||||||
|
CONFIG_KGDB_KDB=y
|
||||||
|
CONFIG_DEBUG_MEMORY_INIT=y
|
||||||
|
CONFIG_FUNCTION_PROFILER=y
|
||||||
|
CONFIG_STACK_TRACER=y
|
||||||
|
CONFIG_SCHED_TRACER=y
|
||||||
|
CONFIG_STRICT_DEVMEM=y
|
||||||
|
CONFIG_TEST_KSTRTOX=y
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
# /etc/network/interfaces - Common network configuration
|
|
||||||
#
|
|
||||||
# This file is part of the shared rootfs overlay and provides a
|
|
||||||
# sensible default network configuration for all Raspberry Pi projects.
|
|
||||||
# Projects can override this by placing their own version in their
|
|
||||||
# project-specific overlay (which is applied after this one).
|
|
||||||
|
|
||||||
auto lo
|
|
||||||
iface lo inet loopback
|
|
||||||
|
|
||||||
auto eth0
|
|
||||||
iface eth0 inet dhcp
|
|
||||||
69
board/raspberrypi/post-build.sh
Executable file
69
board/raspberrypi/post-build.sh
Executable file
@@ -0,0 +1,69 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# post_build.sh - Common post-build script for Raspberry Pi
|
||||||
|
#
|
||||||
|
# Called by Buildroot after assembling the target rootfs.
|
||||||
|
# Arguments:
|
||||||
|
# $1 = path to the target rootfs directory (e.g., output/target)
|
||||||
|
#
|
||||||
|
# Environment:
|
||||||
|
# BR2_EXTERNAL_RPI_COMMON_PATH = path to this external tree
|
||||||
|
#
|
||||||
|
# Use this script for:
|
||||||
|
# - Fixing file permissions
|
||||||
|
# - Creating symlinks
|
||||||
|
# - Generating config files that depend on build-time variables
|
||||||
|
# - Stripping unnecessary files from the rootfs
|
||||||
|
#
|
||||||
|
# Do NOT use this for:
|
||||||
|
# - Installing packages (use rootfs overlay or a package .mk instead)
|
||||||
|
# - Modifying files outside $1
|
||||||
|
|
||||||
|
# Add usb_modeswitch mdev rule
|
||||||
|
grep -q "usb_modeswitch" "$TARGET_DIR/etc/mdev.conf" || \
|
||||||
|
echo '$PRODUCT=bda/1a2b.* root:root 0660 */lib/mdev/rtl8821cu_usb_modeswitch.sh' >> "$TARGET_DIR/etc/mdev.conf"
|
||||||
|
|
||||||
|
# Add wlan_setup mdev rule
|
||||||
|
grep -q "wlan_setup" "$TARGET_DIR/etc/mdev.conf" || \
|
||||||
|
echo '$PRODUCT=bda/c820.* root:root 0660 */lib/mdev/wlan_setup.sh' >> "$TARGET_DIR/etc/mdev.conf"
|
||||||
|
|
||||||
|
# Add wlan0 configuration
|
||||||
|
grep -q "iface wlan0" "$TARGET_DIR/etc/network/interfaces" || \
|
||||||
|
cat >> "$TARGET_DIR/etc/network/interfaces" << 'EOF'
|
||||||
|
|
||||||
|
auto wlan0
|
||||||
|
iface wlan0 inet dhcp
|
||||||
|
pre-up ip link set wlan0 up
|
||||||
|
pre-up wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Generate /etc/build-info with details about this build
|
||||||
|
build_user="$(id -un)"
|
||||||
|
build_host="$(hostname)"
|
||||||
|
build_date="$(date '+%Y-%m-%d %H:%M:%S %z')"
|
||||||
|
|
||||||
|
# Determine the git revision the same way the Linux kernel does:
|
||||||
|
# prefer a tag (git describe), fall back to the short hash, and append
|
||||||
|
# "-dirty" if tracked files are modified or there are untracked files.
|
||||||
|
build_rev="unknown"
|
||||||
|
if [ -n "$BR2_EXTERNAL_RPI_COMMON_PATH" ] && \
|
||||||
|
git -C "$BR2_EXTERNAL_RPI_COMMON_PATH" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
||||||
|
git_dir="$BR2_EXTERNAL_RPI_COMMON_PATH"
|
||||||
|
build_rev="$(git -C "$git_dir" describe --always --tags 2>/dev/null || \
|
||||||
|
git -C "$git_dir" rev-parse --short HEAD 2>/dev/null || \
|
||||||
|
echo unknown)"
|
||||||
|
# Refresh the index so diff-index doesn't report stale stat info
|
||||||
|
git -C "$git_dir" update-index --refresh >/dev/null 2>&1 || :
|
||||||
|
dirty=""
|
||||||
|
if ! git -C "$git_dir" diff-index --quiet HEAD -- 2>/dev/null; then
|
||||||
|
dirty="-dirty"
|
||||||
|
elif [ -n "$(git -C "$git_dir" ls-files --others --exclude-standard 2>/dev/null)" ]; then
|
||||||
|
dirty="-dirty"
|
||||||
|
fi
|
||||||
|
build_rev="${build_rev}${dirty}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat > "$TARGET_DIR/etc/build-info" << EOF
|
||||||
|
Built by: ${build_user}@${build_host}
|
||||||
|
Build date: ${build_date}
|
||||||
|
Revision: ${build_rev}
|
||||||
|
EOF
|
||||||
53
board/raspberrypi/post-image.sh
Executable file
53
board/raspberrypi/post-image.sh
Executable file
@@ -0,0 +1,53 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
BOARD_DIR="$(dirname $0)"
|
||||||
|
BOARD_NAME="$(basename ${BOARD_DIR})"
|
||||||
|
GENIMAGE_CFG="${BOARD_DIR}/genimage-${BOARD_NAME}.cfg"
|
||||||
|
GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
|
||||||
|
|
||||||
|
# Prepare extlinux directory in BINARIES_DIR
|
||||||
|
mkdir -p "${BINARIES_DIR}/extlinux"
|
||||||
|
cp "${BOARD_DIR}/extlinux.conf" "${BINARIES_DIR}/extlinux/extlinux.conf"
|
||||||
|
|
||||||
|
# generate genimage from template if a board specific variant doesn't exists
|
||||||
|
if [ ! -e "${GENIMAGE_CFG}" ]; then
|
||||||
|
GENIMAGE_CFG="${BINARIES_DIR}/genimage.cfg"
|
||||||
|
FILES=()
|
||||||
|
|
||||||
|
for i in "${BINARIES_DIR}"/*.dtb "${BINARIES_DIR}"/rpi-firmware/*; do
|
||||||
|
FILES+=( "${i#${BINARIES_DIR}/}" )
|
||||||
|
done
|
||||||
|
|
||||||
|
for i in "${BINARIES_DIR}"/*.dtbo; do
|
||||||
|
FILES+=( "${i#${BINARIES_DIR}/}" )
|
||||||
|
done
|
||||||
|
|
||||||
|
FILES+=( "u-boot.bin" )
|
||||||
|
FILES+=( "zImage" )
|
||||||
|
FILES+=( "extlinux/" )
|
||||||
|
|
||||||
|
BOOT_FILES=$(printf '\\t\\t\\t"%s",\\n' "${FILES[@]}")
|
||||||
|
sed "s|#BOOT_FILES#|${BOOT_FILES}|" "${BOARD_DIR}/genimage.cfg.in" \
|
||||||
|
> "${GENIMAGE_CFG}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Pass an empty rootpath. genimage makes a full copy of the given rootpath to
|
||||||
|
# ${GENIMAGE_TMP}/root so passing TARGET_DIR would be a waste of time and disk
|
||||||
|
# space. We don't rely on genimage to build the rootfs image, just to insert a
|
||||||
|
# pre-built one in the disk image.
|
||||||
|
|
||||||
|
trap 'rm -rf "${ROOTPATH_TMP}"' EXIT
|
||||||
|
ROOTPATH_TMP="$(mktemp -d)"
|
||||||
|
|
||||||
|
rm -rf "${GENIMAGE_TMP}"
|
||||||
|
|
||||||
|
genimage \
|
||||||
|
--rootpath "${ROOTPATH_TMP}" \
|
||||||
|
--tmppath "${GENIMAGE_TMP}" \
|
||||||
|
--inputpath "${BINARIES_DIR}" \
|
||||||
|
--outputpath "${BINARIES_DIR}" \
|
||||||
|
--config "${GENIMAGE_CFG}"
|
||||||
|
|
||||||
|
exit $?
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# post_build.sh - Common post-build script for Raspberry Pi
|
|
||||||
#
|
|
||||||
# Called by Buildroot after assembling the target rootfs.
|
|
||||||
# Arguments:
|
|
||||||
# $1 = path to the target rootfs directory (e.g., output/target)
|
|
||||||
#
|
|
||||||
# Environment:
|
|
||||||
# BR2_EXTERNAL_RPI_COMMON_PATH = path to this external tree
|
|
||||||
#
|
|
||||||
# Use this script for:
|
|
||||||
# - Fixing file permissions
|
|
||||||
# - Creating symlinks
|
|
||||||
# - Generating config files that depend on build-time variables
|
|
||||||
# - Stripping unnecessary files from the rootfs
|
|
||||||
#
|
|
||||||
# Do NOT use this for:
|
|
||||||
# - Installing packages (use rootfs overlay or a package .mk instead)
|
|
||||||
# - Modifying files outside $1
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
TARGET_DIR="$1"
|
|
||||||
|
|
||||||
# Example: ensure /etc/hostname exists with a default value
|
|
||||||
if [ ! -f "${TARGET_DIR}/etc/hostname" ]; then
|
|
||||||
echo "rpi-common" > "${TARGET_DIR}/etc/hostname"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Example: remove unnecessary documentation to save space
|
|
||||||
rm -rf "${TARGET_DIR}/usr/share/man"
|
|
||||||
rm -rf "${TARGET_DIR}/usr/share/doc"
|
|
||||||
|
|
||||||
echo ">>> Common post-build script completed"
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# post_image.sh - Common post-image script for Raspberry Pi
|
|
||||||
#
|
|
||||||
# Called by Buildroot after filesystem images (ext4, etc.) are generated.
|
|
||||||
# Arguments:
|
|
||||||
# $1 = path to the images directory (e.g., output/images)
|
|
||||||
#
|
|
||||||
# Environment:
|
|
||||||
# BR2_EXTERNAL_RPI_COMMON_PATH = path to this external tree
|
|
||||||
# BINARIES_DIR = same as $1
|
|
||||||
# BUILD_DIR = path to the build directory
|
|
||||||
#
|
|
||||||
# This script uses genimage to assemble the final SD card image
|
|
||||||
# from the boot files and root filesystem.
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
BOARD_DIR="${BR2_EXTERNAL_RPI_COMMON_PATH}/board/raspberrypi"
|
|
||||||
|
|
||||||
# Use project-specific genimage.cfg if it exists, otherwise use common one.
|
|
||||||
# Projects can override by setting GENIMAGE_CFG in their own post-image script.
|
|
||||||
GENIMAGE_CFG="${GENIMAGE_CFG:-${BOARD_DIR}/genimage.cfg}"
|
|
||||||
|
|
||||||
# genimage requires a temporary directory
|
|
||||||
GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
|
|
||||||
rm -rf "${GENIMAGE_TMP}"
|
|
||||||
|
|
||||||
genimage \
|
|
||||||
--rootpath "${TARGET_DIR}" \
|
|
||||||
--tmppath "${GENIMAGE_TMP}" \
|
|
||||||
--inputpath "${BINARIES_DIR}" \
|
|
||||||
--outputpath "${BINARIES_DIR}" \
|
|
||||||
--config "${GENIMAGE_CFG}"
|
|
||||||
|
|
||||||
echo ">>> SD card image generated: ${BINARIES_DIR}/sdcard.img"
|
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
-----BEGIN OPENSSH PRIVATE KEY-----
|
||||||
|
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAaAAAABNlY2RzYS
|
||||||
|
1zaGEyLW5pc3RwMjU2AAAACG5pc3RwMjU2AAAAQQSl9RVGjxEE1Z6qDY21KA6tmgLqacnk
|
||||||
|
vKc1kSkID/EbnevNtVCsiXFnz3+8SVhwN40LvsGTYCvpvY1rfdbEMuQ5AAAAqN1fGILdXx
|
||||||
|
iCAAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBKX1FUaPEQTVnqoN
|
||||||
|
jbUoDq2aAuppyeS8pzWRKQgP8Rud6821UKyJcWfPf7xJWHA3jQu+wZNgK+m9jWt91sQy5D
|
||||||
|
kAAAAgW9F8JZ52i66TzRFQXijQ9fCZNKoQvYLQNbFsRTtouyYAAAAOcm9vdEBidWlsZHJv
|
||||||
|
b3QBAg==
|
||||||
|
-----END OPENSSH PRIVATE KEY-----
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBKX1FUaPEQTVnqoNjbUoDq2aAuppyeS8pzWRKQgP8Rud6821UKyJcWfPf7xJWHA3jQu+wZNgK+m9jWt91sQy5Dk= root@buildroot
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
-----BEGIN OPENSSH PRIVATE KEY-----
|
||||||
|
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
|
||||||
|
QyNTUxOQAAACBum+4jD3lEmZe0zInr6m0FoTfijCtR3ja59pYjpYVJNwAAAJg/TeMTP03j
|
||||||
|
EwAAAAtzc2gtZWQyNTUxOQAAACBum+4jD3lEmZe0zInr6m0FoTfijCtR3ja59pYjpYVJNw
|
||||||
|
AAAEASEHCJMowIsJDYg06NfQl9vQG6xGMEjSbiYJJMtRJNS26b7iMPeUSZl7TMievqbQWh
|
||||||
|
N+KMK1HeNrn2liOlhUk3AAAADnJvb3RAYnVpbGRyb290AQIDBAUGBw==
|
||||||
|
-----END OPENSSH PRIVATE KEY-----
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG6b7iMPeUSZl7TMievqbQWhN+KMK1HeNrn2liOlhUk3 root@buildroot
|
||||||
38
board/raspberrypi/rootfs-overlay/etc/ssh/ssh_host_rsa_key
Normal file
38
board/raspberrypi/rootfs-overlay/etc/ssh/ssh_host_rsa_key
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
-----BEGIN OPENSSH PRIVATE KEY-----
|
||||||
|
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
|
||||||
|
-----END OPENSSH PRIVATE KEY-----
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCpRgSaPyq4pKLSUrHKPOH9zF2dVEo686f+oZIOVWMuMHw858T2AAu+kstMtPVsAcCY+HZHdCbRp1yh1l9UV3GdrpW8eex413wzpf7yHsil2CIbfheVY43Qrw3E34etw8bMqoNBxZpHmZEFtDC18DcdtBHaVycrHYQRM6SgbTG++TeVDL33bP+BREEK6cAvbUcJbaV96w7M8CtJAfy1xKOMHgeOggoaymrg3jBZqJ1VHrdu3jYbAuH+DrNMNPVKYk/61LP4+9FLswPpyHFZgvLswMdE5bd/s92cfwn6ovOOty4gwfd25w14VYfxpDnEMuLP4afUCF9cqf577v1St8YJYzc/v4O+MnILLORCJz07hCXw5rvPSYkk3bDMDK4UVGPgiSvkHZDVXgL50xHFvjGPkhLbM/iUzm/zp8IOCu8LLbBKOUWP6e5wpfPiS4pfS1bWwLHeQbxmiHH7ogzgKTnr8hg0wGbJHbFINL76Mq+gQI4ALshD8r8/WQ21QWPhlSc= root@buildroot
|
||||||
4
board/raspberrypi/rootfs-overlay/etc/wpa_supplicant.conf
Normal file
4
board/raspberrypi/rootfs-overlay/etc/wpa_supplicant.conf
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
network={
|
||||||
|
ssid="Gabriel_2G"
|
||||||
|
psk="gabrielwifi"
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
[ "$ACTION" = "add" ] || exit 0
|
||||||
|
usb_modeswitch -v 0bda -p 1a2b -c /usr/share/usb_modeswitch/0bda:1a2b &
|
||||||
13
board/raspberrypi/rootfs-overlay/lib/mdev/wlan_setup.sh
Normal file
13
board/raspberrypi/rootfs-overlay/lib/mdev/wlan_setup.sh
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
case "$ACTION" in
|
||||||
|
bind)
|
||||||
|
[ -e /sys/class/net/wlan0 ] || exit 0
|
||||||
|
ifdown wlan0 2>/dev/null
|
||||||
|
killall wpa_supplicant 2>/dev/null
|
||||||
|
ifup wlan0
|
||||||
|
;;
|
||||||
|
remove|unbind)
|
||||||
|
ifdown wlan0 2>/dev/null
|
||||||
|
killall wpa_supplicant 2>/dev/null
|
||||||
|
;;
|
||||||
|
esac
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN91vSBSoQ6Xlvohjp6cu4IkL83KKEx//BLgQdvbukHR gabriel@gabriel-a65
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
--- a/board/raspberrypi/rpi/rpi.env
|
||||||
|
+++ b/board/raspberrypi/rpi/rpi.env
|
||||||
|
@@ -75,6 +75,7 @@
|
||||||
|
scriptaddr=0x05400000
|
||||||
|
pxefile_addr_r=0x05500000
|
||||||
|
fdt_addr_r=0x05600000
|
||||||
|
+fdtoverlay_addr_r=0x056A0000
|
||||||
|
ramdisk_addr_r=0x05700000
|
||||||
|
|
||||||
|
boot_targets=mmc usb pxe dhcp
|
||||||
51
board/raspberrypi/uboot_defconfig
Normal file
51
board/raspberrypi/uboot_defconfig
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
CONFIG_ARM=y
|
||||||
|
CONFIG_ARCH_CPU_INIT=y
|
||||||
|
CONFIG_ARCH_BCM283X=y
|
||||||
|
CONFIG_TEXT_BASE=0x00008000
|
||||||
|
CONFIG_SYS_MALLOC_F_LEN=0x400
|
||||||
|
CONFIG_TARGET_RPI=y
|
||||||
|
CONFIG_NR_DRAM_BANKS=1
|
||||||
|
CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
|
||||||
|
CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x7ffff00
|
||||||
|
CONFIG_ENV_SIZE=0x4000
|
||||||
|
CONFIG_DEFAULT_DEVICE_TREE="bcm2835-rpi-b"
|
||||||
|
CONFIG_OF_LIBFDT_OVERLAY=y
|
||||||
|
CONFIG_SYS_LOAD_ADDR=0x1000000
|
||||||
|
CONFIG_EFI_LOADER=y
|
||||||
|
CONFIG_BOOTSTD_DEFAULTS=y
|
||||||
|
CONFIG_OF_BOARD_SETUP=y
|
||||||
|
CONFIG_FDT_SIMPLEFB=y
|
||||||
|
CONFIG_USE_PREBOOT=y
|
||||||
|
CONFIG_SYS_PBSIZE=1049
|
||||||
|
# CONFIG_DISPLAY_CPUINFO is not set
|
||||||
|
# CONFIG_DISPLAY_BOARDINFO is not set
|
||||||
|
CONFIG_MISC_INIT_R=y
|
||||||
|
CONFIG_SYS_PROMPT="U-Boot> "
|
||||||
|
CONFIG_CMD_GPIO=y
|
||||||
|
CONFIG_CMD_MMC=y
|
||||||
|
CONFIG_CMD_USB=y
|
||||||
|
CONFIG_CMD_FS_UUID=y
|
||||||
|
CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
|
||||||
|
CONFIG_ENV_RELOC_GD_ENV_ADDR=y
|
||||||
|
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||||
|
CONFIG_TFTP_TSIZE=y
|
||||||
|
CONFIG_BCM2835_GPIO=y
|
||||||
|
CONFIG_MMC_SDHCI=y
|
||||||
|
CONFIG_MMC_SDHCI_BCM2835=y
|
||||||
|
CONFIG_PINCTRL=y
|
||||||
|
# CONFIG_PINCTRL_GENERIC is not set
|
||||||
|
# CONFIG_REQUIRE_SERIAL_CONSOLE is not set
|
||||||
|
CONFIG_SYSINFO=y
|
||||||
|
CONFIG_SYSINFO_SMBIOS=y
|
||||||
|
CONFIG_USB=y
|
||||||
|
CONFIG_USB_DWC2=y
|
||||||
|
CONFIG_USB_KEYBOARD=y
|
||||||
|
CONFIG_USB_HOST_ETHER=y
|
||||||
|
CONFIG_USB_ETHER_SMSC95XX=y
|
||||||
|
CONFIG_VIDEO=y
|
||||||
|
# CONFIG_VIDEO_BPP8 is not set
|
||||||
|
# CONFIG_VIDEO_BPP16 is not set
|
||||||
|
CONFIG_SYS_WHITE_ON_BLACK=y
|
||||||
|
CONFIG_VIDEO_BCM2835=y
|
||||||
|
CONFIG_CONSOLE_SCROLL_LINES=10
|
||||||
|
CONFIG_PHYS_TO_BUS=y
|
||||||
@@ -1,34 +1,62 @@
|
|||||||
BR2_arm=y
|
BR2_arm=y
|
||||||
BR2_arm1176jzf_s=y
|
BR2_arm1176jzf_s=y
|
||||||
BR2_TOOLCHAIN_EXTERNAL=y
|
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_12=y
|
||||||
BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_ARMV6_EABIHF_GLIBC_STABLE=y
|
BR2_BINUTILS_VERSION_2_45_X=y
|
||||||
BR2_GLOBAL_PATCH_DIR="board/raspberrypi/patches"
|
BR2_GCC_VERSION_15_X=y
|
||||||
|
BR2_TOOLCHAIN_BUILDROOT_CXX=y
|
||||||
|
BR2_PACKAGE_HOST_GDB=y
|
||||||
|
BR2_GDB_VERSION_16=y
|
||||||
BR2_DOWNLOAD_FORCE_CHECK_HASHES=y
|
BR2_DOWNLOAD_FORCE_CHECK_HASHES=y
|
||||||
|
BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y
|
||||||
|
BR2_ROOTFS_DEVICE_TABLE="system/device_table.txt $(BR2_EXTERNAL_RPI_COMMON_PATH)/board/raspberrypi/device_table.txt"
|
||||||
BR2_SYSTEM_DHCP="eth0"
|
BR2_SYSTEM_DHCP="eth0"
|
||||||
BR2_ROOTFS_POST_BUILD_SCRIPT="board/raspberrypi/post-build.sh"
|
BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL_RPI_COMMON_PATH)/board/raspberrypi/rootfs-overlay"
|
||||||
BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi/post-image.sh"
|
BR2_ROOTFS_POST_BUILD_SCRIPT="board/raspberrypi/post-build.sh $(BR2_EXTERNAL_RPI_COMMON_PATH)/board/raspberrypi/post-build.sh"
|
||||||
|
BR2_ROOTFS_POST_IMAGE_SCRIPT="$(BR2_EXTERNAL_RPI_COMMON_PATH)/board/raspberrypi/post-image.sh"
|
||||||
BR2_LINUX_KERNEL=y
|
BR2_LINUX_KERNEL=y
|
||||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL=y
|
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
|
||||||
BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,21b410140c47ffab5668399f6f143c7d7b935c8b)/linux-21b410140c47ffab5668399f6f143c7d7b935c8b.tar.gz"
|
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.74"
|
||||||
BR2_LINUX_KERNEL_DEFCONFIG="bcmrpi"
|
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
|
||||||
|
BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_RPI_COMMON_PATH)/board/raspberrypi/linux_defconfig"
|
||||||
BR2_LINUX_KERNEL_DTS_SUPPORT=y
|
BR2_LINUX_KERNEL_DTS_SUPPORT=y
|
||||||
BR2_LINUX_KERNEL_INTREE_DTS_NAME="broadcom/bcm2708-rpi-b-rev1 broadcom/bcm2708-rpi-b broadcom/bcm2708-rpi-b-plus broadcom/bcm2708-rpi-cm"
|
BR2_LINUX_KERNEL_INTREE_DTS_NAME="broadcom/bcm2835-rpi-b-plus broadcom/bcm2835-rpi-zero-w"
|
||||||
|
BR2_LINUX_KERNEL_CUSTOM_DTS_DIR="$(BR2_EXTERNAL_RPI_COMMON_PATH)/board/raspberrypi/dtoverlay/"
|
||||||
|
BR2_LINUX_KERNEL_DTB_OVERLAY_SUPPORT=y
|
||||||
BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
|
BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
|
||||||
BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
|
|
||||||
BR2_PACKAGE_XZ=y
|
BR2_PACKAGE_XZ=y
|
||||||
|
BR2_PACKAGE_GDB=y
|
||||||
|
BR2_PACKAGE_BRCMFMAC_SDIO_FIRMWARE_RPI=y
|
||||||
|
BR2_PACKAGE_BRCMFMAC_SDIO_FIRMWARE_RPI_BT=y
|
||||||
|
BR2_PACKAGE_BRCMFMAC_SDIO_FIRMWARE_RPI_WIFI=y
|
||||||
|
BR2_PACKAGE_LINUX_FIRMWARE=y
|
||||||
|
BR2_PACKAGE_LINUX_FIRMWARE_RTL_RTW88=y
|
||||||
BR2_PACKAGE_RPI_FIRMWARE=y
|
BR2_PACKAGE_RPI_FIRMWARE=y
|
||||||
BR2_PACKAGE_RPI_FIRMWARE_BOOTCODE_BIN=y
|
BR2_PACKAGE_RPI_FIRMWARE_BOOTCODE_BIN=y
|
||||||
BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI=y
|
BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI=y
|
||||||
BR2_PACKAGE_RPI_FIRMWARE_CONFIG_FILE="$(BR2_EXTERNAL_RPI_COMMON_PATH)/board/raspberrypi/config_common.txt"
|
BR2_PACKAGE_RPI_FIRMWARE_CONFIG_FILE="$(BR2_EXTERNAL_RPI_COMMON_PATH)/board/raspberrypi/config_common.txt"
|
||||||
BR2_PACKAGE_RPI_FIRMWARE_CMDLINE_FILE="$(BR2_EXTERNAL_RPI_COMMON_PATH)/board/raspberrypi/cmdline_common.txt"
|
BR2_PACKAGE_RPI_FIRMWARE_CMDLINE_FILE="$(BR2_EXTERNAL_RPI_COMMON_PATH)/board/raspberrypi/cmdline_common.txt"
|
||||||
# BR2_PACKAGE_RPI_FIRMWARE_INSTALL_DTB_OVERLAYS is not set
|
# BR2_PACKAGE_RPI_FIRMWARE_INSTALL_DTB_OVERLAYS is not set
|
||||||
|
BR2_PACKAGE_USB_MODESWITCH_DATA=y
|
||||||
|
BR2_PACKAGE_LIBGPIOD2=y
|
||||||
|
BR2_PACKAGE_LIBGPIOD2_TOOLS=y
|
||||||
|
BR2_PACKAGE_IPERF3=y
|
||||||
|
BR2_PACKAGE_OPENSSH=y
|
||||||
|
BR2_PACKAGE_WPA_SUPPLICANT=y
|
||||||
|
BR2_PACKAGE_WPA_SUPPLICANT_WPA3=y
|
||||||
|
BR2_PACKAGE_HTOP=y
|
||||||
BR2_PACKAGE_KMOD=y
|
BR2_PACKAGE_KMOD=y
|
||||||
BR2_PACKAGE_KMOD_TOOLS=y
|
|
||||||
BR2_TARGET_ROOTFS_EXT2=y
|
BR2_TARGET_ROOTFS_EXT2=y
|
||||||
BR2_TARGET_ROOTFS_EXT2_4=y
|
BR2_TARGET_ROOTFS_EXT2_4=y
|
||||||
BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
|
BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
|
||||||
# BR2_TARGET_ROOTFS_TAR is not set
|
# BR2_TARGET_ROOTFS_TAR is not set
|
||||||
|
BR2_TARGET_UBOOT=y
|
||||||
|
BR2_TARGET_UBOOT_PATCH="$(BR2_EXTERNAL_RPI_COMMON_PATH)/board/raspberrypi/uboot-patches/"
|
||||||
|
BR2_TARGET_UBOOT_USE_CUSTOM_CONFIG=y
|
||||||
|
BR2_TARGET_UBOOT_CUSTOM_CONFIG_FILE="$(BR2_EXTERNAL_RPI_COMMON_PATH)/board/raspberrypi/uboot_defconfig"
|
||||||
|
BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
|
||||||
|
BR2_TARGET_UBOOT_NEEDS_GNUTLS=y
|
||||||
BR2_PACKAGE_HOST_DOSFSTOOLS=y
|
BR2_PACKAGE_HOST_DOSFSTOOLS=y
|
||||||
BR2_PACKAGE_HOST_GENIMAGE=y
|
BR2_PACKAGE_HOST_GENIMAGE=y
|
||||||
BR2_PACKAGE_HOST_KMOD_XZ=y
|
BR2_PACKAGE_HOST_KMOD_XZ=y
|
||||||
BR2_PACKAGE_HOST_MTOOLS=y
|
BR2_PACKAGE_HOST_MTOOLS=y
|
||||||
|
BR2_PACKAGE_GFXCANVAS=y
|
||||||
|
|||||||
14
package/gfxcanvas/Config.in
Normal file
14
package/gfxcanvas/Config.in
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
config BR2_PACKAGE_GFXCANVAS
|
||||||
|
bool "gfxcanvas"
|
||||||
|
depends on BR2_INSTALL_LIBSTDCPP
|
||||||
|
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_13
|
||||||
|
help
|
||||||
|
Small C++ framebuffer graphics application that draws an
|
||||||
|
info screen (date/time, hostname, network addresses) on a
|
||||||
|
Linux framebuffer device. Intended for SSD1306-class OLEDs
|
||||||
|
exposed as /dev/fbN via fbtft.
|
||||||
|
|
||||||
|
https://git.gmlima.com/Gabriel/GfxCanvas
|
||||||
|
|
||||||
|
comment "gfxcanvas needs a toolchain w/ C++, gcc >= 13"
|
||||||
|
depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_GCC_AT_LEAST_13
|
||||||
60
package/gfxcanvas/S99gfxcanvas
Normal file
60
package/gfxcanvas/S99gfxcanvas
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Start gfxcanvas info display
|
||||||
|
#
|
||||||
|
|
||||||
|
DAEMON="gfxcanvas"
|
||||||
|
DAEMON_PATH="/usr/bin/$DAEMON"
|
||||||
|
DAEMON_ARGS="/dev/fb1"
|
||||||
|
PIDFILE="/var/run/$DAEMON.pid"
|
||||||
|
|
||||||
|
start() {
|
||||||
|
printf 'Starting %s: ' "$DAEMON"
|
||||||
|
# shellcheck disable=SC2086
|
||||||
|
start-stop-daemon -S -q -m -b -p "$PIDFILE" \
|
||||||
|
-x "$DAEMON_PATH" -- $DAEMON_ARGS
|
||||||
|
status=$?
|
||||||
|
if [ "$status" -eq 0 ]; then
|
||||||
|
echo "OK"
|
||||||
|
else
|
||||||
|
echo "FAIL"
|
||||||
|
fi
|
||||||
|
return "$status"
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
printf 'Stopping %s: ' "$DAEMON"
|
||||||
|
start-stop-daemon -K -q -p "$PIDFILE"
|
||||||
|
status=$?
|
||||||
|
if [ "$status" -eq 0 ]; then
|
||||||
|
rm -f "$PIDFILE"
|
||||||
|
echo "OK"
|
||||||
|
else
|
||||||
|
echo "FAIL"
|
||||||
|
fi
|
||||||
|
return "$status"
|
||||||
|
}
|
||||||
|
|
||||||
|
restart() {
|
||||||
|
stop
|
||||||
|
sleep 1
|
||||||
|
start
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
start
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
stop
|
||||||
|
;;
|
||||||
|
restart|reload)
|
||||||
|
restart
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Usage: $0 {start|stop|restart}"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit $?
|
||||||
20
package/gfxcanvas/gfxcanvas.mk
Normal file
20
package/gfxcanvas/gfxcanvas.mk
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
################################################################################
|
||||||
|
#
|
||||||
|
# gfxcanvas
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
GFXCANVAS_VERSION = 0.2
|
||||||
|
GFXCANVAS_SITE = https://git.gmlima.com/Gabriel/GfxCanvas.git
|
||||||
|
GFXCANVAS_SITE_METHOD = git
|
||||||
|
GFXCANVAS_LICENSE = GPL-3.0
|
||||||
|
GFXCANVAS_LICENSE_FILES = LICENSE
|
||||||
|
|
||||||
|
GFXCANVAS_CONF_OPTS = -DPROJECT_NAME=gfxcanvas
|
||||||
|
|
||||||
|
define GFXCANVAS_INSTALL_INIT_SYSV
|
||||||
|
$(INSTALL) -D -m 0755 $(GFXCANVAS_PKGDIR)/S99gfxcanvas \
|
||||||
|
$(TARGET_DIR)/etc/init.d/S99gfxcanvas
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(cmake-package))
|
||||||
Reference in New Issue
Block a user