Skip to content

Commit

Permalink
doc: add build subtree
Browse files Browse the repository at this point in the history
  • Loading branch information
gsanchietti committed Feb 22, 2024
1 parent 41b2d2d commit 541a3fd
Show file tree
Hide file tree
Showing 2 changed files with 505 additions and 0 deletions.
49 changes: 49 additions & 0 deletions docs/build/custom_images.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
layout: default
title: Custom images
parent: Build system
---

# Custom images

You can create custom images using [Image Builder](https://openwrt.org/docs/guide-user/additional-software/imagebuilder).

Download the image builder from:
```
https://updates.nethsecurity.nethserver.org/<version>/targets/x86/64/nethsecurity-imagebuilder-<version>-x86-64.Linux-x86_64.tar.xz
```
Replace `version` with the latest release, like `23.05.06`.

## Using Image Builder inside CentOS 7

Install the dependencies:
```
yum install perl-Thread-Queue devtoolset-7-make git unzip bzip2
```

Upload the builder inside the system and prepare it:
```
mkdir builder; tar xvf nethsecurity-imagebuilder-22.03.0-x86-64.Linux-x86_64.tar.xz -C builder
cd builder
sed -i '/logd \\/d' include/target.mk
```
Note: OpenWrt build system assumes logd is always installed, but NethSecurity image does not ship it.
The `sed` command ensure logd is not bundled inside the image.

Prepare the files directory:
```
wget https://github.com/NethServer/nethsecurity/archive/refs/heads/master.tar.gz
tar xvf master.tar.gz nethsecurity-master/files/
```

To include custom files, add them inside `nethsecurity-master/files` directory
with the full path, like:
```
echo "hello" > file/root/goofy
```

Start the build with all included packages:
```
source /opt/rh/devtoolset-7/enable
make image FILES="nethsecurity-master/files/" PACKAGES="$(grep "Package: " packages/Packages | cut -d ':' -f 2 | tr '\n' ' ')"
```
Loading

0 comments on commit 541a3fd

Please sign in to comment.