diff --git a/Makefile.work b/Makefile.work index cc433ca98e0c..e18cabeda9ca 100644 --- a/Makefile.work +++ b/Makefile.work @@ -126,7 +126,7 @@ ifneq (,$(filter $(CONFIGURED_ARCH), armhf arm64)) DOCKER_MULTIARCH_CHECK := docker inspect --type image multiarch/qemu-user-static:register &> /dev/null || (echo "multiarch docker not found ..."; docker run --rm --privileged multiarch/qemu-user-static:register --reset --credential yes) - DOCKER_SERVICE_MULTIARCH_CHECK := docker -H unix:///var/run/march/docker.sock info &> /dev/null || (echo "Docker march service not running..."; sudo rm -fr /var/run/march/*; (sudo $(SONIC_NATIVE_DOCKERD_FOR_MUTLIARCH) &) &>/dev/null ; sleep 1; sudo $(SONIC_USERFACL_DOCKERD_FOR_MUTLIARCH);) + DOCKER_SERVICE_MULTIARCH_CHECK := docker -H unix:///var/run/march/docker.sock info &> /dev/null || (echo "Docker march service not running..."; sudo rm -fr /var/run/march/; (sudo $(SONIC_NATIVE_DOCKERD_FOR_MUTLIARCH) &) &>/dev/null ; sleep 1; sudo $(SONIC_USERFACL_DOCKERD_FOR_MUTLIARCH);) # Docker service to load the compiled dockers-*.gz SONIC_NATIVE_DOCKERD_FOR_DOCKERFS := rm -fr $(PWD)/dockerfs/; mkdir -p $(PWD)/dockerfs/; sudo dockerd --storage-driver=overlay2 --iptables=false \ @@ -184,8 +184,10 @@ SONIC_BUILD_INSTRUCTION := make \ %:: ifneq (,$(filter $(CONFIGURED_ARCH), armhf arm64)) @$(DOCKER_MULTIARCH_CHECK) +ifneq ($(BLDENV), ) @$(DOCKER_SERVICE_MULTIARCH_CHECK) @$(DOCKER_SERVICE_DOCKERFS_CHECK) +endif endif @$(OVERLAY_MODULE_CHECK) diff --git a/build_debian.sh b/build_debian.sh index 34bf6eba6ab1..c1a13d1ae7d3 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -132,16 +132,11 @@ fi sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install busybox echo '[INFO] Install SONiC linux kernel image' ## Note: duplicate apt-get command to ensure every line return zero -if [[ $CONFIGURED_ARCH == armhf || $CONFIGURED_ARCH == arm64 ]]; then - sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install cpio klibc-utils kmod libklibc udev linux-base - sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/linux-image-*${CONFIGURED_ARCH}*.deb || \ - sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f -fi sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/initramfs-tools-core_*.deb || \ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/initramfs-tools_*.deb || \ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f -sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/linux-image-${LINUX_KERNEL_VERSION}-${CONFIGURED_ARCH}_*.deb || \ +sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/linux-image-${LINUX_KERNEL_VERSION}-*_${CONFIGURED_ARCH}.deb || \ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install acl [[ $CONFIGURED_ARCH == amd64 ]] && sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install dmidecode diff --git a/platform/marvell-armhf/linux-kernel-armhf.mk b/platform/marvell-armhf/linux-kernel-armhf.mk index dc5b489635c8..32e8ea3c604a 100644 --- a/platform/marvell-armhf/linux-kernel-armhf.mk +++ b/platform/marvell-armhf/linux-kernel-armhf.mk @@ -1,10 +1,7 @@ # linux kernel package for marvell armhf -KVERSION = 4.9.168 - - -LINUX_KERNEL = linux-image-4.9.168-armhf.deb -export LINUX_KERNEL - -$(LINUX_KERNEL)_SRC_PATH = $(PLATFORM_PATH)/linux -SONIC_MAKE_DEBS += $(LINUX_KERNEL) +# Add platform specific DTB +LINUX_KERNEL_DTB = linux-image-4.9.168-armhf.deb +$(LINUX_KERNEL_DTB)_URL = https://github.com/Marvell-switching/sonic-marvell-binaries/raw/master/armhf/kernel/$(LINUX_KERNEL_DTB) +SONIC_ONLINE_DEBS += $(LINUX_KERNEL_DTB) +SONIC_STRETCH_DEBS += $(LINUX_KERNEL_DTB) diff --git a/platform/marvell-armhf/linux/Makefile b/platform/marvell-armhf/linux/Makefile index 0a616fa758d9..dba660649abf 100644 --- a/platform/marvell-armhf/linux/Makefile +++ b/platform/marvell-armhf/linux/Makefile @@ -2,9 +2,9 @@ SHELL = /bin/bash .SHELLFLAGS += -e -LINUX_KERNEL_MRVL_URL = https://github.com/Marvell-switching/sonic-marvell-binaries/raw/master/armhf/kernel/$(LINUX_KERNEL) +LINUX_KERNEL_MRVL_URL = https://github.com/Marvell-switching/sonic-marvell-binaries/raw/master/armhf/kernel/$(LINUX_KERNEL_DTB) -$(addprefix $(DEST)/, $(LINUX_KERNEL)): $(DEST)/% : +$(addprefix $(DEST)/, $(LINUX_KERNEL_DTB)): $(DEST)/% : # get deb package - wget -O $(DEST)/$(LINUX_KERNEL) $(LINUX_KERNEL_MRVL_URL) + wget -O $(DEST)/$(LINUX_KERNEL_DTB) $(LINUX_KERNEL_MRVL_URL) diff --git a/platform/marvell-armhf/platform.conf b/platform/marvell-armhf/platform.conf index 51a4dc315acc..e574a8d1a0cd 100644 --- a/platform/marvell-armhf/platform.conf +++ b/platform/marvell-armhf/platform.conf @@ -8,7 +8,7 @@ echo "Preparing for installation ... " kernel_addr=0x1100000 fdt_addr=0x1000000 -image_name="/boot/zImage" +image_name="/vmlinuz" fdt_name="/boot/armada-385-ET6448M_4G_Nand.dtb" # global mount defines diff --git a/rules/linux-kernel.mk b/rules/linux-kernel.mk index bc95255e0dff..5250f8b97e8f 100644 --- a/rules/linux-kernel.mk +++ b/rules/linux-kernel.mk @@ -4,6 +4,10 @@ KVERSION_SHORT = 4.9.0-9-2 KVERSION = $(KVERSION_SHORT)-$(CONFIGURED_ARCH) KERNEL_VERSION = 4.9.168 KERNEL_SUBVERSION = 1+deb9u5 +ifeq ($(CONFIGURED_ARCH), armhf) +# Override kernel version for ARMHF as it uses arm MP (multi-platform) for short version +KVERSION = $(KVERSION_SHORT)-armmp +endif export KVERSION_SHORT KVERSION KERNEL_VERSION KERNEL_SUBVERSION diff --git a/sonic-slave-stretch/Dockerfile.j2 b/sonic-slave-stretch/Dockerfile.j2 index e468cdf354a8..af6e7deadc31 100644 --- a/sonic-slave-stretch/Dockerfile.j2 +++ b/sonic-slave-stretch/Dockerfile.j2 @@ -156,6 +156,9 @@ RUN apt-get update && apt-get install -y \ # For broadcom sdk build {%- if CONFIGURED_ARCH == "amd64" %} linux-compiler-gcc-6-x86 \ +{%- endif %} +{%- if CONFIGURED_ARCH == "armhf" %} + linux-compiler-gcc-6-arm \ {%- endif %} linux-kbuild-4.9 \ # teamd build