livemedia-creator: Update ppc64 live to use grub2

Update the templates and configuration files to support grub2 live
image creation.

Related: rhbz#1102318
Related: rhbz#1131199
(cherry picked from commit da8326fd58)
This commit is contained in:
Brian C. Lane 2014-08-27 16:27:52 -07:00
parent c8afae35b4
commit ca058678d4
3 changed files with 53 additions and 37 deletions

View File

@ -1,6 +1,7 @@
<chrp-boot> <description>Linux</description> <chrp-boot>
<os-name>Linux</os-name> <description>grub 2.00</description>
<boot-script>boot &device;:\ppc\chrp\yaboot</boot-script> <os-name>grub 2.00</os-name>
<boot-script>boot &device;:\boot\grub\powerpc-ieee1275\core.elf</boot-script>
<icon size=64,64 color-space=3,3,2> <icon size=64,64 color-space=3,3,2>
<bitmap> FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF <bitmap> FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF

View File

@ -0,0 +1,34 @@
set default=0
set timeout=5
echo -e "\nWelcome to the @PRODUCT@ @VERSION@ installer!\n\n"
for BITS in 32 64; do
if [ -d "/ppc/ppc${BITS}" ]; then
menuentry "Start @PRODUCT@ @VERSION@ (${BITS}-bit kernel)" $BITS --class fedora --class gnu-linux --class gnu --class os {
linux /ppc/ppc${2}/vmlinuz @ROOT@ ro rd.live.image quiet
initrd /ppc/ppc${2}/initrd.img
}
menuentry "Test this media & start @PRODUCT@ @VERSION@ (${BITS}-bit kernel)" $BITS --class fedora --class gnu-linux --class gnu --class os {
linux /ppc/ppc${2}/vmlinuz @ROOT@ rd.live.image rd.live.check ro quiet
initrd /ppc/ppc${2}/initrd.img
}
menuentry "Rescue a @PRODUCT@ system (${BITS}-bit kernel)" $BITS --class fedora --class gnu-linux --class gnu --class os {
linux /ppc/ppc${2}/vmlinuz @ROOT@ rd.live.image rescue ro
initrd /ppc/ppc${2}/initrd.img
}
fi
done
submenu 'Other options...' {
menuentry 'Reboot' {
reboot
}
menuentry 'Exit to Open Firmware' {
exit
}
}

View File

