Changes of Revision 14
[-] [+] | Changed | grub2.spec |
[-] [+] | Added | 09_xen ^ |
@@ -0,0 +1,31 @@ +#!/bin/bash +set -e + +kernels=`ls /boot/vmlinuz-*xen*|sed s/".*vmlinuz-"//` 2>/dev/null +initrds=`ls /boot/initrd-*xen*|sed s/".*initrd-"//` 2>/dev/null +xenimgs=`ls /boot/xen.gz*` 2>/dev/null + +MODULE="}" + +for i in $xenimgs; do + for j in $kernels; do + echo "Found xen kernel and image: $j -> $i" >&2 + echo "$initrds" | grep $j > /dev/null 2>&1 + if [ $? -eq 0 ]; then + MODULE="module ${GRUB_DRIVE_BOOT}/initrd-$j.img +}" + else + MODULE="}" + fi + x=`echo $i|sed -e s/xen$//g` +cat << EOF +menuentry "Xen ${i} kernel $j" { + multiboot ${GRUB_DRIVE_BOOT}/xen.gz-$x dom0_mem=256M + module ${GRUB_DRIVE_BOOT}/vmlinuz-$j root=/dev/sda2 ro console=tty0 + ${MODULE} +EOF + +echo "" + +done +done |