ppc.tmpl: clarify comments, fix yaboot.conf for Apple systems

So there's actually two copies of yaboot on a PPC image, and they each
use different config files:

  ppc/chrp/yaboot --> /etc/yaboot.conf
  ppc/mac/yaboot  --> /ppc/ppc{32,64}/yaboot.conf

So we need two copies of yaboot.conf - one in each place - to
boot properly (or all three if we're making hybrid images). Whee!

The comments should now make this more clear for future reference.
This commit is contained in:
Will Woods 2011-11-16 14:49:35 -05:00
parent e587f893d8
commit 86937d2c0a

View File

@ -11,21 +11,27 @@ WRAPPER_DATA="usr/"+libdir+"/kernel-wrapper"
bitsizes = set()
prepboot = ""
rootarg = "root=live:CDLABEL=%s" % udev(isolabel)
%>
mkdir ${LIVEDIR}
install ${runtime_img} ${LIVEDIR}/squashfs.img
## install bootloaders
## install bootloaders.
## NOTE: there's two different bootloader setups here:
## ppc/chrp: for normal PPC systems. needs 'addnote' run on yaboot.
## uses /etc/yaboot.conf, as is the default.
## ppc/mac: for PowerMacs. no 'addnote' (it breaks some Macs!)
## ofboot.b picks one of /ppc/ppc{32,64}/yaboot.conf for yaboot,
## thus automatically booting the correct kernel for the machine.
mkdir ${BOOTDIR}
## basic ppc stuff
## boot stuff for normal (CHRP/PREP) PPC systems
install ${configdir}/bootinfo.txt ${BOOTDIR}
install boot/efika.forth ${BOOTDIR}
## boot dir for CHRP systems
mkdir ${BOOTDIR}/chrp
install usr/lib/yaboot/yaboot ${BOOTDIR}/chrp
runcmd ${inroot}/usr/lib/yaboot/addnote ${outroot}/${BOOTDIR}/chrp/yaboot
## boot dir for PowerMacs
## special boot dir for PowerMacs
mkdir ${MACDIR}
install usr/lib/yaboot/yaboot ${MACDIR}
install ${configdir}/ofboot.b ${MACDIR}
@ -47,9 +53,12 @@ install ${configdir}/ofboot.b ${MACDIR}
installkernel images-${kernel.arch} ${kernel.path} ${KERNELDIR}/vmlinuz
installinitrd images-${kernel.arch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
## install bootloader config
install ${configdir}/yaboot.conf.in ${KERNELDIR}/yaboot.conf
## install arch-specific bootloader config
install ${configdir}/yaboot.conf.in ${KERNELDIR}/yaboot.conf
replace @BITS@ ${bits} ${KERNELDIR}/yaboot.conf
replace @PRODUCT@ ${product.name} ${KERNELDIR}/yaboot.conf
replace @VERSION@ ${product.version} ${KERNELDIR}/yaboot.conf
replace @ROOT@ "${rootarg}" ${KERNELDIR}/yaboot.conf
## kernel-wrapper magic that makes the netboot combined ppc{32,64}.img
runcmd ${inroot}/${WRAPPER} -p of \
@ -65,21 +74,19 @@ install ${configdir}/ofboot.b ${MACDIR}
%endif
%endfor
## copy correct yaboot.conf into /etc
## choose correct yaboot.conf
mkdir etc
%if len(bitsizes) == 2:
## hybrid - use the magic hybrid config
install ${configdir}/yaboot.conf.3264 etc/yaboot.conf
## both kernels means hybrid - use the magic hybrid config
install ${configdir}/yaboot.conf.3264 etc/yaboot.conf
replace @PRODUCT@ ${product.name} etc/yaboot.conf
replace @VERSION@ ${product.version} etc/yaboot.conf
replace @ROOT@ "${rootarg}" etc/yaboot.conf
%else:
## single arch - use the yaboot.conf we created above
## single arch - use the arch-specific yaboot.conf from above
copy ${KERNELDIR}/yaboot.conf etc/yaboot.conf
%endif
## configure bootloader
replace @PRODUCT@ ${product.name} etc/yaboot.conf
replace @VERSION@ ${product.version} etc/yaboot.conf
replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' etc/yaboot.conf
## make boot.iso
runcmd mkisofs -o ${outroot}/images/boot.iso -chrp-boot -U \
${prepboot} -part -hfs -T -r -l -J \
@ -93,9 +100,6 @@ runcmd mkisofs -o ${outroot}/images/boot.iso -chrp-boot -U \
${NETBOOTDIR}=${outroot}/${NETBOOTDIR} \
${LIVEDIR}=${outroot}/${LIVEDIR}
%if len(bitsizes) == 2:
treeinfo images-ppc boot.iso images/boot.iso
treeinfo images-ppc64 boot.iso images/boot.iso
%else:
%for kernel in kernels:
treeinfo images-${kernel.arch} boot.iso images/boot.iso
%endif
%endfor