2012-06-21 07:31:58 +00:00
|
|
|
<%page args="kernels, runtime_img, runtime_base, basearch, outroot, arch"/>
|
|
|
|
<%
|
|
|
|
configdir="tmp/config_files/uboot"
|
|
|
|
PXEBOOTDIR="images/pxeboot"
|
2013-10-14 22:55:06 +00:00
|
|
|
DTBDIR="images/pxeboot/dtb"
|
2012-06-21 07:31:58 +00:00
|
|
|
BOOTDIR="boot"
|
|
|
|
KERNELDIR=PXEBOOTDIR
|
2015-02-27 20:00:44 +00:00
|
|
|
STAGE2IMG="images/install.img"
|
2014-11-06 17:16:49 +00:00
|
|
|
LORAXDIR="usr/share/lorax/"
|
2012-06-21 07:31:58 +00:00
|
|
|
|
|
|
|
# different platforms use different kernel load addresses.
|
|
|
|
# include a 'baseline' kernel for no 'flavor'.
|
|
|
|
kernelAddress = { 'baseline' : '0x00008000',
|
2013-04-16 17:06:04 +00:00
|
|
|
'lpae' : '0x00008000',
|
2012-06-21 07:31:58 +00:00
|
|
|
}
|
2013-01-26 01:35:24 +00:00
|
|
|
|
|
|
|
# keep a comma-delimited list of platforms installed to add to .treeinfo
|
|
|
|
platforms = ""
|
|
|
|
delimiter = ''
|
2012-06-21 07:31:58 +00:00
|
|
|
%>
|
|
|
|
|
2015-02-27 20:00:44 +00:00
|
|
|
mkdir images
|
|
|
|
install ${runtime_img} ${STAGE2IMG}
|
|
|
|
treeinfo stage2 mainimage ${STAGE2IMG}
|
2012-06-21 07:31:58 +00:00
|
|
|
|
2013-10-14 22:55:06 +00:00
|
|
|
mkdir ${DTBDIR}
|
|
|
|
install boot/dtb-*/*dtb ${DTBDIR}/
|
|
|
|
|
2012-06-21 07:31:58 +00:00
|
|
|
## 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
|
2013-01-26 01:35:24 +00:00
|
|
|
<%
|
|
|
|
platforms = platforms + delimiter + kernel.flavor
|
|
|
|
delimiter = ','
|
|
|
|
%>
|
2012-06-21 07:31:58 +00:00
|
|
|
|
2012-12-18 13:31:45 +00:00
|
|
|
%if doupgrade:
|
|
|
|
## install upgrade image
|
|
|
|
installupgradeinitrd images-${kernel.flavor}-${basearch} ${kernel.upgrade.path} ${KERNELDIR}/upgrade-${kernel.flavor}.img
|
2013-01-14 22:00:52 +00:00
|
|
|
|
|
|
|
runcmd mkimage \
|
|
|
|
-A arm -O linux -T ramdisk -C none \
|
|
|
|
-a 0 -e 0 \
|
|
|
|
-n "${product.name} ${product.version} ${kernel.flavor} ${kernel.arch}" \
|
|
|
|
-d ${outroot}/${KERNELDIR}/upgrade-${kernel.flavor}.img \
|
|
|
|
${outroot}/${KERNELDIR}/uUpgrade-${kernel.flavor}
|
|
|
|
|
|
|
|
treeinfo images-${kernel.flavor}-${basearch} uupgrade ${KERNELDIR}/uUpgrade-${kernel.flavor}
|
|
|
|
|
2012-12-18 13:31:45 +00:00
|
|
|
%endif
|
2012-11-13 06:33:17 +00:00
|
|
|
|
|
|
|
## create U-Boot wrapped images
|
2012-06-21 07:31:58 +00:00
|
|
|
|
|
|
|
runcmd mkimage \
|
|
|
|
-A arm -O linux -T ramdisk -C none \
|
|
|
|
-a 0 -e 0 \
|
|
|
|
-n "${product.name} ${product.version} ${kernel.flavor} ${kernel.arch}" \
|
|
|
|
-d ${outroot}/${KERNELDIR}/initrd-${kernel.flavor}.img \
|
|
|
|
${outroot}/${KERNELDIR}/uInitrd-${kernel.flavor}
|
|
|
|
|
|
|
|
runcmd mkimage \
|
|
|
|
-A arm -O linux -T kernel -C none \
|
|
|
|
-a ${kernelAddress[kernel.flavor]} -e ${kernelAddress[kernel.flavor]} \
|
|
|
|
-n "${product.name} ${product.version} ${kernel.flavor} ${kernel.arch}" \
|
|
|
|
-d ${outroot}/${KERNELDIR}/vmlinuz-${kernel.flavor} \
|
|
|
|
${outroot}/${KERNELDIR}/uImage-${kernel.flavor}
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2012-12-18 13:31:45 +00:00
|
|
|
%if doupgrade:
|
|
|
|
## install upgrade image
|
|
|
|
installupgradeinitrd images-${basearch} ${kernel.upgrade.path} ${KERNELDIR}/upgrade.img
|
2013-01-14 22:00:52 +00:00
|
|
|
|
|
|
|
runcmd mkimage \
|
|
|
|
-A arm -O linux -T ramdisk -C none \
|
|
|
|
-a 0 -e 0 \
|
|
|
|
-n "${product.name} ${product.version} ${kernel.flavor} ${kernel.arch}" \
|
|
|
|
-d ${outroot}/${KERNELDIR}/upgrade.img \
|
|
|
|
${outroot}/${KERNELDIR}/uUpgrade
|
|
|
|
|
|
|
|
treeinfo images-${basearch} uupgrade ${KERNELDIR}/uUpgrade
|
|
|
|
|
2012-12-18 13:31:45 +00:00
|
|
|
%endif
|
2012-11-13 06:33:17 +00:00
|
|
|
|
|
|
|
## create U-Boot wrapped images
|
2012-06-21 07:31:58 +00:00
|
|
|
|
|
|
|
runcmd mkimage \
|
|
|
|
-A arm -O linux -T ramdisk -C none \
|
|
|
|
-a 0 -e 0 \
|
|
|
|
-n "${product.name} ${product.version} ${kernel.arch}" \
|
|
|
|
-d ${outroot}/${KERNELDIR}/initrd.img \
|
|
|
|
${outroot}/${KERNELDIR}/uInitrd
|
|
|
|
|
|
|
|
runcmd mkimage \
|
|
|
|
-A arm -O linux -T kernel -C none \
|
|
|
|
-a ${kernelAddress['baseline']} -e ${kernelAddress['baseline']} \
|
|
|
|
-n "${product.name} ${product.version} ${kernel.arch}" \
|
|
|
|
-d ${outroot}/${KERNELDIR}/vmlinuz \
|
|
|
|
${outroot}/${KERNELDIR}/uImage
|
|
|
|
|
|
|
|
treeinfo images-${basearch} uimage ${KERNELDIR}/uImage
|
|
|
|
treeinfo images-${basearch} uinitrd ${KERNELDIR}/uInitrd
|
|
|
|
|
|
|
|
%endif
|
|
|
|
%endfor
|
|
|
|
|
2013-01-26 01:35:24 +00:00
|
|
|
# add platform to treeinfo for Beaker support
|
|
|
|
treeinfo ${basearch} platforms ${platforms}
|
|
|
|
|
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)):
|
|
|
|
installimg ${LORAXDIR}/${img}/ images/${img}.img
|
|
|
|
%endif
|
|
|
|
%endfor
|
2012-06-21 07:31:58 +00:00
|
|
|
|
|
|
|
## FIXME: ARM may need some extra boot config
|
|
|
|
|