diff options
author | William Pitcock <nenolod@dereferenced.org> | 2011-09-03 00:27:50 -0500 |
---|---|---|
committer | William Pitcock <nenolod@dereferenced.org> | 2011-09-03 00:27:50 -0500 |
commit | 2879013b96ec401b65200e652b5e81c0468d4489 (patch) | |
tree | d635984022507f89882f151a5c8c664883c30b30 /main/syslinux/update-extlinux | |
parent | 600b2cccb98253eb249d66cc55b574a9f1694c04 (diff) | |
download | aports-2879013b96ec401b65200e652b5e81c0468d4489.tar.bz2 aports-2879013b96ec401b65200e652b5e81c0468d4489.tar.xz |
main/syslinux: detect xen
Diffstat (limited to 'main/syslinux/update-extlinux')
-rwxr-xr-x | main/syslinux/update-extlinux | 24 |
1 files changed, 23 insertions, 1 deletions
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 |