Yes, it's how I build my devices so they will have all the files I need to install on them, scripts and stuff.
However, most of the files are in files/temp and some lines in /etc/rc.local and none are related to the OS, they are only scripts to do some logging.
So, here is what I have ready to go.
Chaos Calmer 15.05 Image Builder.
A FILES directory with some scripts in files/temp and a few lines of code in /etc/rc.local.
My build command is as follows;
make image PROFILE=MT7620a PACKAGES="libstdcpp ca-certificates libpthread bash curl kmod-ipv6 -dnsmasq -kmod-ath9k -uboot-envtools -wpad-mini -ppp -ppp -mod-pppoe -kmod-ppp -kmod-pppoe -kmod-usb-core -kmod-usb2 -kmod-ledtrig-usbdev -kmod-usb-ohci -kmod-usb-hid" FILES=files/
The files I have in files/etc;
# ls -ls files/etc/config/
8 -rw-r--r-- 1 nobody nogroup 4408 Apr 5 08:46 firewall
4 -rw-r--r-- 1 nobody nogroup 812 Mar 30 16:16 network
4 -rw-r--r-- 1 nobody nogroup 353 Mar 30 12:48 system
In the files/etc/config/system file, I simply change the hostname
# cat files/etc/config/network
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fd3f:0c92:79ed::/48'
config interface 'lan'
option ifname 'eth0.1'
option force_link '1'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.1.55' # Changed to 1.55 so it won't conflict with local router
option netmask '255.255.255.0'
option ip6assign '60'
config interface 'wan'
option ifname 'eth0.2'
option force_link '1'
option proto 'dhcp' # This is set to DHCP so once built, picks up DHCP IP
config interface 'wan6'
option ifname 'eth0.2'
option proto 'dhcpv6'
config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'
config switch_vlan
option device 'switch0'
option vlan '1'
option ports '1 2 3 4 6t'
config switch_vlan
option device 'switch0'
option vlan '2'
option ports '0 6t'
In the files/etc/config/firewall file, the last time I built, I changed only the ssh section. I made this change after I lost access to the first two devices.
# port redirect of remapped ssh port (22001) on wan
#config redirect
# option src wan
# option src_dport 22001
# option dest lan
# option dest_port 22
# option proto tcp
config rule
option src wan
option src_dport 22
option proto tcp
option dest_port ssh
option target ACCEPT
That left no ssh port open so I lost access to the device. So I checked what the difference is on my gl.inet 2-port builds that do work and found it had one extra file.
#ls -la files/etc/config/dropbear
# cat /etc/config/dropbear
config dropbear
option PasswordAuth 'on'
option RootPasswordAuth 'on'
option Port '22'
# option BannerFile '/etc/banner'
So at this point, I surmise that I need to include this file in my nexx builds in order to ensure that the ssh port gets opened.
I could either convert the 3020 to OpenWrt using a pre-built firmware first but have usually always used Image Builder to build and used the factory build to convert it to my own, saving one extra step.
PS: There was one weird thing happening with the other three that I can no longer reach. They would start up, pick up an IP so I would nmap the device and found that each time they restarted, they had a new mac address showing. I cannot explain this one.
(Last edited by projects on 12 Apr 2016, 16:12)