diff --git a/freedommaker/builder.py b/freedommaker/builder.py index 6759d2f..7c4c90b 100644 --- a/freedommaker/builder.py +++ b/freedommaker/builder.py @@ -170,7 +170,12 @@ def process_variant(self): def process_architecture(self): """Add parameters specific to the architecture.""" if self.architecture not in ('i386', 'amd64'): - self.parameters += ['--foreign', '/usr/bin/qemu-arm-static'] + qemu_arch = 'arm' + if self.architecture == 'arm64': + qemu_arch = 'aarch64' + + self.parameters += ['--foreign', '/usr/bin/qemu-{arch}-static' + .format(arch=qemu_arch)] # Using taskset to pin build process to single core. This # is a workaround for a qemu-user-static issue that causes @@ -188,8 +193,11 @@ def process_boot_loader(self): self.parameters += option_map[self.boot_loader] if self.boot_loader == 'u-boot': - self.parameters += [ - '--package', 'u-boot-tools', '--package', 'u-boot'] + self.parameters += ['--package', 'u-boot-tools'] + if self.architecture != 'arm64': + self.parameters += ['--package', 'u-boot'] + else: + self.parameters += ['--package', 'u-boot-sunxi'] if self.boot_size: self.parameters += ['--bootsize', self.boot_size] @@ -565,3 +573,15 @@ class RaspberryPi2ImageBuilder(ARMImageBuilder): free = False boot_offset = '64mib' kernel_flavor = 'armmp' + + +class A64ImageBuidler(ARMImageBuilder): + """Image builder for all Allwinner A64 board based targets.""" + architecture = 'arm64' + kernel_flavor = 'arm64' + boot_offset = '1mib' + + +class Pine64PlusImageBuilder(A64ImageBuidler): + """Image builder for Pine A64+ (1GB and 2GB versions).""" + machine = 'pine64-plus' diff --git a/freedommaker/freedombox-customize b/freedommaker/freedombox-customize index 75f3c5d..0d7d90e 100755 --- a/freedommaker/freedombox-customize +++ b/freedommaker/freedombox-customize @@ -286,6 +286,12 @@ case "$MACHINE" in dd if=$rootdir/usr/lib/u-boot/Linksprite_pcDuino3/u-boot-sunxi-with-spl.bin of="$image" \ seek=8 conv=notrunc bs=1k ;; + pine64-plus) + dd if=$rootdir/usr/lib/u-boot/pine64_plus/sunxi-spl.bin of="$image" \ + seek=8 conv=notrunc bs=1k + dd if=$rootdir/usr/lib/u-boot/pine64_plus/u-boot.bin of="$image" \ + seek=40 conv=notrunc bs=1k + ;; esac if $use_eatmydata ; then diff --git a/freedommaker/hardware-setup b/freedommaker/hardware-setup index 56b41e6..3bc3461 100755 --- a/freedommaker/hardware-setup +++ b/freedommaker/hardware-setup @@ -196,4 +196,7 @@ case "$MACHINE" in pcduino3) setup_flash_kernel 'LinkSprite pcDuino3' ;; + pine64-plus) + setup_flash_kernel 'Pine64+' + ;; esac