Skip to content

Commit 79cae1e

Browse files
committed
RDKBACCL-653,RDKBACCL-660 : Serial number and randomized mac address
Reason for change : Serial number and randomized mac address Test Procedure: Build and flash the image.erouter0 should get ip Risks: None
1 parent c21fff6 commit 79cae1e

File tree

5 files changed

+69
-6
lines changed

5 files changed

+69
-6
lines changed

meta-rdk-mtk-bpir4/recipes-ccsp/ccsp/files/onewifi_pre_start.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ iw phy phy0 interface add wifi1 type __ap
1313
iw phy phy0 interface add wifi2 type __ap
1414

1515
#Obtain the wifi0 mac address
16-
wifi0_mac="$(cat /sys/class/ieee80211/phy0/macaddress)"
16+
wifi0_mac=`cat /nvram/mac_addresses.txt | grep -a wifi0 | cut -d " " -f 2`
1717
#Strip the : and increment mac by 1 to get wifi1 macaddress
18-
mac=$(echo $wifi0_mac | tr -d ':')
19-
mac_incr=$((0x$mac + 1))
20-
wifi1_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//')
18+
#mac=$(echo $wifi0_mac | tr -d ':')
19+
#mac_incr=$((0x$mac + 1))
20+
wifi1_mac=`cat /nvram/mac_addresses.txt | grep -a wifi1 | cut -d " " -f 2`
2121
#Increment again by 1 to get wifi2 address
22-
mac_incr=$(($mac_incr + 1))
23-
wifi2_mac=$(printf "%012x" $mac_incr | sed 's/../&:/g;s/:$//')
22+
#mac_incr=$(($mac_incr + 1))
23+
wifi2_mac=`cat /nvram/mac_addresses.txt | grep -a wifi2 | cut -d " " -f 2`
2424
#print the mac address
2525
echo $wifi0_mac
2626
echo $wifi1_mac

meta-rdk-mtk-bpir4/recipes-core/images/rdk-generic-broadband-image.bbappend

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ IMAGE_INSTALL_append = " parodus parodus2ccsp"
33

44
#TR069 Feature
55
IMAGE_INSTALL_append = " ccsp-tr069-pa"
6+
IMAGE_INSTALL_append = " bpi-serialnumber"
7+
IMAGE_INSTALL_append = " bpi-macaddress"
68

79
ROOTFS_POSTPROCESS_COMMAND_append = "add_busybox_fixes; "
810

meta-rdk-mtk-bpir4/recipes-devtools/init-filogic/init-filogic.bbappend

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ do_install_append(){
55
sed -i '/model/a \
66
if [ ! -d /nvram/secure ]; then \
77
mkdir -p /nvram/secure \
8+
fi \
9+
rdkmmap \
10+
rdkb-bpi-mac \
11+
if [ $? -eq 0 ];then \
12+
for i in 0 1 2 3 \
13+
do \
14+
LAN_MAC=`cat /nvram/mac_addresses.txt | grep -a lan${i} | cut -d " " -f 2` \
15+
if [ "x$LAN_MAC" != "x" ]; then \
16+
ifconfig lan${i} hw ether $LAN_MAC \
17+
fi \
18+
done \
819
fi' ${D}${sbindir}/init-bridge.sh
920
}
1021

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
SUMMARY = "Update the serial number"
2+
3+
LICENSE="Apache-2.0"
4+
LIC_FILES_CHKSUM = "file://LICENSE;md5=175792518e4ac015ab6696d16c4f607e"
5+
6+
inherit autotools ${@bb.utils.contains("DISTRO_FEATURES", "kirkstone", "python3native", "pythonnative", d)} systemd
7+
8+
SRC_URI = "git://github.com/rdkcentral/broadband-utils.git;branch=main;protocol=https;"
9+
10+
S = "${WORKDIR}/git"
11+
SRCREV = "${AUTOREV}"
12+
CXXFLAGS_append = " -DAARCH64_BUILD"
13+
14+
15+
do_compile() {
16+
${CXX} ${S}/rdkb-bpi-mac/source/*.cpp ${LDFLAGS} ${CXXFLAGS} -I ${S}/rdkb-bpi-mac//include -o rdkb-bpi-mac
17+
}
18+
19+
do_install() {
20+
install -d ${D}${bindir}
21+
install -m 0755 rdkb-bpi-mac ${D}${bindir}/rdkb-bpi-mac
22+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
SUMMARY = "Update the serial number"
2+
3+
LICENSE="Apache-2.0"
4+
LIC_FILES_CHKSUM = "file://LICENSE;md5=175792518e4ac015ab6696d16c4f607e"
5+
6+
inherit autotools ${@bb.utils.contains("DISTRO_FEATURES", "kirkstone", "python3native", "pythonnative", d)} systemd
7+
8+
SRC_URI = "git://github.com/rdkcentral/broadband-utils.git;branch=main;protocol=https;"
9+
10+
S = "${WORKDIR}/git"
11+
SRCREV = "${AUTOREV}"
12+
13+
CFLAGS_append += " -DAARCH64_BUILD"
14+
15+
do_compile() {
16+
${CC} ${S}/rdkmmap/source/*.c ${LDFLAGS} ${CFLAGS} -I ${S}/rdkmmap/include -o rdkmmap
17+
}
18+
19+
do_install() {
20+
install -d ${D}${bindir}
21+
install -m 0755 rdkmmap ${D}${bindir}/rdkmmap
22+
# install -D -m 0644 ${S}/rdkmmap/rdkmmap.service ${D}${systemd_unitdir}/system/rdkmmap.service
23+
}
24+
25+
#SYSTEMD_SERVICE_${PN} += " rdkmmap.service"
26+
27+
#FILES_${PN}_append = "${systemd_unitdir}/system/rdkmmap.service"
28+

0 commit comments

Comments
 (0)