From 9fe59eed0b329c0d870d1dfd532183bbdf7755df Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Thu, 9 Mar 2017 11:08:19 -0800 Subject: [PATCH] lorax: Add release license files to / of the iso --- share/templates.d/99-generic/aarch64.tmpl | 14 ++++++++++---- share/templates.d/99-generic/arm.tmpl | 8 +++++++- share/templates.d/99-generic/ppc.tmpl | 16 ++++++++++++---- share/templates.d/99-generic/ppc64le.tmpl | 16 ++++++++++++---- share/templates.d/99-generic/s390.tmpl | 14 +++++++++++--- share/templates.d/99-generic/x86.tmpl | 14 ++++++++++---- 6 files changed, 62 insertions(+), 20 deletions(-) diff --git a/share/templates.d/99-generic/aarch64.tmpl b/share/templates.d/99-generic/aarch64.tmpl index 00e9a469..c9164c22 100644 --- a/share/templates.d/99-generic/aarch64.tmpl +++ b/share/templates.d/99-generic/aarch64.tmpl @@ -52,12 +52,12 @@ mkdir ${KERNELDIR} %endif # Create optional product.img and updates.img -<% imggraft=""; images=["product", "updates"] %> +<% filegraft=""; images=["product", "updates"] %> %for img in images: %if exists("%s/%s/" % (LORAXDIR, img)): installimg ${LORAXDIR}/${img}/ images/${img}.img treeinfo images-${basearch} ${img}.img images/${img}.img - <% imggraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %> + <% filegraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %> %endif %endfor @@ -65,9 +65,15 @@ mkdir ${KERNELDIR} <% import os if os.path.exists(workdir + "/iso-graft"): - imggraft += " " + workdir + "/iso-graft" + filegraft += " " + workdir + "/iso-graft" %> +# Add the license files +%for f in glob("/usr/share/licenses/*-release/*"): + install ${f} ${f|basename} + <% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %> +%endfor + %if exists("boot/efi/EFI/*/gcdaa64.efi"): ## make boot.iso runcmd mkisofs -o ${outroot}/images/boot.iso \ @@ -75,6 +81,6 @@ runcmd mkisofs -o ${outroot}/images/boot.iso \ -graft-points \ ${KERNELDIR}=${outroot}/${KERNELDIR} \ ${STAGE2IMG}=${outroot}/${STAGE2IMG} \ - ${efigraft} ${imggraft} + ${efigraft} ${filegraft} treeinfo images-${basearch} boot.iso images/boot.iso %endif diff --git a/share/templates.d/99-generic/arm.tmpl b/share/templates.d/99-generic/arm.tmpl index d7b9b144..d7372daf 100644 --- a/share/templates.d/99-generic/arm.tmpl +++ b/share/templates.d/99-generic/arm.tmpl @@ -52,7 +52,13 @@ treeinfo ${basearch} platforms ${platforms} <% import os if os.path.exists(workdir + "/iso-graft"): - imggraft += " " + workdir + "/iso-graft" + filegraft += " " + workdir + "/iso-graft" %> +# Add the license files +%for f in glob("/usr/share/licenses/*-release/*"): + install ${f} ${f|basename} + <% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %> +%endfor + ## FIXME: ARM may need some extra boot config diff --git a/share/templates.d/99-generic/ppc.tmpl b/share/templates.d/99-generic/ppc.tmpl index d092dc91..962a9c38 100644 --- a/share/templates.d/99-generic/ppc.tmpl +++ b/share/templates.d/99-generic/ppc.tmpl @@ -21,6 +21,8 @@ isolabel = ''.join(ch if ch.isalnum() else '_' for ch in isolabel) ## Anaconda finds the CDROM device automatically rootarg = "" + +from os.path import basename %> ## Test ${runtime_img} to see if udf is needed @@ -93,12 +95,12 @@ install ${configdir}/mapping ${BOOTDIR} %endfor # Create optional product.img and updates.img -<% imggraft=""; images=["product", "updates"] %> +<% filegraft=""; images=["product", "updates"] %> %for img in images: %if exists("%s/%s/" % (LORAXDIR, img)): installimg ${LORAXDIR}/${img}/ images/${img}.img treeinfo images-${basearch} ${img}.img images/${img}.img - <% imggraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %> + <% filegraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %> %endif %endfor @@ -106,9 +108,15 @@ install ${configdir}/mapping ${BOOTDIR} <% import os if os.path.exists(workdir + "/iso-graft"): - imggraft += " " + workdir + "/iso-graft" + filegraft += " " + workdir + "/iso-graft" %> +# Add the license files +%for f in glob("/usr/share/licenses/*-release/*"): + install ${f} ${f|basename} + <% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %> +%endfor + ## make boot.iso runcmd mkisofs -o ${outroot}/images/boot.iso -chrp-boot -U \ ${prepboot} -part -hfs -T -r -l -J \ @@ -120,7 +128,7 @@ runcmd mkisofs -o ${outroot}/images/boot.iso -chrp-boot -U \ ${BOOTDIR}=${outroot}/${BOOTDIR} \ ${GRUBDIR}=${outroot}/${GRUBDIR} \ ${NETBOOTDIR}=${outroot}/${NETBOOTDIR} \ - ${STAGE2IMG}=${outroot}/${STAGE2IMG} ${imggraft} + ${STAGE2IMG}=${outroot}/${STAGE2IMG} ${filegraft} %for kernel in kernels: diff --git a/share/templates.d/99-generic/ppc64le.tmpl b/share/templates.d/99-generic/ppc64le.tmpl index 937eb7ae..3772cb57 100644 --- a/share/templates.d/99-generic/ppc64le.tmpl +++ b/share/templates.d/99-generic/ppc64le.tmpl @@ -14,6 +14,8 @@ isolabel = ''.join(ch if ch.isalnum() else '_' for ch in isolabel) ## Anaconda finds the CDROM device automatically rootarg = "" + +from os.path import basename %> ## Test ${runtime_img} to see if udf is needed @@ -69,12 +71,12 @@ install ${configdir}/mapping ${BOOTDIR} mkdir images/ # Create optional product.img and updates.img -<% imggraft=""; images=["product", "updates"] %> +<% filegraft=""; images=["product", "updates"] %> %for img in images: %if exists("%s/%s/" % (LORAXDIR, img)): installimg ${LORAXDIR}/${img}/ images/${img}.img treeinfo images-${basearch} ${img}.img images/${img}.img - <% imggraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %> + <% filegraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %> %endif %endfor @@ -82,9 +84,15 @@ mkdir images/ <% import os if os.path.exists(workdir + "/iso-graft"): - imggraft += " " + workdir + "/iso-graft" + filegraft += " " + workdir + "/iso-graft" %> +# Add the license files +%for f in glob("/usr/share/licenses/*-release/*"): + install ${f} ${f|basename} + <% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %> +%endfor + ## make boot.iso runcmd mkisofs -v -U -J -R -T \ -o ${outroot}/images/boot.iso \ @@ -96,7 +104,7 @@ runcmd mkisofs -v -U -J -R -T \ -no-desktop -allow-multidot ${udfargs} -graft-points \ ${BOOTDIR}=${outroot}/${BOOTDIR} \ ${GRUBDIR}=${outroot}/${GRUBDIR} \ - ${STAGE2IMG}=${outroot}/${STAGE2IMG} ${imggraft} + ${STAGE2IMG}=${outroot}/${STAGE2IMG} ${filegraft} %for kernel in kernels: treeinfo images-${kernel.arch} boot.iso images/boot.iso diff --git a/share/templates.d/99-generic/s390.tmpl b/share/templates.d/99-generic/s390.tmpl index 5173994c..a9cebdf0 100644 --- a/share/templates.d/99-generic/s390.tmpl +++ b/share/templates.d/99-generic/s390.tmpl @@ -7,6 +7,8 @@ INITRD_ADDRESS="0x02000000" LORAXDIR="usr/share/lorax/" # The assumption seems to be that there is only one s390 kernel, ever kernel = kernels[0] + +from os.path import basename %> mkdir images @@ -36,12 +38,12 @@ treeinfo images-${basearch} genericdvd.prm ${BOOTDIR}/genericdvd.prm treeinfo images-${basearch} generic.ins generic.ins # Create optional product.img and updates.img -<% imggraft=""; images=["product", "updates"] %> +<% filegraft=""; images=["product", "updates"] %> %for img in images: %if exists("%s/%s/" % (LORAXDIR, img)): installimg ${LORAXDIR}/${img}/ images/${img}.img treeinfo images-${basearch} ${img}.img images/${img}.img - <% imggraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %> + <% filegraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %> %endif %endfor @@ -49,5 +51,11 @@ treeinfo images-${basearch} generic.ins generic.ins <% import os if os.path.exists(workdir + "/iso-graft"): - imggraft += " " + workdir + "/iso-graft" + filegraft += " " + workdir + "/iso-graft" %> + +# Add the license files +%for f in glob("/usr/share/licenses/*-release/*"): + install ${f} ${f|basename} + <% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %> +%endfor diff --git a/share/templates.d/99-generic/x86.tmpl b/share/templates.d/99-generic/x86.tmpl index 32ebda9b..63e47016 100644 --- a/share/templates.d/99-generic/x86.tmpl +++ b/share/templates.d/99-generic/x86.tmpl @@ -93,7 +93,7 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR} %endif # Create optional product.img and updates.img -<% imggraft=""; images=["product", "updates"]; compressargs=None; %> +<% filegraft=""; images=["product", "updates"]; compressargs=None; %> %if basearch == 'i386': # Limit the amount of memory xz uses on i386 <% compressargs="--xz -9 --memlimit-compress=3700MiB" %> @@ -102,7 +102,7 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR} %if exists("%s/%s/" % (LORAXDIR, img)): installimg ${compressargs} ${LORAXDIR}/${img}/ images/${img}.img treeinfo images-${basearch} ${img}.img images/${img}.img - <% imggraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %> + <% filegraft += " images/{0}.img={1}/images/{0}.img".format(img, outroot) %> %endif %endfor @@ -110,9 +110,15 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR} <% import os if os.path.exists(workdir + "/iso-graft"): - imggraft += " " + workdir + "/iso-graft" + filegraft += " " + workdir + "/iso-graft" %> +# Add the license files +%for f in glob("/usr/share/licenses/*-release/*"): + install ${f} ${f|basename} + <% filegraft += " {0}={1}/{0}".format(basename(f), outroot) %> +%endfor + ## make boot.iso runcmd mkisofs -o ${outroot}/images/boot.iso \ -b ${BOOTDIR}/isolinux.bin -c ${BOOTDIR}/boot.cat \ @@ -122,6 +128,6 @@ runcmd mkisofs -o ${outroot}/images/boot.iso \ ${STAGE2IMG}=${outroot}/${STAGE2IMG} \ ${BOOTDIR}=${outroot}/${BOOTDIR} \ ${KERNELDIR}=${outroot}/${KERNELDIR} \ - ${efigraft} ${imggraft} + ${efigraft} ${filegraft} runcmd isohybrid ${efihybrid} ${outroot}/images/boot.iso treeinfo images-${basearch} boot.iso images/boot.iso