Add arm64 support for build and installer

This commit is contained in:
Shengzhou Liu
2016-07-06 00:56:24 +08:00
parent 461078d30e
commit 1ed3041b9d
38 changed files with 123 additions and 11 deletions

View File

@@ -12,7 +12,7 @@ endif
include $(ONL)/make/config.mk
all: amd64 ppc arm
all: amd64 ppc arm arm64
$(MAKE) -C REPO build-clean
onl-amd64 onl-x86 x86 x86_64 amd64: packages_base_all
@@ -37,6 +37,9 @@ ifdef ONL_DEBIAN_SUITE_jessie
arm_toolchain_check:
@which arm-linux-gnueabi-gcc || (/bin/echo -e "*\n* ERROR\n*\n* This container does not support building for the ARM architecture.\n* Please use opennetworklinux/onlbuilder8:1.2 later.\n*" && exit 1)
arm64_toolchain_check:
@which aarch64-linux-gnu-gcc || (/bin/echo -e "*\n* ERROR\n*\n* This container does not support building for the ARM64 architecture.\n* Please use opennetworklinux/onlbuilder8:1.5 or later.\n*" && exit 1)
onl-arm arm: arm_toolchain_check packages_base_all
$(MAKE) -C packages/base/armel/kernels
$(MAKE) -C packages/base/armel/initrds
@@ -45,11 +48,24 @@ onl-arm arm: arm_toolchain_check packages_base_all
$(MAKE) -C packages/base/armel/faultd
$(MAKE) -C packages/base/armel/fit
$(MAKE) -C builds/armel
onl-arm64 arm64: arm64_toolchain_check packages_base_all
$(MAKE) -C packages/base/arm64/kernels
$(MAKE) -C packages/base/arm64/initrds
$(MAKE) -C packages/base/arm64/onlp
$(MAKE) -C packages/base/arm64/onlp-snmpd
$(MAKE) -C packages/base/arm64/faultd
$(MAKE) -C packages/base/arm64/fit
$(MAKE) -C builds/arm64
else
onl-arm arm:
@/bin/echo -e "*\n* Warning\n*\n* ARM Architecture support is only available in Jessie builds. Please use onbuilder -8.\n*"
onl-arm64 arm64:
@/bin/echo -e "*\n* Warning\n*\n* ARM64 Architecture support is only available in Jessie builds. Please use onbuilder -8.\n*"
endif

View File

@@ -0,0 +1 @@
include $(ONL)/make/repo.mk

View File

@@ -19,6 +19,7 @@ if test "$ARCH" != "$IARCH"; then
# identify mappings between kernel arch and debian arch
case "$IARCH:$ARCH" in
armel:armv7l) ;;
arm64:aarch64) ;;
powerpc:ppc) ;;
*)
echo
@@ -42,7 +43,7 @@ case "$ARCH" in
x86*|amd*|i?86*)
ARCH_X86=$ARCH
;;
arm*)
arm*|aarch64)
ARCH_ARM=$ARCH
;;
*)

View File

@@ -0,0 +1 @@
- u-boot-tools

View File

@@ -0,0 +1,9 @@
############################################################
#
# These packages are specific to the ONL root filesystem build.
#
############################################################
- onl-loader-fit

2
builds/arm64/Makefile Normal file
View File

@@ -0,0 +1,2 @@
DIRECTORIES := rootfs swi installer
include $(ONL)/make/subdirs.mk

View File

@@ -0,0 +1 @@
include $(ONL)/make/pkg.mk

View File

@@ -0,0 +1 @@
include $(ONL)/make/pkg.mk

View File

@@ -0,0 +1 @@
!include $ONL/builds/any/installer/APKG.yml ARCH=arm64 BOOTMODE=installed

View File

@@ -0,0 +1 @@
*INSTALLER

View File

@@ -0,0 +1,3 @@
BOOTMODE=INSTALLED
include $(ONL)/make/config.arm64.mk
include $(ONL)/builds/any/installer/uboot/builds/Makefile

View File

@@ -0,0 +1,4 @@
NETDEV=ma1
NETAUTO=dhcp
BOOTMODE=INSTALLED
SWI=images::latest

View File

@@ -0,0 +1,2 @@
This partition contains system configuration data that is persistant across installations and upgrades of ONL-based systems.

View File

@@ -0,0 +1 @@
include $(ONL)/make/pkg.mk

View File

@@ -0,0 +1 @@
!include $ONL/builds/any/installer/APKG.yml ARCH=arm64 BOOTMODE=swi

View File

@@ -0,0 +1 @@
*INSTALLER

View File

@@ -0,0 +1,3 @@
BOOTMODE=SWI
include $(ONL)/make/config.arm64.mk
include $(ONL)/builds/any/installer/uboot/builds/Makefile

View File

@@ -0,0 +1,4 @@
NETDEV=ma1
NETAUTO=dhcp
BOOTMODE=SWI
SWI=images::latest

View File

@@ -0,0 +1,2 @@
This partition contains system configuration data that is persistant across installations and upgrades of ONL-based systems.

