support ppc64le in lorax

Add support for the ppc64le architecture in lorax.

Signed-off-by: Brian C. Lane <bcl@redhat.com>
This commit is contained in:
Mark Hamzy 2014-03-25 15:35:31 -05:00 committed by Brian C. Lane
parent a999566614
commit cc2f98bfc5
4 changed files with 85 additions and 2 deletions

82
share/ppc64le.tmpl Normal file
View File

@ -0,0 +1,82 @@
<%page args="kernels, runtime_img, basearch, libdir, inroot, outroot, product, isolabel"/>
<%
configdir="tmp/config_files/ppc"
BOOTDIR="ppc"
GRUBDIR="boot/grub"
LIVEDIR="LiveOS"
## NOTE: yaboot freaks out and stops parsing its config if it sees a '\',
## so we can't use the udev escape sequences in the root arg.
## Instead we'll just replace any non-ASCII characters in the isolabel
## with '_', which means we won't need any udev escapes.
isolabel = ''.join(ch if ch.isalnum() else '_' for ch in isolabel)
## Anaconda finds the CDROM device automatically
rootarg = ""
%>
mkdir ${LIVEDIR}
install ${runtime_img} ${LIVEDIR}/squashfs.img
treeinfo stage2 mainimage ${LIVEDIR}/squashfs.img
## install the bootloaders
## ppc/chrp: for normal PPC systems.
## uses /ppc/bootinfo.txt in the iso root
## uses /boot/grub/grub.cfg in the iso root
mkdir ${BOOTDIR}
## boot stuff for normal (CHRP/PREP) PPC systems
install ${configdir}/bootinfo.txt ${BOOTDIR}
mkdir ${GRUBDIR}/powerpc-ieee1275
## "()" means the current device to grub2
runcmd grub2-mkimage --format=powerpc-ieee1275 --directory=/usr/lib/grub/powerpc-ieee1275 --prefix="()/"${GRUBDIR} \
--output=${outroot}/${GRUBDIR}/powerpc-ieee1275/core.elf iso9660 ext2 ofnet net tftp http
install /usr/lib/grub/powerpc-ieee1275/*.mod ${GRUBDIR}/powerpc-ieee1275
install /usr/lib/grub/powerpc-ieee1275/*.lst ${GRUBDIR}/powerpc-ieee1275
install ${configdir}/grub.cfg.in ${GRUBDIR}/grub.cfg
replace @PRODUCT@ '${product.name}' ${GRUBDIR}/grub.cfg
replace @VERSION@ ${product.version} ${GRUBDIR}/grub.cfg
replace @ROOT@ "${rootarg}" ${GRUBDIR}/grub.cfg
## copy mapping and magic files needed for isos
install ${configdir}/mapping ${BOOTDIR}
install ${configdir}/magic ${BOOTDIR}
## Install kernel and bootloader config (in separate places for each arch)
%for kernel in kernels:
<%
bits = 64
## separate dirs/images for each arch
KERNELDIR=BOOTDIR+"/ppc%s" % bits
%>
## install kernel
mkdir ${KERNELDIR}
installkernel images-${kernel.arch} ${kernel.path} ${KERNELDIR}/vmlinuz
installinitrd images-${kernel.arch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
%if doupgrade:
## upgrade image
installupgradeinitrd images-${kernel.arch} ${kernel.upgrade.path} ${KERNELDIR}/upgrade.img
%endif
treeinfo images-${kernel.arch} zimage
%endfor
## make boot.iso
mkdir images/
runcmd mkisofs -v -U -J -R -T \
-o ${outroot}/images/boot.iso \
-part -hfs -r -l -sysid PPC \
-A "${product.name} ${product.version}" -V '${isolabel}' \
-volset "${product.version}" -volset-size 1 -volset-seqno 1 \
-hfs-volid ${product.version} \
-chrp-boot -map ${inroot}/${configdir}/mapping \
-no-desktop -allow-multidot -graft-points \
${BOOTDIR}=${outroot}/${BOOTDIR} \
${GRUBDIR}=${outroot}/${GRUBDIR} \
${LIVEDIR}=${outroot}/${LIVEDIR}
%for kernel in kernels:
treeinfo images-${kernel.arch} boot.iso images/boot.iso
%endfor

View File

@ -34,7 +34,7 @@ installpkg grubby
%if basearch in ("i386", "x86_64"):
installpkg grub2 grub2-tools biosdevname memtest86+ syslinux
%endif
%if basearch in ("ppc", "ppc64"):
%if basearch in ("ppc", "ppc64", "ppc64le"):
installpkg grub2 grub2-tools fbset hfsutils kernel-bootwrapper ppc64-utils
%endif
%if basearch == "s390x":

View File

@ -54,7 +54,7 @@ REMOVE_PPC64_DRIVERS = "floppy scsi_debug nouveau radeon cirrus mgag200"
REMOVE_PPC64_MODULES = "drm plymouth"
class ArchData(DataHolder):
lib64_arches = ("x86_64", "ppc64", "s390x", "ia64", "aarch64")
lib64_arches = ("x86_64", "ppc64", "ppc64le", "s390x", "ia64", "aarch64")
bcj_arch = dict(i386="x86", x86_64="x86",
ppc="powerpc", ppc64="powerpc",
arm="arm", armhfp="arm")

View File

@ -35,6 +35,7 @@ templatemap = {
'x86_64': 'x86.tmpl',
'ppc': 'ppc.tmpl',
'ppc64': 'ppc.tmpl',
'ppc64le': 'ppc64le.tmpl',
's390': 's390.tmpl',
's390x': 's390.tmpl',
'aarch64': 'aarch64.tmpl',