diff --git a/share/aarch64.tmpl b/share/aarch64.tmpl new file mode 100644 index 00000000..701b22e9 --- /dev/null +++ b/share/aarch64.tmpl @@ -0,0 +1,49 @@ +<%page args="kernels, runtime_img, basearch, outroot, product, isolabel"/> +<% +configdir="tmp/config_files/aarch64" +PXEBOOTDIR="images/pxeboot" +BOOTDIR="boot" +KERNELDIR=PXEBOOTDIR +LIVEDIR="LiveOS" +%> + +mkdir ${LIVEDIR} +install ${runtime_img} ${LIVEDIR}/squashfs.img +treeinfo stage2 mainimage ${LIVEDIR}/squashfs.img + +## install bootloader and config files +mkdir ${BOOTDIR} +install ${configdir}/boot.msg ${BOOTDIR} +install ${configdir}/grub2-efi.cfg ${BOOTDIR} + +## configure bootloader +replace @VERSION@ ${product.version} ${BOOTDIR}/grub2-efi.cfg ${BOOTDIR}/*.msg +replace @PRODUCT@ '${product.name}' ${BOOTDIR}/grub2-efi.cfg ${BOOTDIR}/*.msg + +## install kernels +mkdir ${KERNELDIR} +%for kernel in kernels: + ## normal aarch64 + installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz + installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img + %if doupgrade: + installupgradeinitrd images-${basearch} ${kernel.upgrade.path} ${KERNELDIR}/upgrade.img + %endif +%endfor + +#FIXME: this will need adjusted when we have a real bootloader. +## WHeeeeeeee, EFI. +## We could remove the basearch restriction someday.. +<% efiargs=""; efigraft="" %> +%if exists("boot/efi/EFI/*/gcdaa64.efi"): + <% + efiarch = 'AARCH64' + efigraft="EFI/BOOT={0}/EFI/BOOT".format(outroot) + images = ["images/efiboot.img"] + for img in images: + efiargs += " -eltorito-alt-boot -e {0} -no-emul-boot".format(img) + efigraft += " {0}={1}/{0}".format(img,outroot) + %> + <%include file="efi.tmpl" args="configdir=configdir, KERNELDIR=KERNELDIR, efiarch=efiarch, isolabel=isolabel"/> +%endif + diff --git a/share/config_files/aarch64/boot.msg b/share/config_files/aarch64/boot.msg new file mode 100644 index 00000000..ff54899e --- /dev/null +++ b/share/config_files/aarch64/boot.msg @@ -0,0 +1,5 @@ + +splash.lss + + - Press the 0107 key to begin the installation process. + diff --git a/share/config_files/aarch64/grub.conf b/share/config_files/aarch64/grub.conf new file mode 100644 index 00000000..49fa32bd --- /dev/null +++ b/share/config_files/aarch64/grub.conf @@ -0,0 +1,13 @@ +#debug --graphics +default=0 +splashimage=@SPLASHPATH@ +timeout 5 +hiddenmenu +title Install @PRODUCT@ @VERSION@ + findiso + kernel @KERNELPATH@ @ROOT@ quiet + initrd @INITRDPATH@ +title Test this media & install @PRODUCT@ @VERSION@ + findiso + kernel @KERNELPATH@ @ROOT@ rd.live.check quiet + initrd @INITRDPATH@ diff --git a/share/config_files/aarch64/grub2-efi.cfg b/share/config_files/aarch64/grub2-efi.cfg new file mode 100644 index 00000000..289ed43d --- /dev/null +++ b/share/config_files/aarch64/grub2-efi.cfg @@ -0,0 +1,18 @@ +set default="0" + +insmod gzio +insmod part_gpt +insmod ext2 +insmod gzio + +set timeout=5 +### END /etc/grub.d/00_header ### + +### BEGIN /etc/grub.d/10_linux ### +menuentry 'Install @PRODUCT@ @VERSION@' --class fedora --class gnu-linux --class gnu --class os { + set root='hd0,gpt2' + devicetree @KERNELPATH@/../foundation-v8.dtb + linuxefi @KERNELPATH@ @ROOT@ mem=2G console=ttyAMA0 earlyprintk=pl011,0x1c090000 debug uefi_debug rw + initrdefi @INITRDPATH@ +} + diff --git a/share/runtime-install.tmpl b/share/runtime-install.tmpl index c8a9bd8a..479ce4cd 100644 --- a/share/runtime-install.tmpl +++ b/share/runtime-install.tmpl @@ -21,6 +21,9 @@ installpkg kernel %endif ## arch-specific packages (bootloaders etc.) +%if basearch == "aarch64": + installpkg grub2-efi grubby +%endif %if basearch in ("arm", "armhfp"): installpkg kernel-lpae kernel-tegra installpkg uboot-tools diff --git a/src/pylorax/__init__.py b/src/pylorax/__init__.py index a9137b49..285448ae 100644 --- a/src/pylorax/__init__.py +++ b/src/pylorax/__init__.py @@ -50,7 +50,7 @@ from discinfo import DiscInfo from executils import runcmd, runcmd_output class ArchData(DataHolder): - lib64_arches = ("x86_64", "ppc64", "s390x", "ia64") + lib64_arches = ("x86_64", "ppc64", "s390x", "ia64", "aarch64") bcj_arch = dict(i386="x86", x86_64="x86", ppc="powerpc", ppc64="powerpc", arm="arm", armhfp="arm") diff --git a/src/pylorax/treebuilder.py b/src/pylorax/treebuilder.py index 0f9766b5..2bf3a318 100644 --- a/src/pylorax/treebuilder.py +++ b/src/pylorax/treebuilder.py @@ -37,6 +37,7 @@ templatemap = { 'ppc64': 'ppc.tmpl', 's390': 's390.tmpl', 's390x': 's390.tmpl', + 'aarch64': 'aarch64.tmpl', 'arm': 'arm.tmpl', 'armhfp': 'arm.tmpl', }