3 .
/lib
/functions
/uci-defaults.sh
4 .
/lib
/functions
/system.sh
6 rockchip_setup_interfaces
()
11 friendlyarm
,nanopi-r2s
)
12 ucidef_set_interfaces_lan_wan
'eth1' 'eth0'
15 ucidef_set_interface_lan
'eth0'
20 nanopi_r2s_generate_mac
()
22 local sd_hash
=$
(sha256sum
/sys
/devices
/platform
/ff500000.dwmmc
/mmc_host
/mmc
0/mmc0
:*/cid
)
23 local mac_base
=$
(macaddr_canonicalize
"$(echo "${sd_hash}" | dd bs=1 count=12 2>/dev/null)")
24 echo "$(macaddr_unsetbit_mc "$
(macaddr_setbit_la
"${mac_base}")")"
35 friendlyarm
,nanopi-r2s
)
36 wan_mac
=$
(nanopi_r2s_generate_mac
)
37 lan_mac
=$
(macaddr_add
"$wan_mac" +1)
41 [ -n "$lan_mac" ] && ucidef_set_interface_macaddr
"lan" $lan_mac
42 [ -n "$wan_mac" ] && ucidef_set_interface_macaddr
"wan" $wan_mac
43 [ -n "$label_mac" ] && ucidef_set_label_macaddr
$label_mac
48 rockchip_setup_interfaces
$board
49 rockchip_setup_macs
$board