View File

@@ -0,0 +1 @@
include $(ONL)/make/pkg.mk

View File

@@ -0,0 +1 @@
!include $ONL/builds/any/rootfs/APKG.yml ARCH=arm64

2
builds/arm64/rootfs/builds/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*.d/
manifest.json

View File

@@ -0,0 +1,14 @@
include $(ONL)/make/config.arm64.mk
#
# Default to include all available arm64 platforms.
# You override this with you own list or yaml file.
#
export PLATFORM_LIST=$(shell onlpm --list-platforms --arch arm64 --csv )
RFS_CONFIG := $(ONL)/builds/any/rootfs/$(ONL_DEBIAN_SUITE)/standard/standard.yml
RFS_DIR := rootfs-arm64.d
RFS_CPIO := rootfs-arm64.cpio.gz
RFS_SQUASH := rootfs-arm64.sqsh
include $(ONL)/make/rfs.mk

View File

@@ -0,0 +1 @@
include $(ONL)/make/pkg.mk

1
builds/arm64/swi/PKG.yml Normal file
View File

@@ -0,0 +1 @@
!include $ONL/builds/any/swi/APKG.yml ARCH=arm64

1
builds/arm64/swi/builds/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
manifest.json

View File

@@ -0,0 +1,3 @@
ROOTFS_PACKAGE := onl-rootfs
include $(ONL)/make/config.arm64.mk
include $(ONL)/make/swi.mk

View File

