I clone and build sonic with steps below:
git clone https://github.com/Azure/sonic-buildimage.git
git checkout -b 201911 origin/201911
make init
make configure PLATFORM=cavium
make all
and it failed with this message:
+++ --- Making all --- +++
BLDENV=stretch make -f Makefile.work all
make[1]: Entering directory '/home/xu/sonic-buildimage'
SONiC Build System
Build Configuration
"CONFIGURED_PLATFORM" : "cavium"
"CONFIGURED_ARCH" : "amd64"
"SONIC_CONFIG_PRINT_DEPENDENCIES" : ""
"SONIC_BUILD_JOBS" : "1"
"SONIC_CONFIG_MAKE_JOBS" : "1"
"SONIC_USE_DOCKER_BUILDKIT" : ""
"USERNAME" : "admin"
"PASSWORD" : "YourPaSsWoRd"
"ENABLE_DHCP_GRAPH_SERVICE" : ""
"SHUTDOWN_BGP_ON_START" : ""
"ENABLE_PFCWD_ON_START" : ""
"INSTALL_DEBUG_TOOLS" : ""
"ROUTING_STACK" : "frr"
"FRR_USER_UID" : "300"
"FRR_USER_GID" : "300"
"ENABLE_SYNCD_RPC" : ""
"ENABLE_ORGANIZATION_EXTENSIONS" : "y"
"HTTP_PROXY" : ""
"HTTPS_PROXY" : ""
"ENABLE_SYSTEM_TELEMETRY" : "y"
"ENABLE_RESTAPI" : "n"
"ENABLE_ZTP" : ""
"SONIC_DEBUGGING_ON" : ""
"SONIC_PROFILING_ON" : ""
"KERNEL_PROCURE_METHOD" : "build"
"BUILD_TIMESTAMP" : "20200317.055823"
"BLDENV" : "stretch"
"VS_PREPARE_MEM" : "yes"
"ENABLE_SFLOW" : "y"
"ENABLE_NAT" : "y"
[ FAIL LOG START ] [ target/debs/stretch/cavm_platform_modules.deb ]
make[1]: Entering directory '/sonic/platform/cavium/cavm_platform_modules'
# get sources
rm -rf SONiC
git clone https://github.com/edge-core/SONiC.git
# build
pushd SONiC/AS7512-32X/module/
KERNEL_SRC=/lib/modules/4.9.0-11-2-amd64/build make
popd
mkdir -p cavm-platform-modules-deb/lib/modules/4.9.0-11-2-amd64
mkdir -p cavm-platform-modules-deb/usr/bin
mkdir -p cavm-platform-modules-deb/etc/systemd/system/multi-user.target.wants/
cp SONiC/AS7512-32X/module/*.ko cavm-platform-modules-deb/lib/modules/4.9.0-11-2-amd64
cp SONiC/AS7512-32X/accton_as7512_util.py cavm-platform-modules-deb/usr/bin
chmod +x cavm-platform-modules-deb/usr/bin/accton_as7512_util.py
cp as7512-platform-init.service cavm-platform-modules-deb/etc/systemd/system
ln -s /etc/systemd/system/as7512-platform-init.service cavm-platform-modules-deb/etc/systemd/system/multi-user.target.wants/as7512-platform-init.service
cp -r DEBIAN cavm-platform-modules-deb
dpkg-deb -b cavm-platform-modules-deb cavm_platform_modules.deb
mv cavm_platform_modules.deb /sonic/target/debs/stretch/
rm -rf cavm-platform-modules-deb
Cloning into 'SONiC'...
/sonic/platform/cavium/cavm_platform_modules/SONiC/AS7512-32X/module /sonic/platform/cavium/cavm_platform_modules
make[2]: Entering directory '/sonic/platform/cavium/cavm_platform_modules/SONiC/AS7512-32X/module'
make -C /lib/modules/4.9.0-11-2-amd64/build M=/sonic/platform/cavium/cavm_platform_modules/SONiC/AS7512-32X/module modules
make[3]: Entering directory '/sonic/platform/cavium/cavm_platform_modules/SONiC/AS7512-32X/module'
make[3]: *** /lib/modules/4.9.0-11-2-amd64/build: No such file or directory. Stop.
make[3]: Leaving directory '/sonic/platform/cavium/cavm_platform_modules/SONiC/AS7512-32X/module'
Makefile:14: recipe for target 'default' failed
make[2]: *** [default] Error 2
make[2]: Leaving directory '/sonic/platform/cavium/cavm_platform_modules/SONiC/AS7512-32X/module'
Makefile:11: recipe for target '/sonic/target/debs/stretch/cavm_platform_modules.deb' failed
make[1]: *** [/sonic/target/debs/stretch/cavm_platform_modules.deb] Error 2
make[1]: Leaving directory '/sonic/platform/cavium/cavm_platform_modules'
[ FAIL LOG END ] [ target/debs/stretch/cavm_platform_modules.deb ]
slave.mk:327: recipe for target 'target/debs/stretch/cavm_platform_modules.deb' failed
make: *** [target/debs/stretch/cavm_platform_modules.deb] Error 1
make[1]: *** [Makefile.work:196: all] Error 2
make[1]: Leaving directory '/home/xu/sonic-buildimage'
make: *** [Makefile:7: all] Error 2
It seems that linux kernel in sonic-slave-stretch-xu not match when compiling cavm_platform_modules.
docker run -it sonic-slave-stretch-xu:9005168983 /bin/bash
in directory /lib/modules only exists:
xu@1bb78fef7f84:/$ ls /lib/modules/
4.9.0-12-amd64
I hope to get some help!
I clone and build sonic with steps below:
and it failed with this message:
It seems that linux kernel in sonic-slave-stretch-xu not match when compiling cavm_platform_modules.
in directory /lib/modules only exists:
I hope to get some help!