From 2879013b96ec401b65200e652b5e81c0468d4489 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Sat, 3 Sep 2011 00:27:50 -0500 Subject: main/syslinux: detect xen --- main/syslinux/update-extlinux | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'main/syslinux/update-extlinux') diff --git a/main/syslinux/update-extlinux b/main/syslinux/update-extlinux index a2488cc8df..1ba98658e3 100755 --- a/main/syslinux/update-extlinux +++ b/main/syslinux/update-extlinux @@ -89,6 +89,28 @@ echo "MENU AUTOBOOT Alpine will be booted automatically in # seconds." >> $conf. echo "TIMEOUT $rtimeout" >> $conf.new lst=0 +if [ -f "/boot/xen.gz" ]; then + for kernel in $(find /boot -name vmlinuz-* -type f); do + tag=$(basename $kernel | cut -b9-) + everbose "Found Xen hypervisor: /boot/xen.gz, kernel: $kernel" + + if [ -f "/boot/initramfs-$tag" ]; then + everbose "Found initramfs: /boot/initramfs-$tag" + initramfs="initrd=initramfs-$tag" + fi + + echo "LABEL $lst" >> $conf.new + if [ "$lst" = "$default" ]; then + echo " MENU DEFAULT" >> $conf.new + fi + echo " MENU LABEL Xen + Linux $tag" >> $conf.new + echo " KERNEL mboot.c32" >> $conf.new + echo " APPEND xen.gz $xen_opts --- $(basename $kernel) root=$root modules=${modules}${TYPE:+,$TYPE} $default_kernel_opts --- $initramfs" >> $conf.new + echo "" >> $conf.new + lst=$(($lst + 1)) + done +fi + for kernel in $(find /boot -name vmlinuz-* -type f); do tag=$(basename $kernel | cut -b9-) everbose "Found kernel: $kernel" @@ -122,7 +144,7 @@ everbose "$lst entries found." for entry in /etc/update-extlinux.d/*; do [ -f "$entry" ] && cat $entry >> $conf.new -done +done if [ "$overwrite" = "1" ]; then # keep a backup just in case -- cgit v1.2.3