[build]: build ARM kernel support from sonic-linux-kernel (#3556)

* Makefile: ARM kernel support from sonic-linux-kernel
        * Fix for multiarch  build docker spawn
Platform: Install the DTB deb for the platform

Signed-off-by: Antony Rheneus <arheneus@marvell.com>
This commit is contained in:
arheneus@marvell.com 2019-10-11 03:41:26 +05:30 committed by lguohan
parent 150ed36be2
commit 2694e66074
7 changed files with 20 additions and 19 deletions

View File

@ -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)

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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