Skip to content
This repository has been archived by the owner on Jan 14, 2018. It is now read-only.

WIP: Add support for building images for Pine A64+ #129

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions freedommaker/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand Down Expand Up @@ -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'
6 changes: 6 additions & 0 deletions freedommaker/freedombox-customize
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions freedommaker/hardware-setup
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,7 @@ case "$MACHINE" in
pcduino3)
setup_flash_kernel 'LinkSprite pcDuino3'
;;
pine64-plus)
setup_flash_kernel 'Pine64+'
;;
esac