@@ -157,7 +157,7 @@ endif
endif
MODSYNCLIST_DEFAULT := .config Module.symvers Makefile include scripts arch/x86/include arch/x86/Makefile arch/powerpc/include arch/powerpc/Makefile arch/powerpc/lib arch/arm/include arch/arm/Makefile arch/arm/lib
MODSYNCLIST_DEFAULT := .config Module.symvers Makefile include scripts arch/x86/include arch/x86/Makefile arch/powerpc/include arch/powerpc/Makefile arch/powerpc/lib arch/arm/include arch/arm/Makefile arch/arm/lib arch/arm64/include arch/arm64/Makefile arch/arm64/lib
MODSYNCLIST := $(MODSYNCLIST_DEFAULT) $(MODSYNCLIST_EXTRA)
mbuild: build
@@ -169,8 +169,12 @@ dtbs: mbuild
ifdef DTS_LIST
rm -rf $(K_DTBS_DIR)
mkdir -p $(K_DTBS_DIR)
ifeq ($(ARCH),arm64)
cp $(K_SOURCE_DIR)/arch/$(ARCH)/boot/dts/*.dtb $(K_DTBS_DIR)
else
$(foreach name,$(DTS_LIST),$(K_SOURCE_DIR)/scripts/dtc/dtc -I dts -O dtb -o $(K_DTBS_DIR)/$(name).dtb $(K_SOURCE_DIR)/arch/$(ARCH)/boot/dts/$(name).dts; )
endif
endif
#
# This target can be used to manage the configuration file.

View File

@@ -14,7 +14,7 @@ include $(ONL)/make/config.mk
# directory tree.
#
ifndef ARCHES
ARCHES := amd64 powerpc armel all
ARCHES := amd64 powerpc armel arm64 all
endif
ONLPM_ENVIRONMENT = \

View File

@@ -39,6 +39,13 @@ default:
=: kernel-3.2-deb7-arm-iproc-all.bin.gz
<<: *arm-iproc-kernel-package
arm64-kernel-package: &arm64-kernel-package
package: onl-kernel-3.18.25-arm64-all:arm64
arm64-kernel: &arm64-kernel
=: kernel-3.18.25-arm64-all.bin.gz
<<: *arm64-kernel-package
##############################
#
# For your system, pick from the above list
@@ -68,6 +75,10 @@ default:
=: onl-loader-fit.itb
package: onl-loader-fit:armel
arm64-itb: &arm64-itb
=: onl-loader-fit.itb
package: onl-loader-fit:arm64
itb: *powerpc-itb
loader:

View File

@@ -317,3 +317,7 @@ class OnlPlatformPortConfig_32x100(object):
class OnlPlatformPortConfig_24x1_4x10(object):
PORT_COUNT=28
PORT_CONFIG="24x1 + 4x10"
class OnlPlatformPortConfig_8x1_8x10(object):
PORT_COUNT=16
PORT_CONFIG="8x1 + 8x10"

View File

@@ -33,6 +33,7 @@ def baseconfig():
'i386-linux-gnu',
'x86_64-linux-gnu',
'arm-linux-gnueabi',
'aarch64-linux-gnu',
]
for ht in HOST_TYPES:

View File

@@ -41,7 +41,8 @@ class OnlSystemConfig(object):
self.variables['ARCH'] = pp.machine()
self.variables['PARCH'] = dict(ppc='powerpc',
x86_64='amd64',
armv7l='armel')[pp.machine()]
armv7l='armel',
aarch64='arm64')[pp.machine()]
self.config = {}
for f in sorted(os.listdir(self.SYSTEM_CONFIG_DIR)):

View File

@@ -35,7 +35,7 @@ class BaseUpgrade(object):
self.init_argparser()
self.load_config()
self.arch = pp.machine()
self.parch = dict(ppc='powerpc', x86_64='amd64', armv7l='armel')[self.arch]
self.parch = dict(ppc='powerpc', x86_64='amd64', armv7l='armel', aarch64='arm64')[self.arch]
self.platform = OnlPlatform()
self.init()

View File

@@ -98,7 +98,9 @@ class KernelImage(Image):
elif arch == 'armel':
self.load = "<0x61008000>"
self.entry = "<0x61008000>"
elif arch == 'arm64':
self.load = "<0x80080000>"
self.entry = "<0x80080000>"
def write(self, f):
self.start_image(f)
@@ -118,6 +120,9 @@ class InitrdImage(Image):
elif arch == 'armel':
self.load = "<0x0000000>"
self.entry ="<0x0000000>"
elif arch == 'arm64':
self.load = "<0x0000000>"
self.entry ="<0x0000000>"
self.os = '"linux"'
@@ -298,7 +303,7 @@ if __name__ == '__main__':
ap.add_argument("--desc", nargs=1, help="Flat Image Tree description", default="ONL Flat Image Tree.")
ap.add_argument("--itb", metavar='itb-file', help="Compile result to an image tree blob file.")
ap.add_argument("--its", metavar='its-file', help="Write result to an image tree source file.")
ap.add_argument("--arch", choices=['powerpc', 'armel'], required=True)
ap.add_argument("--arch", choices=['powerpc', 'armel', 'arm64'], required=True)
ops=ap.parse_args()
fit = FlatImageTree(ops.desc)

View File

@@ -163,7 +163,7 @@ if __name__ == '__main__':
ap = argparse.ArgumentParser(NAME)
ap.add_argument("--arch", help="Installer Architecture.", required=True,
choices = ['amd64', 'powerpc', 'armel' ])
choices = ['amd64', 'powerpc', 'armel', 'arm64'])
ap.add_argument("--initrd", nargs=2, help="The system initrd.")
ap.add_argument("--fit", nargs=2, help="The system FIT image.")
ap.add_argument("--boot-config", help="The boot-config source.", required=True)

View File

@@ -1016,7 +1016,7 @@ def defaultPm():
packagedirs = os.environ['ONLPM_OPTION_PACKAGEDIRS'].split(':')
repoPackageDir = os.environ.get('ONLPM_OPTION_REPO_PACKAGE_DIR', 'packages')
subdir = os.getcwd()
arches = ['amd64', 'powerpc', 'armel', 'all',]
arches = ['amd64', 'powerpc', 'armel', 'arm64', 'all',]
if envJson:
for j in envJson.split(':'):
@@ -1053,7 +1053,7 @@ if __name__ == '__main__':
ap.add_argument("--csv", action='store_true')
ap.add_argument("--show-group", action='store_true')
ap.add_argument("--arch")
ap.add_argument("--arches", nargs='+', default=['amd64', 'powerpc', 'armel', 'all']),
ap.add_argument("--arches", nargs='+', default=['amd64', 'powerpc', 'armel', 'arm64', 'all']),
ap.add_argument("--pmake", action='store_true')
ap.add_argument("--prereq-packages", action='store_true')
ap.add_argument("--lookup", metavar='PACKAGE')

View File

@@ -235,6 +235,7 @@ class OnlRfsBuilder(object):
MULTISTRAP='/usr/sbin/multistrap'
QEMU_PPC='/usr/bin/qemu-ppc-static'
QEMU_ARM='/usr/bin/qemu-arm-static'
QEMU_ARM64='/usr/bin/qemu-aarch64-static'
BINFMT_PPC='/proc/sys/fs/binfmt_misc/qemu-ppc'
def __init__(self, config, arch, **kwargs):
@@ -263,6 +264,10 @@ class OnlRfsBuilder(object):
if not os.path.exists(self.QEMU_ARM):
raise OnlRfsError("%s is missing." % self.QEMU_ARM)
if self.arch == 'arm64':
if not os.path.exists(self.QEMU_ARM64):
raise OnlRfsError("%s is missing." % self.QEMU_ARM64)
if not 'Multistrap' in self.config:
raise OnlRfsError("The Multistrap configuration section is missing.")
@@ -300,6 +305,8 @@ class OnlRfsBuilder(object):
onlu.execute('sudo cp %s %s' % (self.QEMU_PPC, os.path.join(dir_, 'usr/bin')))
if self.arch == 'armel':
onlu.execute('sudo cp %s %s' % (self.QEMU_ARM, os.path.join(dir_, 'usr/bin')))
if self.arch == 'arm64':
onlu.execute('sudo cp %s %s' % (self.QEMU_ARM64, os.path.join(dir_, 'usr/bin')))
script = os.path.join(dir_, "tmp/configure.sh")
with open(script, "w") as f: