diff --git a/board/alix/INIT b/board/alix/INIT index 2b383fb..469d868 100644 --- a/board/alix/INIT +++ b/board/alix/INIT @@ -1,2 +1,3 @@ GETTY_TTY="ttyS0" HWCLOCK="yes" +DHCP_PORTS="" \ No newline at end of file diff --git a/board/rpi3/INIT b/board/rpi3/INIT index df1089c..1a528b1 100644 --- a/board/rpi3/INIT +++ b/board/rpi3/INIT @@ -1,2 +1,3 @@ GETTY_TTY="tty1 tty2 tty3 tty4 tty5 tty6 tty7" +DHCP_PORTS="port0" HWCLOCK="no" diff --git a/pkg/init/build b/pkg/init/build index c3ad82b..fcd87fc 100755 --- a/pkg/init/build +++ b/pkg/init/build @@ -57,5 +57,14 @@ deploy() { ln -s "/share/init/agetty" "$DEPLOY/etc/init.d/agetty@$svc" done - unset -v i GETTY_TTY HWCLOCK + if [ ! -z "$DHCP_PORTS" ]; then + ln -s "/share/init/dhcpcdmaster" \ + "$DEPLOY/etc/init.d/dhcpcdmaster" + fi + + for svc in $DHCP_PORTS; do + ln -s "/share/init/dhcpcd" "$DEPLOY/etc/init.d/dhcpcd@$svc" + done + + unset -v i GETTY_TTY HWCLOCK DHCP_PORTS } diff --git a/pkg/init/share/init/dhcpcd b/pkg/init/share/init/dhcpcd new file mode 100644 index 0000000..ad96c77 --- /dev/null +++ b/pkg/init/share/init/dhcpcd @@ -0,0 +1,6 @@ +description "DHCP client on %0" +type once +target boot +after dhcpcd + +exec dhcpcd -n %0 diff --git a/pkg/init/share/init/dhcpcdmaster b/pkg/init/share/init/dhcpcdmaster new file mode 100644 index 0000000..39481f4 --- /dev/null +++ b/pkg/init/share/init/dhcpcdmaster @@ -0,0 +1,9 @@ +description "DHCP client - master service" +type respawn limit 5 +target boot +after sysinit ifrename ifcfg + +exec { + mkdir -p /var/db/dhcpcd + dhcpcd -B --inactive +} diff --git a/product/router/interfaces.rpi3/port0 b/product/router/interfaces.rpi3/port0 deleted file mode 100644 index 09fba90..0000000 --- a/product/router/interfaces.rpi3/port0 +++ /dev/null @@ -1 +0,0 @@ -ip 192.168.0.1/24