Add Dockerfile; add information into README file

This commit is contained in:
Daniel Pawlik
2022-03-05 14:36:39 +01:00
parent 49d7e0f6a3
commit 91fa5cba93
2 changed files with 90 additions and 2 deletions

20
Dockerfile Normal file
View File

@@ -0,0 +1,20 @@
FROM fedora:35
RUN yum update -y
RUN dnf -y groupinstall 'Development Tools'
RUN dnf -y install bash-completion bzip2 gcc gcc-c++ git make ncurses-devel patch \
rsync tar unzip wget which diffutils python2 python3 perl-base \
perl-Data-Dumper perl-File-Compare perl-File-Copy perl-FindBin \
perl-Thread-Queue vim
RUN useradd -m user && \
echo 'user ALL=NOPASSWD: ALL' > /etc/sudoers.d/user
USER user
WORKDIR /home/user
# set dummy git config
RUN git config --global user.name "user" && git \
config --global user.email "user@example.com"

View File

@@ -1,2 +1,70 @@
# openwrt-builder
Build openWRT system image
# Openwrt
Build OpenWRT system image
## How to
Container image to build Openwrt image based on https://openwrt.org/docs/guide-developer/toolchain/install-buildsystem
To build own container image:
```shell
sudo yum install -y git podman
git clone https://github.com/danpawlik/openwrt-builder
cd openwrt-builder
podman build -t openwrt-builder -f Dockerfile
```
## Example
how to use:
```
mkdir -p openwrt-builder
podman run -it -u user -v $(pwd)/openwrt-builder/:/home/user:z,rw quay.io/dpawlik/openwrt:fedora35 /bin/bash
```
Then inside the container (from https://openwrt.org/docs/guide-developer/toolchain/use-buildsystem):
```shell
git clone https://git.openwrt.org/openwrt/openwrt.git
cd openwrt
git pull
```
Select a specific code revision:
```shell
git branch -a
git tag
git checkout v21.02.1
```
Update the feeds:
```shell
./scripts/feeds update -a
./scripts/feeds install -a
```
Configure the firmware image and the kernel:
```shell
make menuconfig
```
If you have own config file, replace it. For example:
```shell
curl -SL https://downloads.openwrt.org/snapshots/targets/ath79/mikrotik/config.buildinfo > .config
```
Then:
```shell
# make kernel_menuconfig
make -j4 kernel_menuconfig
```
Build the firmware image:
```shell
make -j $(nproc) defconfig download clean world
```