On Tue, Jan 09, 2018 at 05:58:46PM +0000, Wei Liu wrote:
> 
> Ian has been busy writing the sidecar script and Roger and I have been
> working on cleaning up the branch.  We want to post a new version as
> soon as possible (tomorrow or even tonight).

Ian,

Let me know if you need any help with the sidecar script. Generally
it's straightforward enough to build so I'm sure you won't have any
trouble. Here's one that I used for local testing on my laptop in a
CentOS-ish chroot (we have other bits responsible for this in
EC2). Please excuse the cruft, including the use of legacy GRUB.

---------------------- 8< -------------------
#!/bin/bash
if [ $# -lt 2 ]; then
    echo "usage: $0 xen.gz kernel.gz [initrd.img]"
    exit 1
fi

if [ $# -eq 3 ]; then
    INITRD=$2
fi

if [ ! -f /usr/share/grub/x86_64-redhat/stage2_eltorito ]; then
    echo "/usr/share/grub/x86_64-redhat/stage2_eltorito not found."
    echo "Install grub RPM?"
    exit 1
fi

if [ ! -f $1 ]; then
    echo "$1 is not a file"
    exit 1
fi

if [ ! -f $2 ]; then
    echo "$2 is not a file"
    exit 1
fi

TMPDIR=$(mktemp -d)
cat >> $TMPDIR/menu.lst <<EOF
serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
terminal serial
timeout=0
default=0
hiddenmenu
title Vixen
root (cd)
kernel /boot/xen.gz loglvl=all guest_loglvl=all com1=115200,8n1 
console=com1,qemu console_timestamps=datems conswitch=b
module /boot/kernel.gz root=/dev/sda1 ro console=hvc0 4
EOF
if [ x"$INITRD" != x ]; then
    echo "module /boot/initrd.img" >> $TMPDIR/menu.lst
    INITRD_GRAFT=boot/initrd.img=$INITRD
fi
cp $TMPDIR/menu.lst $TMPDIR/grub.conf
cp /usr/share/grub/x86_64-redhat/stage2_eltorito $TMPDIR/

mkisofs -output vixen.iso \
    -input-charset utf-8 \
    -joliet -rational-rock \
    -translation-table \
    -eltorito-boot boot/grub/stage2_eltorito \
    -no-emul-boot \
    -boot-load-size 4 \
    -boot-info-table \
    -graft-points \
        boot/grub/stage2_eltorito=$TMPDIR/stage2_eltorito \
        boot/xen.gz=$1 \
        boot/kernel.gz=$2 \
        $INITRD_GRAFT \
        boot/grub/menu.lst=$TMPDIR/menu.lst \
        boot/grub/grub.conf=$TMPDIR/grub.conf

rm -rf $TMPDIR
---------------------- 8< -------------------

Everything but ancient xend based Xen can sideload while avoiding a PV
domU block device by passing in device_model_args like this:

...
boot="d"
device_model_args=[ '-drive', 'file=/path/to/vixen.iso,media=cdrom,format=raw' ]
...

For xend versions we craft a qemu-dm wrapper script and change
device_model to use it.

--msw

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to