diff options
author | Mario Preksavec <mario@slackware.hr> | 2016-07-29 00:37:50 +0200 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2016-07-30 08:28:21 +0700 |
commit | 368a721cfdc418228722fc6d7f5d9e7c6f908865 (patch) | |
tree | dbbb84ea9b4f813d5ea614233042589e1dcdb9be /system/xen/dom0 | |
parent | df27e59d4aeec89f8cca4677b3004690d2bd105f (diff) |
system/xen: Additional features, patches and script fixes.
Signed-off-by: Mario Preksavec <mario@slackware.hr>
Diffstat (limited to 'system/xen/dom0')
-rw-r--r-- | system/xen/dom0/README.dom0 | 34 | ||||
-rw-r--r-- | system/xen/dom0/kernel-xen.sh | 39 |
2 files changed, 49 insertions, 24 deletions
diff --git a/system/xen/dom0/README.dom0 b/system/xen/dom0/README.dom0 index 4a3b8b21ad0ce..c3c24cc2dc26d 100644 --- a/system/xen/dom0/README.dom0 +++ b/system/xen/dom0/README.dom0 @@ -10,7 +10,7 @@ Originally, booting Xen kernel with LILO bootloader is not supported, and GRUB has to be used. With mbootpack this has changed, and LILO can be used as well. Basically, mbootpack takes Linux kernel, initrd and Xen VMM, and packages them up into a file that looks like a bzImage Linux kernel. This script will select -LILO by default, changing to GRUB is easy, use: +LILO by default, changing to GRUB is easy: BOOTLOADER=grub ./kernel-xen.sh @@ -19,7 +19,7 @@ Slackware generic kernel requires initrd image, this script assumes root is on ROOTMOD=ext3 ROOTFS=ext3 ROOTDEV=/dev/sda5 ./kernel-xen.sh -When using LILO bootloader, this is what the most of lilo.conf should have: +When using LILO bootloader, this is what the lilo.conf should have: image = /boot/vmlinuz-xen root = /dev/sda2 @@ -38,6 +38,36 @@ When using GRUB, /boot/grub/menu.lst should have these: module /boot/vmlinuz-xen root=/dev/sda2 ro console=tty0 nomodeset module /boot/initrd-xen.gz +Booting Xen on a native EFI system is also an option, but the only clean +solution at this time requires a modified binutils package. More experienced +user can add "x86_64-pep" to the list of enabled targets and build/replace +binutils on their system. Subsequently, building Xen will now also create a +Xen EFI binary. + +To make things a bit easier, a copy of Xen EFI binary can be found here: + + http://slackware.hr/~mario/xen/xen.efi.gz + +If an automatic boot to Xen kernel is desired, the binary should be renamed and +copied to the following location: /boot/efi/EFI/BOOT/bootx64.efi +Downloaded binary should be unpacked first, and the config file should be +present in the same directory (same file name, minus the suffix). +For example: "xen.cfg" or "bootx64.cfg", and its contents: + + [global] + default=xen + + [xen] + options=dom0_mem=min:512M,max:512M,512M + kernel=vmlinuz-xen root=/dev/sda2 ro console=tty0 nomodeset + ramdisk=initrd-xen.gz + +There are some other EFI bootloaders, for example ELILO comes with the support +for VMM images, but their x86 support is lacking. GRUB2 apparently supports +only the chainloader method; however, the stock Slackware version is too old +for this task. rEFInd should work, but the Xen EFI method was satisfactory to +the author :-) + Troubleshooting dom0 crashes, freezes, blank screen and such: * Use /proc/fb to find an out of range device id, for example this can be diff --git a/system/xen/dom0/kernel-xen.sh b/system/xen/dom0/kernel-xen.sh index 9eb7a57a6db39..15e7439f33d69 100644 --- a/system/xen/dom0/kernel-xen.sh +++ b/system/xen/dom0/kernel-xen.sh @@ -27,6 +27,12 @@ if [ "$BOOTLOADER" = lilo ] && [ ! -x /usr/bin/mbootpack ]; then exit fi +if [ ! -d /usr/src/linux-$KERNEL ]; then + echo "Missing kernel source in /usr/src/linux-$KERNEL" + echo "Get it from kernel.org and rerun this script." + exit +fi + CWD=$(pwd) TMP=${TMP:-/tmp/xen} @@ -35,12 +41,6 @@ set -e rm -rf $TMP mkdir -p $TMP -if [ ! -d /usr/src/linux-$KERNEL ]; then - echo "Missing kernel source in /usr/src/linux-$KERNEL" - echo "Get it from kernel.org and rerun this script." - exit -fi - # Prepare kernel source cd /usr/src cp -a linux-$KERNEL linux-$KERNEL-xen @@ -68,32 +68,27 @@ if [ "$MENUCONFIG" = yes ]; then done fi -make vmlinux modules +make bzImage modules make modules_install INSTALL_MOD_PATH=$TMP # Install modules cp -a $TMP/lib/modules/$KERNEL-xen /lib/modules -# Strip kernel symbols -strip vmlinux -o vmlinux-stripped - # Create initrd -mkinitrd -c -k $KERNEL-xen -m $ROOTMOD -f $ROOTFS -r $ROOTDEV -o /boot/initrd-$KERNEL-xen.gz +mkinitrd -c -k $KERNEL-xen -m $ROOTMOD -f $ROOTFS -r $ROOTDEV \ + -o /boot/initrd-$KERNEL-xen.gz -# For lilo we pack kernel up with mbootpack +# For lilo we use mbootpack if [ "$BOOTLOADER" = lilo ]; then gzip -d -c /boot/xen-$XEN.gz > xen-$XEN - gzip -d -c /boot/initrd-$KERNEL-xen.gz > initrd-$KERNEL-xen - mbootpack -o vmlinux-stripped-mboot -m vmlinux-stripped -m initrd-$KERNEL-xen xen-$XEN -# For lilo we need to keep kernel unpacked - cp -a vmlinux-stripped-mboot vmlinuz -elif [ "$BOOTLOADER" = grub ]; then - gzip vmlinux-stripped -c > vmlinuz + mbootpack -m arch/x86/boot/bzImage -m /boot/initrd-$KERNEL-xen.gz xen-$XEN \ + -o /boot/vmlinuz-$KERNEL-xen +else + cp arch/x86/boot/bzImage /boot/vmlinuz-$KERNEL-xen fi -install -D -m 644 vmlinuz /boot/vmlinuz-$KERNEL-xen -install -m 644 System.map /boot/System.map-$KERNEL-xen -install -m 644 .config /boot/config-$KERNEL-xen +cp System.map /boot/System.map-$KERNEL-xen +cp .config /boot/config-$KERNEL-xen cd /boot ln -s vmlinuz-$KERNEL-xen vmlinuz-xen @@ -104,4 +99,4 @@ ln -s initrd-$KERNEL-xen.gz initrd-xen.gz # Clean up kernel sources cd /usr/src/linux-$KERNEL-xen make clean -rm initrd-$KERNEL-xen vmlinux-stripped* vmlinuz xen-$XEN +rm xen-$XEN |