Use a predictable ISO Volume Label (#732298)

New images find their root device by looking at the CDLABEL. Since pungi
is building ISO images separately from lorax, if it uses a different ISO
Volume Label we'll end up with unbootable images.

This changes the volume labels to match what pungi uses, so both should
boot OK.
This commit is contained in:
Will Woods 2011-10-12 20:08:31 -04:00
parent 9df3348a71
commit f640a2faab
5 changed files with 14 additions and 11 deletions

View File

@ -36,7 +36,7 @@ ${make_efiboot("images/efidisk.img", include_kernel=True, disk=True)}
replace @ROOT@ root=live:LABEL=ANACONDA ${eficonf} replace @ROOT@ root=live:LABEL=ANACONDA ${eficonf}
%else: %else:
## NOTE: this needs to match the boot.iso label (see x86.tmpl) ## NOTE: this needs to match the boot.iso label (see x86.tmpl)
replace @ROOT@ root=live:CDLABEL=${udev_escape(product.name)} ${eficonf} replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${eficonf}
%endif %endif
%if efiarch == 'IA32': %if efiarch == 'IA32':
copy ${eficonf} ${EFIBOOTDIR}/BOOT.conf copy ${eficonf} ${EFIBOOTDIR}/BOOT.conf

View File

@ -1,4 +1,4 @@
<%page args="kernels, runtime_img, basearch, libdir, inroot, outroot, product"/> <%page args="kernels, runtime_img, basearch, libdir, inroot, outroot, product, isolabel"/>
<% <%
configdir="tmp/config_files" configdir="tmp/config_files"
BOOTDIR="ppc" BOOTDIR="ppc"
@ -68,14 +68,14 @@ mkdir etc
install ${configdir}/yaboot.conf.3264 etc/yaboot.conf install ${configdir}/yaboot.conf.3264 etc/yaboot.conf
replace @PRODUCT@ ${product.name} etc/yaboot.conf replace @PRODUCT@ ${product.name} etc/yaboot.conf
replace @VERSION@ ${product.version} etc/yaboot.conf replace @VERSION@ ${product.version} etc/yaboot.conf
replace @ROOT@ root=live:CDLABEL=PBOOT etc/yaboot.conf replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' etc/yaboot.conf
%else: %else:
copy ${KERNELDIR}/yaboot.conf etc/yaboot.conf copy ${KERNELDIR}/yaboot.conf etc/yaboot.conf
%endif %endif
runcmd mkisofs -o ${outroot}/images/boot.iso -chrp-boot -U \ runcmd mkisofs -o ${outroot}/images/boot.iso -chrp-boot -U \
${prepboot} -part -hfs -T -r -l -J \ ${prepboot} -part -hfs -T -r -l -J \
-A "${product.name} ${product.version}" -sysid PPC -V PBOOT \ -A "${product.name} ${product.version}" -sysid PPC -V '${isolabel}' \
-volset "${product.version}" -volset-size 1 -volset-seqno 1 \ -volset "${product.version}" -volset-size 1 -volset-seqno 1 \
-hfs-volid ${product.version} -hfs-bless ${outroot}/${MACDIR} \ -hfs-volid ${product.version} -hfs-bless ${outroot}/${MACDIR} \
-map ${inroot}/${configdir}/mapping \ -map ${inroot}/${configdir}/mapping \

View File

@ -1,4 +1,4 @@
<%page args="kernels, runtime_img, basearch, outroot, product"/> <%page args="kernels, runtime_img, basearch, outroot, product, isolabel"/>
<% <%
configdir="tmp/config_files" configdir="tmp/config_files"
BOOTDIR="boot" BOOTDIR="boot"
@ -20,10 +20,10 @@ replace @PRODUCT@ ${product.name} ${BOOTDIR}/boot.msg
installinitrd images-${basearch} ${kernel.initrd.path} ${BOOTDIR}/initrd.img installinitrd images-${basearch} ${kernel.initrd.path} ${BOOTDIR}/initrd.img
%endfor %endfor
replace @ROOT@ root=live:CDLABEL=PBOOT ${BOOTDIR}/silo.conf replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${BOOTDIR}/silo.conf
runcmd mkisofs -R -J -T -G /${BOOTDIR}/isofs.b -B ... \ runcmd mkisofs -R -J -T -G /${BOOTDIR}/isofs.b -B ... \
-s /${BOOTDIR}/silo.conf -r -V "PBOOT" \ -s /${BOOTDIR}/silo.conf -r -V '${isolabel}' \
-A "${product.name} ${product.version}" \ -A "${product.name} ${product.version}" \
-x Fedora -x repodata \ -x Fedora -x repodata \
-sparc-label "${product.name} ${product.version} Boot Disc" \ -sparc-label "${product.name} ${product.version} Boot Disc" \

View File

@ -1,4 +1,4 @@
<%page args="kernels, runtime_img, basearch, outroot, product"/> <%page args="kernels, runtime_img, basearch, outroot, product, isolabel"/>
<% <%
configdir="tmp/config_files" configdir="tmp/config_files"
SYSLINUXDIR="usr/share/syslinux" SYSLINUXDIR="usr/share/syslinux"
@ -21,7 +21,7 @@ install ${configdir}/grub.conf ${BOOTDIR}
replace @VERSION@ ${product.version} ${BOOTDIR}/grub.conf ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg replace @VERSION@ ${product.version} ${BOOTDIR}/grub.conf ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg
replace @PRODUCT@ ${product.name} ${BOOTDIR}/grub.conf ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg replace @PRODUCT@ ${product.name} ${BOOTDIR}/grub.conf ${BOOTDIR}/isolinux.cfg ${BOOTDIR}/*.msg
replace @ROOT@ 'root=live:CDLABEL=${udev_escape(product.name)}' ${BOOTDIR}/isolinux.cfg replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${BOOTDIR}/isolinux.cfg
%if exists("boot/memtest*"): %if exists("boot/memtest*"):
install boot/memtest* ${BOOTDIR} install boot/memtest* ${BOOTDIR}
@ -64,7 +64,7 @@ hardlink ${KERNELDIR}/initrd.img ${BOOTDIR}
runcmd mkisofs -o ${outroot}/images/boot.iso \ runcmd mkisofs -o ${outroot}/images/boot.iso \
-b ${BOOTDIR}/isolinux.bin -c ${BOOTDIR}/boot.cat \ -b ${BOOTDIR}/isolinux.bin -c ${BOOTDIR}/boot.cat \
-boot-load-size 4 -boot-info-table -no-emul-boot \ -boot-load-size 4 -boot-info-table -no-emul-boot \
${efiargs} -R -J -V '${product.name}' -T -graft-points \ ${efiargs} -R -J -V '${isolabel}' -T -graft-points \
${BOOTDIR}=${outroot}/${BOOTDIR} \ ${BOOTDIR}=${outroot}/${BOOTDIR} \
${KERNELDIR}=${outroot}/${KERNELDIR} \ ${KERNELDIR}=${outroot}/${KERNELDIR} \
${LIVEDIR}=${outroot}/${LIVEDIR} \ ${LIVEDIR}=${outroot}/${LIVEDIR} \

View File

@ -142,12 +142,15 @@ class TreeBuilder(object):
'''Builds the arch-specific boot images. '''Builds the arch-specific boot images.
inroot should be the installtree root (the newly-built runtime dir)''' inroot should be the installtree root (the newly-built runtime dir)'''
def __init__(self, product, arch, inroot, outroot, runtime, templatedir=None): def __init__(self, product, arch, inroot, outroot, runtime, templatedir=None):
# NOTE: if you change isolabel, you need to change pungi to match, or
# the pungi images won't boot.
isolabel = "{0.name} {0.version} {1.basearch}".format(product, arch)
# NOTE: if you pass an arg named "runtime" to a mako template it'll # NOTE: if you pass an arg named "runtime" to a mako template it'll
# clobber some mako internal variables - hence "runtime_img". # clobber some mako internal variables - hence "runtime_img".
self.vars = DataHolder(arch=arch, product=product, runtime_img=runtime, self.vars = DataHolder(arch=arch, product=product, runtime_img=runtime,
inroot=inroot, outroot=outroot, inroot=inroot, outroot=outroot,
basearch=arch.basearch, libdir=arch.libdir, basearch=arch.basearch, libdir=arch.libdir,
udev_escape=udev_escape) isolabel=isolabel, udev=udev_escape)
self._runner = LoraxTemplateRunner(inroot, outroot, templatedir=templatedir) self._runner = LoraxTemplateRunner(inroot, outroot, templatedir=templatedir)
self._runner.defaults = self.vars self._runner.defaults = self.vars