diff options
author | Ben Booth <benwbooth@gmail.com> | 2016-03-29 10:40:49 -0700 |
---|---|---|
committer | Ben Booth <benwbooth@gmail.com> | 2016-03-30 09:27:40 -0700 |
commit | 449d908b8856bb1a7209425d5bed6824b48bccb4 (patch) | |
tree | e5ddaf3be128759beff58e8f875e080408eeae2e /pkgs/tools/virtualization/xe-guest-utilities | |
parent | 63f1eb6b00ca3bb792c36b4ce26685de90a62f5d (diff) | |
download | nixpkgs-449d908b8856bb1a7209425d5bed6824b48bccb4.tar nixpkgs-449d908b8856bb1a7209425d5bed6824b48bccb4.tar.gz nixpkgs-449d908b8856bb1a7209425d5bed6824b48bccb4.tar.bz2 nixpkgs-449d908b8856bb1a7209425d5bed6824b48bccb4.tar.lz nixpkgs-449d908b8856bb1a7209425d5bed6824b48bccb4.tar.xz nixpkgs-449d908b8856bb1a7209425d5bed6824b48bccb4.tar.zst nixpkgs-449d908b8856bb1a7209425d5bed6824b48bccb4.zip |
xe-guest-utilities: init at 6.2.0
use mkEnableOption use sha256 add xe-guest-utilities to module-list.nix
Diffstat (limited to 'pkgs/tools/virtualization/xe-guest-utilities')
-rw-r--r-- | pkgs/tools/virtualization/xe-guest-utilities/default.nix | 75 | ||||
-rw-r--r-- | pkgs/tools/virtualization/xe-guest-utilities/ip-address.patch | 16 |
2 files changed, 91 insertions, 0 deletions
diff --git a/pkgs/tools/virtualization/xe-guest-utilities/default.nix b/pkgs/tools/virtualization/xe-guest-utilities/default.nix new file mode 100644 index 00000000000..9c783023d66 --- /dev/null +++ b/pkgs/tools/virtualization/xe-guest-utilities/default.nix @@ -0,0 +1,75 @@ +{ stdenv, fetchurl, bzip2, lzo, zlib, xz, bash, python, gnutar, gnused, gnugrep, which }: + +stdenv.mkDerivation (rec { + name = "xe-guest-utilities"; + version = "6.2.0"; + meta = { + description = "Citrix XenServer Tools"; + homepage = http://citrix.com/English/ps2/products/product.asp?contentID=683148&ntref=hp_nav_US; + maintainers = with stdenv.lib.maintainers; [ benwbooth ]; + platforms = stdenv.lib.platforms.linux; + license = [ stdenv.lib.licenses.gpl2 stdenv.lib.licenses.lgpl21 ]; + }; + src = fetchurl { + url = "https://sources.archlinux.org/other/community/xe-guest-utilities/xe-guest-utilities_${version}-1120.tar.gz"; + sha256 = "f9593cd9588188f80253e736f48d8dd94c5b517abb18316085f86acffab48794"; + }; + buildInputs = [ bzip2 gnutar gnused python lzo zlib xz stdenv gnugrep which ]; + patches = [ ./ip-address.patch ]; + postPatch = '' + tar xf "$NIX_BUILD_TOP/$name-$version/xenstore-sources.tar.bz2" + ''; + + buildPhase = '' + export CC=gcc + export CFLAGS='-Wall -Wstrict-prototypes -Wno-unused-local-typedefs -Wno-sizeof-pointer-memaccess' + export PYTHON=python2 + cd "$NIX_BUILD_TOP/$name-$version/uclibc-sources" + for file in Config.mk tools/libxc/Makefile tools/misc/Makefile tools/misc/lomount/Makefile tools/xenstore/Makefile; do + substituteInPlace "$file" --replace -Werror "" + done + make -C tools/include + make -C tools/libxc + make -C tools/xenstore + ''; + + installPhase = '' + export CFLAGS+='-Wall -Wstrict-prototypes -Wno-unused-local-typedefs -Wno-sizeof-pointer-memaccess' + if [[ $CARCH == x86_64 ]]; then + export LIBLEAFDIR_x86_64=lib + fi + for f in include libxc xenstore; do + [[ ! -d $NIX_BUILD_TOP/$name-$version/uclibc-sources/tools/$f ]] && continue + make -C "$NIX_BUILD_TOP/$name-$version/uclibc-sources/tools/$f" DESTDIR="$out" BINDIR=/bin SBINDIR=/bin INCLUDEDIR=/include LIBDIR=/lib install + done + rm -r "$out"/var + + cd "$NIX_BUILD_TOP/$name-$version" + install -Dm755 xe-update-guest-attrs "$out/bin/xe-update-guest-attrs" + install -Dm755 xe-daemon "$out/bin/xe-daemon" + install -Dm644 xen-vcpu-hotplug.rules "$out/lib/udev/rules.d/10-xen-vcpu-hotplug.rules" + substituteInPlace "$out/bin/xe-daemon" --replace sbin bin + substituteInPlace "$out/bin/xe-daemon" --replace /usr/ "$out/" + substituteInPlace "$out/bin/xe-update-guest-attrs" --replace /usr/ "$out/" + substituteInPlace "$out/bin/xe-update-guest-attrs" --replace 'export PATH=' 'export PATH=$PATH:' + substituteInPlace "$out/lib/udev/rules.d/10-xen-vcpu-hotplug.rules" --replace /bin/sh '${bash}/bin/sh' + + cat <<'EOS' >"$out/bin/xe-linux-distribution" + #!${bash}/bin/bash -eu + . /etc/os-release + if [[ $# -gt 0 ]]; then + mkdir -p "$(dirname "$1")" + exec 1>"$1" + fi + cat <<EOF + os_distro="$ID" + os_majorver="''${VERSION_ID%%.*}" + os_minorver="''${VERSION_ID#*.}" + os_uname="$(uname -r)" + os_name="$PRETTY_NAME" + EOF + EOS + chmod 0755 "$out/bin/xe-linux-distribution" + ''; + +}) diff --git a/pkgs/tools/virtualization/xe-guest-utilities/ip-address.patch b/pkgs/tools/virtualization/xe-guest-utilities/ip-address.patch new file mode 100644 index 00000000000..185f259ef70 --- /dev/null +++ b/pkgs/tools/virtualization/xe-guest-utilities/ip-address.patch @@ -0,0 +1,16 @@ +diff -uNr a/xe-update-guest-attrs b/xe-update-guest-attrs +--- a/xe-update-guest-attrs 2012-09-25 12:45:14.000000000 +0200 ++++ b/xe-update-guest-attrs 2012-11-21 16:46:35.000000000 +0100 +@@ -177,9 +177,9 @@ + # collisions:0 txqueuelen:0 + # RX bytes:3604609 (3.4 MiB) TX bytes:3604609 (3.4 MiB) + +-ifs=`/sbin/ifconfig | sed -n -e 's/^\([a-z0-9]\+\).*/name \1/p' \ +- -e 's/.*inet addr:\('$IPADDR_RE'\) .*/ipv4 \1/p' \ +- -e 's+.*inet6 addr: \('$IPADDR6_RE'\)/.*+ipv6 \1+p' | \ ++ifs=`ip addr show | sed -n -e 's/^[[:digit:]]*: \([a-z0-9]*\): .*/name \1 /gp;' \ ++ -e 's/^[[:space:]]\{4\}inet \('${IPADDR_RE}'\)\/.*/ipv4 \1 /gp;' \ ++ -e 's/^[[:space:]]\{4\}inet6 \('${IPADDR6_RE}'\)\/.*/ipv6 \1 /gp;' | \ + while read tag value; do + case "${tag}" in + name) \ No newline at end of file |