diff options
Diffstat (limited to 'kernels')
-rw-r--r-- | kernels/xe-guest-utilities/PKGBUILD | 22 | ||||
-rw-r--r-- | kernels/xen-docs/PKGBUILD | 20 | ||||
-rwxr-xr-x | kernels/xen/09_xen | 140 | ||||
-rw-r--r-- | kernels/xen/PKGBUILD | 214 | ||||
-rw-r--r-- | kernels/xen/archinit.patch | 450 | ||||
-rw-r--r-- | kernels/xen/proc-xen.mount | 9 | ||||
-rw-r--r-- | kernels/xen/texi2html.patch | 10 | ||||
-rw-r--r-- | kernels/xen/var-lib-xenstored.mount | 10 | ||||
-rw-r--r-- | kernels/xen/xen.conf | 19 | ||||
-rw-r--r-- | kernels/xen/xen.install | 38 | ||||
-rw-r--r-- | kernels/xen/xenconsoled.service | 18 | ||||
-rw-r--r-- | kernels/xen/xendomU@.service | 12 | ||||
-rw-r--r-- | kernels/xen/xendomains.service | 15 | ||||
-rw-r--r-- | kernels/xen/xenstored.service | 18 |
14 files changed, 815 insertions, 180 deletions
diff --git a/kernels/xe-guest-utilities/PKGBUILD b/kernels/xe-guest-utilities/PKGBUILD index b866a6f58..a982f40d2 100644 --- a/kernels/xe-guest-utilities/PKGBUILD +++ b/kernels/xe-guest-utilities/PKGBUILD @@ -2,27 +2,27 @@ # Contributor (Parabola): André Silva <andre.paulista@adinet.com.uy> pkgname=xe-guest-utilities -pkgver=6.0.0 -pkgrel=5 +pkgver=6.0.2 +pkgrel=1 pkgdesc="Citrix XenServer Tools" arch=('i686' 'x86_64') url="http://citrix.com/English/ps2/products/product.asp?contentID=683148&ntref=hp_nav_US" license=('GPL' 'LGPL') optdepends=('linux-libre: DomU kernel for x86_64' 'linux-libre-xen: DomU kernel for i686' - 'kernel-libre-lts: DomU kernel for i686 (long time supported)') + 'linux-libre-lts-xen: DomU kernel for i686 (long time supported)') makedepends=('rpmextract') -source=(ftp://ftp.prz.edu.pl/pub/archlinux/archrak/src/xe-guest-utilities-${pkgver}-743.i386.rpm - ftp://ftp.prz.edu.pl/pub/archlinux/archrak/src/xe-guest-utilities-xenstore-${pkgver}-743.i386.rpm - ftp://ftp.prz.edu.pl/pub/archlinux/archrak/src/xe-guest-utilities-${pkgver}-743.x86_64.rpm - ftp://ftp.prz.edu.pl/pub/archlinux/archrak/src/xe-guest-utilities-xenstore-${pkgver}-743.x86_64.rpm +source=(ftp://ftp.prz.edu.pl/pub/archlinux/aur/src/xe-guest-utilities-${pkgver}-756.i386.rpm + ftp://ftp.prz.edu.pl/pub/archlinux/aur/src/xe-guest-utilities-xenstore-${pkgver}-756.i386.rpm + ftp://ftp.prz.edu.pl/pub/archlinux/aur/src/xe-guest-utilities-${pkgver}-756.x86_64.rpm + ftp://ftp.prz.edu.pl/pub/archlinux/aur/src/xe-guest-utilities-xenstore-${pkgver}-756.x86_64.rpm xe-guest-utilities-parabola.patch ip_address.patch) -md5sums=('894d33028b2712650be324b7ba01c6c4' - 'e100f97421ff522cb228aa749881a082' - 'ffaf02afa2105d32e011a32c80921256' - '9b9570b5cc27832df303c8ef9cd11d36' +md5sums=('7f1b670b6fec6f55764bc19ead41b07d' + '7d9a2c9db65d76f93a5df709989915af' + '953e858c03570105ea855fc3b32d43ff' + '5cb44deb684f7069b05052ed92d0ac22' '0d8a8ebe124d585a2b101150df8f5ff7' '86b4a69b412f874bf5b4db8ac8858644') diff --git a/kernels/xen-docs/PKGBUILD b/kernels/xen-docs/PKGBUILD new file mode 100644 index 000000000..6d4782bbd --- /dev/null +++ b/kernels/xen-docs/PKGBUILD @@ -0,0 +1,20 @@ +pkgname=xen-docs +pkgver=4.2.0 +pkgrel=2 +pkgdesc="Xen 4 (docs)" +arch=(i686 x86_64) +url="http://xen.org/" +license="GPL" +depends=('markdown') +conflicts=('xen4' 'xen3' 'xen-hv-tools' 'libxen4') + + +source=(http://bits.xensource.com/oss-xen/release/${pkgver}/xen-${pkgver}.tar.gz) + +build() { + cd $srcdir/xen-${pkgver} + unset CFLAGS LDFLAGS + make PYTHON=python2 DESTDIR=$pkgdir install-docs + } + +md5sums=('f4f217969afc38f09251039966d91a87') diff --git a/kernels/xen/09_xen b/kernels/xen/09_xen index 094b7f427..42309149c 100755 --- a/kernels/xen/09_xen +++ b/kernels/xen/09_xen @@ -1,69 +1,69 @@ #! /bin/sh -e -if [ -f /usr/lib/grub/grub-mkconfig_lib ]; then - . /usr/lib/grub/grub-mkconfig_lib +if [ -f /usr/share/grub/grub-mkconfig_lib ]; then + . /usr/share/grub/grub-mkconfig_lib else # no grub file, so we notify and exit gracefully - echo "Cannot find grub config file, exiting." >&2 - exit 0 + echo "Cannot find grub config file, exiting." >&2 + exit 0 fi -XEN_HYPERVISOR_CMDLINE= +XEN_HYPERVISOR_CMDLINE="xsave=1" XEN_LINUX_CMDLINE="console=tty0" [ -r /etc/xen/grub.conf ] && . /etc/xen/grub.conf CLASS="--class gnu-linux --class gnu --class os" if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then - OS=GNU/Linux + OS=GNU/Linux else - OS="${GRUB_DISTRIBUTOR}" - CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr '[A-Z]' '[a-z]' | cut -d' ' -f1) ${CLASS}" + OS="${GRUB_DISTRIBUTOR}" + CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr '[A-Z]' '[a-z]' | cut -d' ' -f1) ${CLASS}" fi # loop-AES arranges things so that /dev/loop/X can be our root device, but # the initrds that Linux uses don't like that. case ${GRUB_DEVICE} in - /dev/loop/*|/dev/loop[0-9]) - GRUB_DEVICE=`losetup ${GRUB_DEVICE} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"` - ;; + /dev/loop/*|/dev/loop[0-9]) + GRUB_DEVICE=`losetup ${GRUB_DEVICE} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"` + ;; esac if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \ || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \ || [ "`grub-probe -t abstraction --device ${GRUB_DEVICE} | sed -e 's,.*\(lvm\).*,\1,'`" = "lvm" ] ; then - LINUX_ROOT_DEVICE=${GRUB_DEVICE} + LINUX_ROOT_DEVICE=${GRUB_DEVICE} else - LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID} + LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID} fi xen_entry () { - os="$1" - xen_version="$2" - version="$3" - xen_args="$4" - args="$5" - printf "menuentry 'Xen %s / %s, with Linux %s' --class xen ${CLASS} {\n" "${xen_version}" "${os}" "${version}" - save_default_entry | sed -e "s/^/\t/" - - if [ -z "${prepare_boot_cache}" ]; then - prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")" - fi - printf '%s\n' "${prepare_boot_cache}" - cat << EOF + os="$1" + xen_version="$2" + version="$3" + xen_args="$4" + args="$5" + printf "menuentry 'Xen %s / %s, with Linux %s' --class xen ${CLASS} {\n" "${xen_version}" "${os}" "${version}" + save_default_entry | sed -e "s/^/\t/" + + if [ -z "${prepare_boot_cache}" ]; then + prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")" + fi + printf '%s\n' "${prepare_boot_cache}" + cat << EOF echo '$(printf "Loading Xen %s ..." ${xen_version})' multiboot ${rel_dirname}/${xen_basename} ${rel_dirname}/${xen_basename} ${xen_args} echo $(printf "$(gettext "Loading Linux %s ...")" ${version}) module ${rel_dirname}/${basename} ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args} EOF - if test -n "${initrd}" ; then - cat << EOF + if test -n "${initrd}" ; then + cat << EOF echo "Loading initial ramdisk ..." module ${rel_dirname}/${initrd} EOF - fi - cat << EOF + fi + cat << EOF } EOF } @@ -74,50 +74,48 @@ done` prepare_boot_cache= while [ "x$xen_list" != "x" ] ; do - xen=`version_find_latest $xen_list` - echo "Found Xen hypervisor image: $xen" >&2 - xen_basename=`basename $xen` - xen_dirname=`dirname $xen` - rel_xen_dirname=`make_system_path_relative_to_its_root $xen_dirname` - xen_version=`echo $xen_basename | sed -e "s,^[^0-9]*-,,g" | sed -e "s,.gz,,g"` - alt_xen_version=`echo $xen_version | sed -e "s,\.old$,,g"` - - xen_configfiles=`grep -l 'CONFIG_XEN_PRIVILEGED_GUEST=y' /boot/config-*` - - list="/boot/vmlinuz-linux-libre"; - - while [ "x$list" != "x" ] ; do - linux=`version_find_latest $list` - echo -e "\tFound linux image: $linux" >&2 - basename=`basename $linux` - dirname=`dirname $linux` - rel_dirname=`make_system_path_relative_to_its_root $dirname` - version=`echo $basename | sed -e "s,^[^0-9]*-,,g"` - base_init=`echo $basename | sed -e "s,vmlinuz,initramfs,g"` - alt_version="${base_init}-fallback" - linux_root_device_thisversion="${LINUX_ROOT_DEVICE}" - initrd= - - for i in "${base_init}.img"; do - if test -e "${dirname}/${i}" ; then - initrd="$i" - break - fi - done - if test -n "${initrd}" ; then - echo -e "\tFound initrd image: ${dirname}/${initrd}" >&2 - else + xen=`version_find_latest $xen_list` + echo "Found Xen hypervisor image: $xen" >&2 + xen_basename=`basename $xen` + xen_dirname=`dirname $xen` + rel_xen_dirname=`make_system_path_relative_to_its_root $xen_dirname` + xen_version=`echo $xen_basename | sed -e "s,^[^0-9]*-,,g" | sed -e "s,.gz,,g"` + alt_xen_version=`echo $xen_version | sed -e "s,\.old$,,g"` + + list="/boot/vmlinuz-linux"; + + while [ "x$list" != "x" ] ; do + linux=`version_find_latest $list` + echo -e "\tFound linux image: $linux" >&2 + basename=`basename $linux` + dirname=`dirname $linux` + rel_dirname=`make_system_path_relative_to_its_root $dirname` + version=`echo $basename | sed -e "s,^[^0-9]*-,,g"` + base_init=`echo $basename | sed -e "s,vmlinuz,initramfs,g"` + alt_version="${base_init}-fallback" + linux_root_device_thisversion="${LINUX_ROOT_DEVICE}" + initrd= + + for i in "${base_init}.img"; do + if test -e "${dirname}/${i}" ; then + initrd="$i" + break + fi + done + if test -n "${initrd}" ; then + echo -e "\tFound initrd image: ${dirname}/${initrd}" >&2 + else # "UUID=" magic is parsed by initrds. Since there's no initrd, it can't work here. - linux_root_device_thisversion=${GRUB_DEVICE} - fi + linux_root_device_thisversion=${GRUB_DEVICE} + fi - xen_entry "${OS}" "${xen_version}" "${version}" \ - "${XEN_HYPERVISOR_CMDLINE}" \ - "${XEN_LINUX_CMDLINE}" + xen_entry "${OS}" "${xen_version}" "${version}" \ + "${XEN_HYPERVISOR_CMDLINE}" \ + "${XEN_LINUX_CMDLINE}" - list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '` - done + list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '` + done - xen_list=`echo $xen_list | tr ' ' '\n' | grep -vx $xen | tr '\n' ' '` + xen_list=`echo $xen_list | tr ' ' '\n' | grep -vx $xen | tr '\n' ' '` done diff --git a/kernels/xen/PKGBUILD b/kernels/xen/PKGBUILD index c51ffeaa9..33a2dccb1 100644 --- a/kernels/xen/PKGBUILD +++ b/kernels/xen/PKGBUILD @@ -1,104 +1,122 @@ -# Maintainer M0Rf30 -# Contributor WaxyMouthfeel -# Maintainer (Parabola): André Silva <andre.paulista@adinet.com.uy> +# Maintainer: Limao Luo <luolimao+AUR@gmail.com> +# Contributor: Luceo +# Contributor: Revellion + pkgname=xen -pkgver=4.1.2 -pkgrel=3.1 -pkgdesc="Xen 4 (hypervisor and tools)" +pkgver=4.2.0 +pkgrel=12 +pkgdesc="Xen Hypervisor & Tools" arch=(i686 x86_64) -url="http://xen.org/" -license="GPL" - -if [[ $CARCH == "x86_64" ]]; then - depends=('xz' 'bzip2' 'iproute' 'net-tools' 'bridge-utils' 'python2' 'sdl' 'zlib' 'e2fsprogs' 'bin86' 'pkgconfig' 'gnutls' 'lzo2' 'lib32-glibc') -else - depends=('xz' 'bzip2' 'iproute' 'net-tools' 'bridge-utils' 'python2' 'sdl' 'zlib' 'e2fsprogs' 'bin86' 'pkgconfig' 'gnutls' 'lzo2' 'glibc') -fi - -optdepends=('xen-docs: Xen Official Documentation') -makedepends=('dev86' 'ocaml-findlib' 'iasl') -conflicts=('xen4' 'xen3' 'xen-hv-tools' 'libxen4') -provides=('xen') -backup=('etc/xen/xend-config.sxp' 'etc/xen/xend-pci-permissive.sxp' 'etc/xen/xend-pci-quirks.sxp') -options=(!strip) -optional=(xen-docs) -source=(http://bits.xensource.com/oss-xen/release/${pkgver}/xen-${pkgver}.tar.gz - 09_xen - xen.patch - parabolainit.patch - dom0_xz_decompression.patch - 24341.patch - 24344.patch - 24345.patch) +url=http://xen.org +license=(GPL) +depends=(bin86 bluez bridge-utils glib2 gnutls libaio libjpeg-turbo libpng lzo2 sdl wget vde2 yajl) +[[ "$CARCH" == "x86_64" ]] && depends+=(lib32-glibc) +makedepends=(dev86 git iasl markdown ocaml-findlib) +optdepends=('xen-docs: Official Xen Documentation') +conflicts=(xen-4.2{,-testing-hg} xen-{gdbsx,hg-unstable,rc}) +backup=(etc/$pkgname/xend-{config,pci-{permissive,quirks}}.sxp etc/modules-load.d/$pkgname.conf) +options=(!buildflags !emptydirs !strip) +install=$pkgname.install +source=(http://bits.xensource.com/oss-xen/release/$pkgver/$pkgname-$pkgver.tar.gz + 09_xen + archinit.patch + texi2html.patch + proc-xen.mount + var-lib-xenstored.mount + xenconsoled.service + xendomains.service + xendomU@.service + xenstored.service + $pkgname.conf) +sha256sums=('43f4a086e4e0330145a27b7ace8365c42b5afbc95cefadafe067be91bd3e5cfb' + 'e8dd740c0f18ea41bb80afad36ca981669e6ab86eb3848fbb40f0dff3b8aa3e6' + '35900d3ae2f2cc27834b8a7cb11f134b582f01bde033598c407c8e58ad58fdb9' + '08e5bf65c833a608470ad118ce369e32f9c267e1787f2900c06708af321225e6' + '139eed988bfaf8edc8ccdfd0b668382bd63db48ce17be91776182a7e28e9d88c' + 'c19146931c6ab8e53092bd9b2ebbfda5c76fd22ad3b1d42dcda3dd1b61f123ff' + 'ba8f1c10b3f3df1f9fda0782a691fed67661e36f49be74471c86850639fee3ba' + '0bd45d9de6456c4f9adf32e726f2db3a3cd0423c1d161b442e8a1666d2e68e3f' + '1862a14607582d14247b74435dfb16411fd68904aa19e2a93c5e6ac301169d3c' + '0a1960fd51a2f4e8e856c7392e33cc9607ac4a80e9d68b316b6a4281f34728e0' + '50a9b7fd19e8beb1dea09755f07318f36be0b7ec53d3c9e74f3266a63e682c0c') +sha512sums=('4fb56c79d722fb307bc657f16d02079c6636427e7650c4354193632d38d2d1db8e588f844ff0ca6e757c108ed639a528565ec9fc7c00bb4d5b6fbc9d122d8a70' + '23402f54e1a40c058566d6c0f18ac2e89ea85eea8bedf669f059e30ad76b3b90d81b7ff34d8e8c07ab4fea7f82ae32c80a66df2fd95fb3b296e982cdcc93d0b6' + '9ce0c009f055c9be42435be9eeeec980285cbef4fb52cbd8d81f76ae1e7760575b5c9f958e3d44612d2740eafa1e18ee48f30a5571f0c06bd031d4e102abb22f' + '562f12e723116c705fc9d0fd4a2afd382a93465be7f616d1e20e87daf39c11029fbc57ec46e38d3ff61c482fdc9ac4df9e07600a77515867d9da6f0faf3da7f9' + '6afdf16e32bb837faf6333334f86855a746f1f46fee9673a4fddc62eecf41f9856bc34397807203c6f5071f0b1ce74532214084042154585c0d39514450db25c' + '00e340f4d3635e3850ca24baea1da08467523c17815feb74161e18397b607fef904db2165fd9bf4632a6e8a6e37aeddad4e56965e1c99b5213c98b3f9afc6aad' + '27d7289a8bf6e15bddcb360287001429205b57ee4d791b0337328879ffd76b8e375e3c1dd0de0ab57dd4bd1e2a2bc1748c44cc05b2528632a3e6af60f626de9d' + 'f00034f8b826b828659a0177f0a6454113c625e69a817dfe32e461767f6643e0288bfc2a22d23358504240df627af6e3b8f5ffa0077e241e590b33d3f252e74c' + '31fefc739f0f0e568df03dcf9aa02e0265ff4fbf77e7ae62d6a318fcc34e87a0ffd3fc4b84ff8c9cc95511e2e74b7b61e6b5471cd0b3cd47ee0da86b1ea90268' + '87aceb1c646e49940bfbc47da85d7e20c9436449b152c0842b357033f66aba68a590f1d56c4a3f437d093047a611f28fd67d381692d9b21a582e598ecf1a72a2' + 'ccaa2ff82e4203b11e5dec9aeccac2e165721d8067e0094603ecaa7a70b78c9eb9e2287a32687883d26b6ceae6f8d2ad7636ddf949eb658637b3ceaa6999711b') build() { - - - cd $srcdir/xen-${pkgver} - - patch -p1 -i ../xen.patch - patch -p1 -i ../parabolainit.patch - patch -p1 -i ../dom0_xz_decompression.patch - patch -p1 -i ../24341.patch - patch -p1 -i ../24344.patch - patch -p1 -i ../24345.patch - -unset CFLAGS LDFLAGS - -make PYTHON=python2 DESTDIR=$pkgdir install-xen -make PYTHON=python2 DESTDIR=$pkgdir install-tools -#make PYTHON=python2 DESTDIR=$pkgdir install-stubdom - - sed -i 's#XENDOM_CONFIG=/etc/sysconfig/xendomains#XENDOM_CONFIG=/etc/conf.d/xendomains#' $pkgdir/etc/init.d/xendomains - sed -i "s#touch /var/lock/subsys/xend#mkdir -p /var/lock/subsys\n touch /var/lock/subsys/xend#" $pkgdir/etc/init.d/xend - - [ -d $pkgdir/usr/lib64 ] && ( cd $pkgdir/usr && cp -R lib64/* lib/ && rm -R lib64 ) - ( cd $pkgdir/etc && mv init.d rc.d ) || return 1 - rm -f $pkgdir/usr/share/man/man1/qemu-img.1* \ - $pkgdir/usr/share/man/man1/qemu.1* - # First experiment to generate grub2.cfg entry - mkdir -p $pkgdir/etc/grub.d - chmod +x $srcdir/09_xen - cp $srcdir/09_xen $pkgdir/etc/grub.d - - ############ kill unwanted stuff ############ - -# stubdom: newlib -rm -rf $pkgdir/usr/*-xen-elf - -# hypervisor symlinks -rm -rf $pkgdir/boot/xen-4.1.gz -rm -rf $pkgdir/boot/xen-4.gz -rm -rf $pkgdir/boot/xen.gz - -# silly doc dir fun -rm -fr $pkgdir/usr/share/doc/xen -rm -rf $pkgdir/usr/share/doc/qemu - -# Pointless helper -rm -f $pkgdir/usr/sbin/xen-python-path - -# qemu stuff (unused or available from upstream) -rm -rf $pkgdir/usr/share/xen/man -rm -rf $pkgdir/usr/bin/qemu-*-xen -for file in bios.bin openbios-sparc32 openbios-sparc64 ppc_rom.bin \ - pxe-e1000.bin pxe-ne2k_pci.bin pxe-pcnet.bin pxe-rtl8139.bin \ - vgabios.bin vgabios-cirrus.bin video.x openbios-ppc bamboo.dtb -do - rm -f $pkgdir/usr/share/xen/qemu/$file -done - -# adhere to Static Library Packaging Guidelines -rm -rf $pkgdir/usr/lib/*.a - - + cd "$srcdir"/$pkgname-$pkgver/ + + patch -Np1 -i ../archinit.patch + patch -Np1 -i ../texi2html.patch + + ./autogen.sh + ./configure PYTHON=/usr/bin/python2 } -md5sums=('73561faf3c1b5e36ec5c089b5db848ad' - '8d50beba46ffd89a3b959176245b676e' - 'f149bae1a6b420e49c51b9f3a74338a4' - '7a1ed81ecc828037724bb3280058c9fc' - '4aebccf16b578ed97aa8bab945011f35' - '1b0c05a555bc99fc8416dd52b6c6ae95' - 'b6225be5bec3fe462f9166f9fde9c347' - 'd282946a2873a78b2b2c3944571eb2fe') +package() { + cd "$srcdir"/$pkgname-$pkgver/ + + make PYTHON=python2 DESTDIR="$pkgdir" install-xen install-tools + # stubdom won't build with multiple makethreads + make -j1 PYTHON=python2 DESTDIR="$pkgdir" install-stubdom + + cd ../ + for f in ${source[@]}; do + [[ $f =~ .mount || $f =~ .service ]] && install -Dm644 $f "$pkgdir"/usr/lib/systemd/system/$f + done + install -Dm644 $pkgname.conf "$pkgdir"/etc/modules-load.d/$pkgname.conf + install -Dm755 09_xen "$pkgdir"/etc/grub.d/09_xen + + cd "$pkgdir" + sed -i ':XENDOM_CONFIG=/etc/:s:sysconfig/xendomains:conf.d/xendomains:' etc/init.d/xendomains + sed -i 's:touch /var/lock/subsys/xend:mkdir -p /var/lock/subsys\n &:' etc/init.d/xend + + if [[ -d usr/lib64 ]]; then + cd usr/ + cp -r lib64/* lib/ + rm -rf lib64 + fi + + mv etc/{init,rc}.d + + mv usr/local/etc/qemu/ etc/ + rm -rf usr/local/share/ + mv etc/rc.d/xendomains etc/xen/scripts/xendomains + + ##### Kill unwanted stuff ##### + # stubdom: newlib + rm -rf usr/*-xen-elf + + # hypervisor symlinks + rm -f boot/xen{,-4,-4.2}.gz + + # silly doc dir fun + rm -rf usr/share/doc/xen + rm -rf usr/share/doc/qemu + + # Pointless helper + rm -f usr/sbin/xen-python-path + + # qemu stuff (unused or available from upstream) + rm -rf usr/share/xen/man + rm -rf usr/bin/qemu-*-xen + for file in bios.bin openbios-sparc32 openbios-sparc64 ppc_rom.bin \ + pxe-e1000.bin pxe-ne2k_pci.bin pxe-pcnet.bin pxe-rtl8139.bin \ + vgabios.bin vgabios-cirrus.bin video.x openbios-ppc bamboo.dtb; do + rm -f usr/share/xen/qemu/$file + done + + # adhere to Static Library Packaging Guidelines + rm -rf usr/lib/*.a + + # Fix errors from deprecated xend + rm etc/udev/rules.d/xend.rules +} diff --git a/kernels/xen/archinit.patch b/kernels/xen/archinit.patch new file mode 100644 index 000000000..f5bece6e2 --- /dev/null +++ b/kernels/xen/archinit.patch @@ -0,0 +1,450 @@ +--- a/tools/hotplug/Linux/init.d/xencommons 2011-07-03 03:08:44.953747064 -0700 ++++ b/tools/hotplug/Linux/init.d/xencommons 2011-07-05 13:47:54.627029164 -0700 +@@ -17,6 +17,8 @@ + # Short-Description: Start/stop xenstored and xenconsoled + # Description: Starts and stops the daemons neeeded for xl/xend + ### END INIT INFO ++. /etc/rc.conf ++. /etc/rc.d/functions + + if [ -d /etc/sysconfig ]; then + xencommons_config=/etc/sysconfig +@@ -26,7 +28,7 @@ + + test -f $xencommons_config/xencommons && . $xencommons_config/xencommons + +-XENCONSOLED_PIDFILE=/var/run/xenconsoled.pid ++XENCONSOLED_PIDFILE=/run/daemons/xenconsoled.pid + shopt -s extglob + + # not running in Xen dom0 or domU +@@ -69,7 +71,7 @@ + modprobe pciback 2>/dev/null + modprobe xen-acpi-processor 2>/dev/null + modprobe blktap2 2>/dev/null || modprobe blktap 2>/dev/null +- mkdir -p /var/run/xen ++ #mkdir -p /var/run/xen + + if ! `xenstore-read -s / >/dev/null 2>&1` + then +@@ -78,55 +80,66 @@ + test -z "$XENSTORED_TRACE" || XENSTORED_ARGS=" -T /var/log/xen/xenstored-trace.log" + + if [ -n "$XENSTORED" ] ; then +- echo -n Starting $XENSTORED... +- $XENSTORED --pid-file /var/run/xenstored.pid $XENSTORED_ARGS ++ #echo -n Starting $XENSTORED... ++ stat_busy "Starting $XENSTORED" ++ $XENSTORED --pid-file /run/daemons/xenstored.pid $XENSTORED_ARGS + elif [ -x /usr/sbin/oxenstored ] ; then +- echo -n Starting oxenstored... +- /usr/sbin/oxenstored --pid-file /var/run/xenstored.pid $XENSTORED_ARGS ++ #echo -n Starting oxenstored... ++ stat_busy "Starting oxenstored" ++ /usr/sbin/oxenstored --pid-file /run/daemons/xenstored.pid $XENSTORED_ARGS + elif [ -x /usr/sbin/xenstored ] ; then +- echo -n Starting C xenstored... +- /usr/sbin/xenstored --pid-file /var/run/xenstored.pid $XENSTORED_ARGS ++ #echo -n Starting C xenstored... ++ stat_busy "Starting C xenstored" ++ /usr/sbin/xenstored --pid-file /run/daemons/xenstored.pid $XENSTORED_ARGS + else +- echo "No xenstored found" ++ #echo "No xenstored found" ++ stat_fail + exit 1 + fi + + # Wait for xenstored to actually come up, timing out after 30 seconds + while [ $time -lt $timeout ] && ! `xenstore-read -s / >/dev/null 2>&1` ; do +- echo -n . ++ #echo -n . + time=$(($time+1)) + sleep 1 + done +- echo ++ #echo + + # Exit if we timed out + if ! [ $time -lt $timeout ] ; then +- echo Could not start xenstored ++ #echo Could not start xenstored ++ stat_fail + exit 1 + fi + +- echo Setting domain 0 name... ++ #echo Setting domain 0 name... ++ stat_busy "Setting domain0 name" + xenstore-write "/local/domain/0/name" "Domain-0" + fi + +- echo Starting xenconsoled... ++ #echo Starting xenconsoled... ++ stat_busy "Starting xenconsoled" + test -z "$XENCONSOLED_TRACE" || XENCONSOLED_ARGS=" --log=$XENCONSOLED_TRACE" + xenconsoled --pid-file=$XENCONSOLED_PIDFILE $XENCONSOLED_ARGS + test -z "$XENBACKENDD_DEBUG" || XENBACKENDD_ARGS="-d" + test "`uname`" != "NetBSD" || xenbackendd $XENBACKENDD_ARGS +- echo Starting QEMU as disk backend for dom0 ++ #echo Starting QEMU as disk backend for dom0 ++ stat_busy "Starting QEMU as disk backend for dom0" + test -z "$QEMU_XEN" && QEMU_XEN=/usr/lib/xen/bin/qemu-system-i386 + $QEMU_XEN -xen-domid 0 -xen-attach -name dom0 -nographic -M xenpv -daemonize -monitor /dev/null ++ stat_done + } + do_stop () { +- echo Stopping xenconsoled ++ #echo Stopping xenconsoled ++ stat_busy "Stopping xenconsoled" + if read 2>/dev/null <$XENCONSOLED_PIDFILE pid; then + kill $pid + while kill -9 $pid >/dev/null 2>&1; do sleep 0.1; done + rm -f $XENCONSOLED_PIDFILE + fi ++ stat_done + +- echo WARNING: Not stopping xenstored, as it cannot be restarted. ++ #echo WARNING: Not stopping xenstored, as it cannot be restarted. + } + + case "$1" in +--- a/tools/hotplug/Linux/init.d/xend 2011-07-03 03:08:44.953747064 -0700 ++++ b/tools/hotplug/Linux/init.d/xend 2011-07-05 01:47:40.981951191 -0700 +@@ -18,6 +18,10 @@ + # Description: Starts and stops the Xen control daemon. + ### END INIT INFO + ++. /etc/rc.conf ++. /etc/rc.d/functions ++ ++ + shopt -s extglob + + # Wait for Xend to be up +@@ -37,23 +41,30 @@ + case "$1" in + start) + if [ -z "`ps -C xenconsoled -o pid=`" ]; then +- echo "xencommons should be started first." ++ printhl "xencommons should be started first." + exit 1 + fi + # mkdir shouldn't be needed as most distros have this already created. Default to using subsys. + # See docs/misc/distro_mapping.txt +- mkdir -p /var/lock +- if [ -d /var/lock/subsys ] ; then +- touch /var/lock/subsys/xend ++ if [ -d /run/lock/subsys ] ; then ++ touch /run/lock/subsys/xend + else +- touch /var/lock/xend ++ touch /run/lock/xend + fi ++ stat_busy "Starting xend" + xend start + await_daemons_up ++ stat_done ++ add_daemon xend + ;; ++ ++ + stop) ++ stat_busy "Stopping xend" + xend stop +- rm -f /var/lock/subsys/xend /var/lock/xend ++ rm -f /run/lock/xend /var/lock/xend ++ stat_done ++ rm_daemon xend + ;; + status) + xend status +@@ -62,8 +73,10 @@ + xend reload + ;; + restart|force-reload) ++ stat_busy "Restarting xend" + xend restart + await_daemons_up ++ stat_done + ;; + *) + # do not advertise unreasonable commands that there is no reason +--- a/tools/hotplug/Linux/init.d/xendomains 2011-07-03 03:08:44.953747064 -0700 ++++ b/tools/hotplug/Linux/init.d/xendomains 2011-07-05 13:46:36.208222760 -0700 +@@ -26,6 +26,9 @@ + # Description: Start / stop domains automatically when domain 0 + # boots / shuts down. + ### END INIT INFO ++. /etc/rc.conf ++. /etc/rc.d/functions ++ + + CMD=xm + $CMD list &> /dev/null +@@ -46,93 +49,52 @@ + exit 0 + fi + +-# See docs/misc/distro_mapping.txt +-if [ -d /var/lock/subsys ]; then +- LOCKFILE=/var/lock/subsys/xendomains +-else +- LOCKFILE=/var/lock/xendomains +-fi +- +-if [ -d /etc/sysconfig ]; then +- XENDOM_CONFIG=/etc/sysconfig/xendomains +-else +- XENDOM_CONFIG=/etc/default/xendomains +-fi ++LOCKFILE=/run/lock/xendomains ++XENDOM_CONFIG=/etc/default/xendomains + +-test -r $XENDOM_CONFIG || { echo "$XENDOM_CONFIG not existing"; ++test -r $XENDOM_CONFIG || { ++ printhl "$XENDOM_CONFIG not existing"; + if [ "$1" = "stop" ]; then exit 0; + else exit 6; fi; } + + . $XENDOM_CONFIG + +-# Use the SUSE rc_ init script functions; +-# emulate them on LSB, RH and other systems +-if test -e /etc/rc.status; then +- # SUSE rc script library +- . /etc/rc.status +-else +- _cmd=$1 +- declare -a _SMSG +- if test "${_cmd}" = "status"; then ++_cmd=$1 ++declare -a _SMSG ++if test "${_cmd}" = "status"; then + _SMSG=(running dead dead unused unknown) + _RC_UNUSED=3 +- else ++else + _SMSG=(done failed failed missed failed skipped unused failed failed) + _RC_UNUSED=6 +- fi +- if test -e /etc/init.d/functions; then +- # REDHAT +- . /etc/init.d/functions +- echo_rc() +- { +- #echo -n " [${_SMSG[${_RC_RV}]}] " +- if test ${_RC_RV} = 0; then +- success " [${_SMSG[${_RC_RV}]}] " +- else +- failure " [${_SMSG[${_RC_RV}]}] " +- fi +- } +- elif test -e /lib/lsb/init-functions; then +- # LSB +- . /lib/lsb/init-functions +- if alias log_success_msg >/dev/null 2>/dev/null; then +- echo_rc() +- { +- echo " [${_SMSG[${_RC_RV}]}] " +- } +- else +- echo_rc() +- { +- if test ${_RC_RV} = 0; then +- log_success_msg " [${_SMSG[${_RC_RV}]}] " +- else +- log_failure_msg " [${_SMSG[${_RC_RV}]}] " +- fi +- } +- fi +- else +- # emulate it +- echo_rc() +- { +- echo " [${_SMSG[${_RC_RV}]}] " +- } +- fi +- rc_reset() { _RC_RV=0; } +- rc_failed() +- { ++fi ++ ++ ++ ++echo_rc() { ++ echo ++ printhl "Return Status: ${_SMSG[${_RC_RV}]}" ++} ++ ++ ++rc_reset() { _RC_RV=0; } ++ ++ ++rc_failed() { + if test -z "$1"; then +- _RC_RV=1; ++ _RC_RV=1; + elif test "$1" != "0"; then +- _RC_RV=$1; +- fi ++ _RC_RV=$1; ++ fi + return ${_RC_RV} +- } +- rc_check() +- { ++} ++ ++rc_check() { + return rc_failed $? +- } +- rc_status() +- { ++} ++ ++ ++rc_status() { + rc_failed $? + if test "$1" = "-r"; then _RC_RV=0; shift; fi + if test "$1" = "-s"; then rc_failed 5; echo_rc; rc_failed 3; shift; fi +@@ -140,26 +102,24 @@ + if test "$1" = "-v"; then echo_rc; shift; fi + if test "$1" = "-r"; then _RC_RV=0; shift; fi + return ${_RC_RV} +- } +- rc_exit() { exit ${_RC_RV}; } +- rc_active() +- { ++} ++ ++ ++rc_exit() { exit ${_RC_RV}; } ++ ++ ++rc_active() { + if test -z "$RUNLEVEL"; then read RUNLEVEL REST < <(/sbin/runlevel); fi + if test -e /etc/init.d/S[0-9][0-9]${1}; then return 0; fi + return 1 +- } +-fi ++} + +-if ! which usleep >&/dev/null +-then +- usleep() +- { +- if [ -n "$1" ] +- then +- sleep $(( $1 / 1000000 )) +- fi +- } +-fi ++usleep() { ++ if [ -n "$1" ] ++ then ++ sleep $(( $1 / 1000000 )) ++ fi ++} + + # Reset status of this service + rc_reset +@@ -240,10 +200,12 @@ + start() + { + if [ -f $LOCKFILE ]; then +- echo -e "xendomains already running (lockfile exists)" ++ stat_busy "xendomains already running (lockfile exists)" ++ stat_fail + return; + fi + ++ printhl "Starting Xen Domains" + saved_domains=" " + if [ "$XENDOMAINS_RESTORE" = "true" ] && + contains_something "$XENDOMAINS_SAVE" +@@ -304,6 +266,7 @@ + fi + done + fi ++ add_daemon xendomains + } + + all_zombies() +@@ -357,7 +320,7 @@ + if test "$XENDOMAINS_AUTO_ONLY" = "true"; then + rdnames + fi +- echo -n "Shutting down Xen domains:" ++ printhl "Shutting down Xen domains" + name=;id= + while read LN; do + parseln "$LN" || continue +@@ -470,6 +433,7 @@ + rm -f $LOCKFILE + + exec 2>&3 ++ rm_daemon xendomains + } + + check_domain_up() +--- a/tools/hotplug/Linux/init.d/xen-watchdog 2011-07-03 03:08:44.957080397 -0700 ++++ b/tools/hotplug/Linux/init.d/xen-watchdog 2011-07-05 13:20:22.515289867 -0700 +@@ -17,49 +17,32 @@ + ### END INIT INFO + # + ++. /etc/rc.conf ++. /etc/rc.d/functions ++ + DAEMON=/usr/sbin/xenwatchdogd + base=$(basename $DAEMON) ++initname="xen-watchdog" + +-# Source function library. +-if [ -e /etc/init.d/functions ] ; then +- . /etc/init.d/functions +-elif [ -e /lib/lsb/init-functions ] ; then +- . /lib/lsb/init-functions +- success () { +- log_success_msg $* +- } +- failure () { +- log_failure_msg $* +- } +-else +- success () { +- echo $* +- } +- failure () { +- echo $* +- } +-fi + + start() { + local r +- echo -n $"Starting domain watchdog daemon: " ++ stat_busy "Starting domain watchdog daemon" + + $DAEMON 30 15 + r=$? +- [ "$r" -eq 0 ] && success $"$base startup" || failure $"$base startup" +- echo ++ [ "$r" -eq 0 ] && stat_done ; add_daemon $initname || stat_fail + + return $r + } + + stop() { + local r +- echo -n $"Stopping domain watchdog daemon: " ++ stat_busy "Stopping domain watchdog daemon" + + killall -USR1 $base 2>/dev/null + r=$? +- [ "$r" -eq 0 ] && success $"$base stop" || failure $"$base stop" +- echo ++ [ "$r" -eq 0 ] && stat_done ; rm_daemon $initname || stat_fail + + return $r + } diff --git a/kernels/xen/proc-xen.mount b/kernels/xen/proc-xen.mount new file mode 100644 index 000000000..0eaa59c5f --- /dev/null +++ b/kernels/xen/proc-xen.mount @@ -0,0 +1,9 @@ +[Unit] +Description=Mount /proc/xen files +ConditionPathExists=/proc/xen +RefuseManualStop=true + +[Mount] +What=xenfs +Where=/proc/xen +Type=xenfs diff --git a/kernels/xen/texi2html.patch b/kernels/xen/texi2html.patch new file mode 100644 index 000000000..8f22773c9 --- /dev/null +++ b/kernels/xen/texi2html.patch @@ -0,0 +1,10 @@ +--- a/tools/Makefile 2012-09-17 22:25:54.683349679 -0500 ++++ b/tools/Makefile 2012-09-17 22:49:08.923331802 -0500 +@@ -164,6 +164,7 @@ + $(QEMU_ROOT)/xen-setup \ + --extra-cflags="$(EXTRA_CFLAGS_QEMU_TRADITIONAL)" \ + $(IOEMU_CONFIGURE_CROSS); \ ++ sed -i 's/number[ ]/number-sections /' Makefile; \ + $(MAKE) install + + subdir-clean-qemu-xen-traditional-dir: diff --git a/kernels/xen/var-lib-xenstored.mount b/kernels/xen/var-lib-xenstored.mount new file mode 100644 index 000000000..1c2015ca2 --- /dev/null +++ b/kernels/xen/var-lib-xenstored.mount @@ -0,0 +1,10 @@ +[Unit] +Description=mount xenstore file system +ConditionPathExists=/proc/xen +RefuseManualStop=true + +[Mount] +What=xenstore +Where=/var/lib/xenstored +Type=tmpfs +Options=mode=755 diff --git a/kernels/xen/xen.conf b/kernels/xen/xen.conf new file mode 100644 index 000000000..37a5b59f7 --- /dev/null +++ b/kernels/xen/xen.conf @@ -0,0 +1,19 @@ +xen-evtchn +xen-gntdev +xen-gntalloc +xen-blkback +xen-netback +xen-pciback +xen-acpi-processor +## xen-acpi-processor: This module may not work on all machines; try removing this first if it causes issues. + +## The following were included in xencommons, but were not inserted by systemd: +# evtchn +# gntdev +# netbk +# blkbk +# xen-scsibk +# usbbk +# pciback +# blktap2 +# blktap diff --git a/kernels/xen/xen.install b/kernels/xen/xen.install new file mode 100644 index 000000000..5664948c7 --- /dev/null +++ b/kernels/xen/xen.install @@ -0,0 +1,38 @@ +install_msg() { + cat << __EOF__ +===> IMPORTANT NOTICE: + +In order to complete the installation, and enable Xen, +at the very least you must: +1. Edit your GRUB2 config files as specified at + https://wiki.archlinux.org/index.php/Xen#Bootloader_Configuration +2. Issue the following commands to allow you to create and start VMs: + systemctl enable xenstored.service + systemctl enable xenconsoled.service + systemctl enable xendomains.service +For more information refer to the Wiki: + https://wiki.archlinux.org/index.php/Xen +__EOF__ + +} + +post_upgrade() { + install_msg +} + +pre_remove() { + for i in xen{stored,consoled,domains}.service; do + systemctl disable $serv + systemctl stop $serv + done +} + +post_remove() { + cat << __EOF__ +===> IMPORTANT NOTICE: + +In order to finish removing Xen, you will need to modify +your bootloader configuration files to load your Linux +kernel instead of Xen kernel. +__EOF__ +} diff --git a/kernels/xen/xenconsoled.service b/kernels/xen/xenconsoled.service new file mode 100644 index 000000000..edcc8e69f --- /dev/null +++ b/kernels/xen/xenconsoled.service @@ -0,0 +1,18 @@ +[Unit] +Description=Xenconsoled - handles logging from guest consoles and hypervisor +Requires=proc-xen.mount +After=proc-xen.mount xenstored.service +ConditionPathExists=/proc/xen + +[Service] +Type=simple +Environment=XENCONSOLED_ARGS= +Environment=XENCONSOLED_LOG=none +Environment=XENCONSOLED_LOG_DIR=/var/log/xen/console +EnvironmentFile=-/etc/conf.d/xenconsoled +PIDFile=/var/run/xenconsoled.pid +ExecStartPre=/usr/bin/grep -q control_d /proc/xen/capabilities +ExecStart=/usr/sbin/xenconsoled --log=${XENCONSOLED_LOG} --log-dir=${XENCONSOLED_LOG_DIR} $XENCONSOLED_ARGS + +[Install] +WantedBy=multi-user.target diff --git a/kernels/xen/xendomU@.service b/kernels/xen/xendomU@.service new file mode 100644 index 000000000..57d6e520d --- /dev/null +++ b/kernels/xen/xendomU@.service @@ -0,0 +1,12 @@ +[Unit] +Description=xen domU service for domain %i +Requires=xenstored.service + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/sbin/xl create /etc/xen/conf/%i.cfg +ExecStop=/usr/sbin/xl shutdown %i + +[Install] +WantedBy=multi-user.target diff --git a/kernels/xen/xendomains.service b/kernels/xen/xendomains.service new file mode 100644 index 000000000..d49bd5593 --- /dev/null +++ b/kernels/xen/xendomains.service @@ -0,0 +1,15 @@ +[Unit] +Description=Xendomains - start and stop guests on boot and shutdown +Requires=proc-xen.mount xenstored.service +After=proc-xen.mount xenstored.service xenconsoled.service +ConditionPathExists=/proc/xen + +[Service] +Type=oneshot +RemainAfterExit=true +ExecStartPre=/usr/bin/grep -q control_d /proc/xen/capabilities +ExecStart=/etc/xen/scripts/xendomains start +ExecStop=/etc/xen/scripts/xendomains stop + +[Install] +WantedBy=multi-user.target diff --git a/kernels/xen/xenstored.service b/kernels/xen/xenstored.service new file mode 100644 index 000000000..9025f2244 --- /dev/null +++ b/kernels/xen/xenstored.service @@ -0,0 +1,18 @@ +[Unit] +Description=Xenstored - daemon managing xenstore file system +Requires=proc-xen.mount var-lib-xenstored.mount +After=proc-xen.mount var-lib-xenstored.mount +Before=libvirtd.service libvirt-guests.service +RefuseManualStop=true +ConditionPathExists=/proc/xen + +[Service] +Type=forking +Environment=XENSTORED_ARGS= +EnvironmentFile=-/etc/conf.d/xenstored +PIDFile=/var/run/xenstored.pid +ExecStartPre=/usr/bin/grep -q control_d /proc/xen/capabilities +ExecStart=/usr/sbin/xenstored --pid-file /var/run/xenstored.pid $XENSTORED_ARGS + +[Install] +WantedBy=multi-user.target |