Skip to content

Commit

Permalink
semi-automated PD on raspbian scripts: support of debian platform for…
Browse files Browse the repository at this point in the history
… latest Raspi OS
  • Loading branch information
yangsong-cnyn committed Oct 9, 2024
1 parent 547e0f2 commit 7eb6fd4
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions examples/platforms/debian/default
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
NAT64=0
DNS64=0
DHCPV6_PD=0
DHCPV6_PD_REF=1
NETWORK_MANAGER=0
BACKBONE_ROUTER=1
BORDER_ROUTING=1
Expand Down
4 changes: 2 additions & 2 deletions script/_dhcpv6_pd
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ NCP_STATE_NOTIFIER_SERVICE="/etc/systemd/system/${NCP_STATE_NOTIFIER_SERVICE_NAM

DHCPCD_RELOADER="${NCP_STATE_DISPATCHER}/dhcpcd_reloader"

without DHCPV6_PD || test "$PLATFORM" = beagleboneblack || test "$PLATFORM" = raspbian || test "$PLATFORM" = ubuntu || die "DHCPv6-PD is not tested under $PLATFORM."
without DHCPV6_PD || test "$PLATFORM" = beagleboneblack || test "$PLATFORM" = raspbian || test "$PLATFORM" = debian || test "$PLATFORM" = ubuntu || die "DHCPv6-PD is not tested under $PLATFORM."

create_dhcpcd_conf_with_dhcpv6_pd()
{
Expand Down Expand Up @@ -114,7 +114,7 @@ ia_pd 3/::/63 $WPAN_INTERFACE/1
EOF

if [ "$PLATFORM" = "raspbian" ] || with NETWORK_MANAGER_WIFI; then
if [ "$PLATFORM" = "raspbian" ] || [ "$PLATFORM" = "debian" ] || with NETWORK_MANAGER_WIFI; then
sudo tee -a ${DHCPCD_CONF} <<EOF
interface $WLAN_INTERFACE
iaid 4
Expand Down
2 changes: 1 addition & 1 deletion script/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ install_packages_apt()
}

# dhcpv6 pd
with DHCPV6_PD_REF && if [[ $PLATFORM == "raspbian" ]]; then
with DHCPV6_PD_REF && if command -v apt-get &>/dev/null; then
sudo apt-get install --no-install-recommends -y dhcpcd
sudo mkdir -p /etc/systemd/system/dhcpcd.service.d
# allow edit system config file eg. /etc/radvd.conf
Expand Down
4 changes: 3 additions & 1 deletion script/reference-device/dhcpcd.enter-hook
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#!/bin/bash

WAN_INTERFACE="eth0"
WLAN_INTERFACE="wlan0"
WPAN_INTERFACE="wpan0"

RADVD_CONF="/etc/radvd.conf"
LOG_TAG="dhcpcd.enter.hook:"


config_ra()
{
logger -t "$LOG_TAG $reason start config radvd"
logger "$LOG_TAG $reason start config radvd"

sudo tee "${RADVD_CONF}" > /dev/null <<EOF
interface ${WPAN_INTERFACE}
Expand Down
3 changes: 2 additions & 1 deletion script/reference-device/dhcpcd.exit-hook
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@


WAN_INTERFACE="eth0"
WLAN_INTERFACE="wlan0"
WPAN_INTERFACE="wpan0"

RADVD_CONF="/etc/radvd.conf"
LOG_TAG="dhcpcd.exit.hook:"

config_ra()
{
logger -t "$LOG_TAG $reason start config radvd"
logger "$LOG_TAG $reason start config radvd"

sudo tee "${RADVD_CONF}" > /dev/null <<EOF
interface ${WPAN_INTERFACE}
Expand Down

0 comments on commit 7eb6fd4

Please sign in to comment.