@ -2,6 +2,7 @@
<% <%
configdir="tmp/config_files/ppc" configdir="tmp/config_files/ppc"
BOOTDIR="ppc" BOOTDIR="ppc"
GRUBDIR="boot/grub"
LIVEDIR="LiveOS" LIVEDIR="LiveOS"
MACDIR=BOOTDIR+"/mac" MACDIR=BOOTDIR+"/mac"
NETBOOTDIR="images/netboot" NETBOOTDIR="images/netboot"
@ -9,7 +10,6 @@ NETBOOTDIR="images/netboot"
WRAPPER="usr/sbin/wrapper" WRAPPER="usr/sbin/wrapper"
WRAPPER_DATA="usr/"+libdir+"/kernel-wrapper" WRAPPER_DATA="usr/"+libdir+"/kernel-wrapper"
bitsizes = set()
prepboot = "" prepboot = ""
## NOTE: yaboot freaks out and stops parsing its config if it sees a '\', ## NOTE: yaboot freaks out and stops parsing its config if it sees a '\',
@ -17,8 +17,6 @@ prepboot = ""
## Instead we'll just replace any non-ASCII characters in the isolabel ## Instead we'll just replace any non-ASCII characters in the isolabel
## with '_', which means we won't need any udev escapes. ## with '_', which means we won't need any udev escapes.
isolabel = ''.join(ch if ch.isalnum() else '_' for ch in isolabel) isolabel = ''.join(ch if ch.isalnum() else '_' for ch in isolabel)
rootarg = "root=live:CDLABEL=%s" % isolabel
%> %>
mkdir ${LIVEDIR} mkdir ${LIVEDIR}
@ -35,14 +33,18 @@ treeinfo stage2 mainimage ${LIVEDIR}/squashfs.img
mkdir ${BOOTDIR} mkdir ${BOOTDIR}
## boot stuff for normal (CHRP/PREP) PPC systems ## boot stuff for normal (CHRP/PREP) PPC systems
install ${configdir}/bootinfo.txt ${BOOTDIR} install ${configdir}/bootinfo.txt ${BOOTDIR}
install boot/efika.forth ${BOOTDIR}
mkdir ${BOOTDIR}/chrp mkdir ${GRUBDIR}/powerpc-ieee1275
install usr/lib/yaboot/yaboot ${BOOTDIR}/chrp runcmd grub2-mkimage -O powerpc-ieee1275 -d /usr/lib/grub/powerpc-ieee1275 -p '()/boot/grub' \
runcmd ${inroot}/usr/lib/yaboot/addnote ${outroot}/${BOOTDIR}/chrp/yaboot -o ${outroot}/${GRUBDIR}/powerpc-ieee1275/core.elf iso9660 ext2 ofnet net tftp http
## special boot dir for PowerMacs install /usr/lib/grub/powerpc-ieee1275/*.mod ${GRUBDIR}/powerpc-ieee1275
mkdir ${MACDIR} install /usr/lib/grub/powerpc-ieee1275/*.lst ${GRUBDIR}/powerpc-ieee1275
install usr/lib/yaboot/yaboot ${MACDIR}
install ${configdir}/ofboot.b ${MACDIR}
install ${configdir}/grub.cfg.in ${GRUBDIR}/grub.cfg
replace @PRODUCT@ '${product.name}' ${GRUBDIR}/grub.cfg
replace @VERSION@ ${product.version} ${GRUBDIR}/grub.cfg
replace @ROOT@ 'root=live:CDLABEL=${isolabel|udev}' ${GRUBDIR}/grub.cfg
## copy mapping and magic files needed for isos ## copy mapping and magic files needed for isos
install ${configdir}/mapping ${BOOTDIR} install ${configdir}/mapping ${BOOTDIR}
@ -58,20 +60,12 @@ install ${configdir}/magic ${BOOTDIR}
## separate dirs/images for each arch ## separate dirs/images for each arch
KERNELDIR=BOOTDIR+"/ppc%s" % bits KERNELDIR=BOOTDIR+"/ppc%s" % bits
NETIMG=NETBOOTDIR+"/ppc%s.img" % bits NETIMG=NETBOOTDIR+"/ppc%s.img" % bits
bitsizes.add(bits)
%> %>
## install kernel ## install kernel
mkdir ${KERNELDIR} ${NETBOOTDIR} mkdir ${KERNELDIR} ${NETBOOTDIR}
installkernel images-${kernel.arch} ${kernel.path} ${KERNELDIR}/vmlinuz installkernel images-${kernel.arch} ${kernel.path} ${KERNELDIR}/vmlinuz
installinitrd images-${kernel.arch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img installinitrd images-${kernel.arch} ${kernel.initrd.path} ${KERNELDIR}/initrd.img
## 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 ## kernel-wrapper magic that makes the netboot combined ppc{32,64}.img
runcmd ${inroot}/${WRAPPER} -p of \ runcmd ${inroot}/${WRAPPER} -p of \
-D ${inroot}/${WRAPPER_DATA} \ -D ${inroot}/${WRAPPER_DATA} \
@ -86,19 +80,6 @@ install ${configdir}/magic ${BOOTDIR}
%endif %endif
%endfor %endfor
## choose correct yaboot.conf
mkdir etc
%if len(bitsizes) == 2:
## 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 arch-specific yaboot.conf from above
copy ${KERNELDIR}/yaboot.conf etc/yaboot.conf
%endif
## make boot.iso ## make boot.iso
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 \
@ -107,8 +88,8 @@ runcmd mkisofs -o ${outroot}/images/boot.iso -chrp-boot -U \
-hfs-volid ${product.version} -hfs-bless ${outroot}/${MACDIR} \ -hfs-volid ${product.version} -hfs-bless ${outroot}/${MACDIR} \
-map ${inroot}/${configdir}/mapping \ -map ${inroot}/${configdir}/mapping \
-no-desktop -allow-multidot -graft-points \ -no-desktop -allow-multidot -graft-points \
etc=${outroot}/etc \
${BOOTDIR}=${outroot}/${BOOTDIR} \ ${BOOTDIR}=${outroot}/${BOOTDIR} \
${GRUBDIR}=${outroot}/${GRUBDIR} \
${NETBOOTDIR}=${outroot}/${NETBOOTDIR} \ ${NETBOOTDIR}=${outroot}/${NETBOOTDIR} \
${LIVEDIR}=${outroot}/${LIVEDIR} ${LIVEDIR}=${outroot}/${LIVEDIR}