2012-07-27 14:45:57 +00:00
|
|
|
<%page args="kernels, runtime_img, runtime_base, basearch, outroot, arch"/>
|
|
|
|
<%
|
|
|
|
configdir="tmp/config_files/uboot"
|
|
|
|
PXEBOOTDIR="images/pxeboot"
|
|
|
|
BOOTDIR="boot"
|
|
|
|
KERNELDIR=PXEBOOTDIR
|
|
|
|
LIVEDIR="LiveOS"
|
2014-11-06 17:16:49 +00:00
|
|
|
LORAXDIR="usr/share/lorax/"
|
2017-03-09 19:18:08 +00:00
|
|
|
|
|
|
|
from os.path import basename
|
2012-07-27 14:45:57 +00:00
|
|
|
%>
|
|
|
|
|
|
|
|
mkdir ${LIVEDIR}
|
|
|
|
install ${runtime_img} ${LIVEDIR}/squashfs.img
|
|
|
|
treeinfo stage2 mainimage ${LIVEDIR}/squashfs.img
|
|
|
|
|
|
|
|
## install kernels
|
|
|
|
mkdir ${KERNELDIR}
|
|
|
|
%for kernel in kernels:
|
|
|
|
%if kernel.flavor:
|
|
|
|
installkernel images-${kernel.flavor}-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz-${kernel.flavor}
|
|
|
|
installinitrd images-${kernel.flavor}-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd-${kernel.flavor}.img
|
|
|
|
|
|
|
|
treeinfo images-${kernel.flavor}-${basearch} uimage ${KERNELDIR}/uImage-${kernel.flavor}
|
|
|
|
treeinfo images-${kernel.flavor}-${basearch} uinitrd ${KERNELDIR}/uInitrd-${kernel.flavor}
|
|
|
|
|
|
|
|
%else:
|
|
|
|
installkernel images-${basearch} ${kernel.path} ${KERNELDIR}/vmlinuz
|
|
|
|
installinitrd images-${basearch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
|
|
|
|
|
|
|
|
treeinfo images-${basearch} uimage ${KERNELDIR}/uImage
|
|
|
|
treeinfo images-${basearch} uinitrd ${KERNELDIR}/uInitrd
|
|
|
|
|
|
|
|
%endif
|
|
|
|
%endfor
|
|
|
|
|
2014-11-06 17:16:49 +00:00
|
|
|
# Create optional product.img and updates.img
|
|
|
|
<% images=["product", "updates"] %>
|
|
|
|
%for img in images:
|
|
|
|
%if exists("%s/%s/" % (LORAXDIR, img)):
|
2016-03-24 16:33:37 +00:00
|
|
|
installimg --xz -9 --memlimit-compress=3700MiB ${LORAXDIR}/${img}/ images/${img}.img
|
2016-05-11 00:39:01 +00:00
|
|
|
treeinfo images-${basearch} ${img}.img images/${img}.img
|
2014-11-06 17:16:49 +00:00
|
|
|
%endif
|
|
|
|
%endfor
|
2012-07-27 14:45:57 +00:00
|
|
|
|
2017-03-09 19:18:08 +00:00
|
|
|
# Add the license files
|
|
|
|
%for f in glob("/usr/share/licenses/*-release/*"):
|
|
|
|
install ${f} ${f|basename}
|
|
|
|
%endfor
|
|
|
|
|
2012-07-27 14:45:57 +00:00
|
|
|
## FIXME: ARM may need some extra boot config
|
|
|
|
|