Image Builder set a static ip?

I have been using the Image Builder as of late to build images for my Orange PI R1 Plus.

I have tried setting a static IP, netmask, and broadcast in the main .config without any success, as the final image still defaults to 192.168.1.1.

Below is the script that I use to do much of the manual work. Is there anything I need to add to it to change the default static IP, netmask, and broadcast?

#script
cd /home/kgoerbig/Downloads/OP_R1_Plus/builder/bin/targets/rockchip/armv8
rm *.gz
cd /home/kgoerbig/Downloads/OP_R1_Plus/images
rm *.img
cd /home/kgoerbig/Downloads/OP_R1_Plus/builder
make clean
make image RELEASE="23.05.2" PROFILE="xunlong_orangepi-r1-plus" FILES="files" PACKAGES="luci luci-app-adblock luci-app-adblock-fast luci-app-commands luci-app-ddns luci-app-diag-core luci-app-firewall luci-app-nlbwmon luci-app-ntpc luci-app-opkg luci-app-samba4 luci-app-softether luci-app-statistics luci-app-unbound luci-app-upnp luci-app-vnstat luci-app-watchcat luci-app-wireguard blkid bmon htop ifstat iftop iperf3 iwinfo lsblk lscpu lsblk fdisk losetup resize2fs nano rsync rtorrent tcpdump adblock arp-scan blkid bmon kmod-usb-storage kmod-usb-storage-uas rsync kmod-fs-exfat kmod-fs-ext4 kmod-fs-ksmbd kmod-fs-nfs kmod-fs-nfs-common kmod-fs-nfs-v3 kmod-fs-nfs-v4 kmod-fs-ntfs luci-app-diag-core block-mount ppp kmod-pppoe ppp-mod-pppoe luci-proto-ppp luci-proto-pppossh pppoe-discovery kmod-pppoa comgt ppp-mod-pppoa rp-pppoe-common luci-proto-ipv6 luci-proto-wireguard" DISABLED_SERVICES="adblock banip gpio_switch lm-sensors softethervpnclient"
cd /home/kgoerbig/Downloads/OP_R1_Plus/builder/bin/targets/rockchip/armv8
gunzip *.img.gz
mv *.img /home/kgoerbig/Downloads/OP_R1_Plus/images

And the content of files is .... ?

FILES=

Are just some basic scripts to restore backup configs once booted. When the "FILES" do write after build, they end up in the root directory. Is there a way to point "FILES" into specific directories (ie /etc/config or /usr/bin)?

if you add uci commands to the script(s) you don't need to be in /etc/config ?

1 Like

The ImageBuilder directive FILES= follows the Build System Custom Files

1 Like

@RuralRoots and @frollic

I appreciate the feed back. I have resolved this issue by creating several directories under "files" with configuration backups:

/files/etc/config/dhcp
/files/etc/config/dropbear
/files/etc/config/firewall
/files/etc/config/network
/files/etc/config/system
/files/etc/dropbear/authorized_keys
/files/usr/bin/restore

**restore mounts a 4GB USB drive and restores the backup-OP-R1_Plus-2023-12-27.tar.gz restoring the remaining configs and scripts.

Thanks for the help.

I use a 99-custom file placed under files --> etc --> config --> uci-defaults; its content is as follows:

uci -q batch << EOI
set network.lan.ipaddr='192.168.2.22'
commit network
set wireless.@wifi-device[0].disabled='0'
set wireless.@wifi-iface[0].ssid='MyWiFi'
commit wireless
EOI

This way it boots with .2.22.

2 Likes