diff --git a/pkgs/build-support/upstream-updater/create-src-info-git.sh b/pkgs/build-support/upstream-updater/create-src-info-git.sh new file mode 100755 index 000000000000..6687a1f8f411 --- /dev/null +++ b/pkgs/build-support/upstream-updater/create-src-info-git.sh @@ -0,0 +1,24 @@ +#! /bin/sh + +[ -z "$1" ] && { + echo "Use $0 expression-basename repo-url branch-name package-base-name" + echo "Like:" + echo "$0 default http://git.example.com/repo origin/master hello" + exit 1; +} >&2 + +own_dir="$(cd "$(dirname "$0")"; sh -c pwd)" + +cp "$own_dir/../builder-defs/template-bdp-uud.nix" "$1.nix" +sed -e "s@src-for-default.nix@src-for-$1.nix@g; + s@fetchUrlFromSrcInfo@fetchGitFromSrcInfo@g" -i "$1.nix" +echo '{}' > "src-for-$1.nix" +cat << EOF > src-info-for-$1.nix +{ + repoUrl = "$2"; + rev = "$3"; + baseName = "$4"; + method = "fetchgit"; +} +EOF + diff --git a/pkgs/build-support/upstream-updater/update-upstream-data.sh b/pkgs/build-support/upstream-updater/update-upstream-data.sh index b81a0da48400..f4861aa11d1e 100755 --- a/pkgs/build-support/upstream-updater/update-upstream-data.sh +++ b/pkgs/build-support/upstream-updater/update-upstream-data.sh @@ -75,7 +75,7 @@ prefetchClause="" " export NIX_HASH_ALGO=sha256 rev="$(getAttr rev '')"; - rev_and_hash="$("$own_dir"/../fetchgit/nix-prefetch-git "$repoUrl" "$rev" | tail -2)" + rev_and_hash="$("$own_dir"/../fetchgit/nix-prefetch-git "$repoUrl" "$rev" | tee /dev/stderr | tail -2)" rev="$(echo "$rev_and_hash" | head -1)" url="$repoUrl"; diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix index 0c649f9aa845..909efca247ed 100644 --- a/pkgs/os-specific/linux/kernel/generic.nix +++ b/pkgs/os-specific/linux/kernel/generic.nix @@ -36,6 +36,7 @@ extraConfig ? [] , preConfigure ? "" +, extraMeta ? {} , ... }: @@ -96,5 +97,5 @@ stdenv.mkDerivation { " (with patches: " + lib.concatStrings (lib.intersperse ", " (map (x: x.name) kernelPatches)) + ")"); - }; + } // extraMeta; } diff --git a/pkgs/os-specific/linux/zen-kernel/2.6.31-zen0.nix b/pkgs/os-specific/linux/zen-kernel/2.6.31-zen0.nix new file mode 100644 index 000000000000..72d75118fadd --- /dev/null +++ b/pkgs/os-specific/linux/zen-kernel/2.6.31-zen0.nix @@ -0,0 +1,29 @@ +a : +let + s = import ./src-for-2.6.31-zen0.nix; +in +(import ../kernel/generic.nix) (rec { + inherit (a) stdenv fetchurl perl mktemp module_init_tools; + + src = a.builderDefs.fetchGitFromSrcInfo s; + version = "2.6.31-zen0"; + config = "./kernel-config"; + features = { + iwlwifi = true; + zen = true; + }; + + extraMeta = { + maintainers = [ + a.lib.maintainers.raskin + ]; + platforms = with a.lib.platforms; + linux; + }; + + preConfigure = '' + make allmodconfig + + cp .config ${config} + ''; +}) diff --git a/pkgs/os-specific/linux/zen-kernel/src-for-2.6.31-zen0.nix b/pkgs/os-specific/linux/zen-kernel/src-for-2.6.31-zen0.nix new file mode 100644 index 000000000000..3309d91d3805 --- /dev/null +++ b/pkgs/os-specific/linux/zen-kernel/src-for-2.6.31-zen0.nix @@ -0,0 +1,9 @@ +rec { + version="dea7da967ccc58d0fbb4adc7671a1c85f6211da0"; + name="zen-linux-dea7da967ccc58d0fbb4adc7671a1c85f6211da0"; + hash="65ff82897af27b9f01d459f4ec116d5568c971327efa892ae67bd0abf06136b2"; + rev="dea7da967ccc58d0fbb4adc7671a1c85f6211da0"; + url="http://git.zen-sources.org/zen.git"; + + +} diff --git a/pkgs/os-specific/linux/zen-kernel/src-info-for-default.nix b/pkgs/os-specific/linux/zen-kernel/src-info-for-default.nix new file mode 100644 index 000000000000..c06385aac357 --- /dev/null +++ b/pkgs/os-specific/linux/zen-kernel/src-info-for-default.nix @@ -0,0 +1,6 @@ +{ + repoUrl = "http://git.zen-sources.org/zen.git"; + rev = "origin/master"; + baseName = "zen-linux"; + method = "fetchgit"; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5fbe9fe5068b..1c3e52667af6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5310,6 +5310,11 @@ let oldI686 = true; }); + kernel_2_6_31_zen0 = makeOverridable (import ../os-specific/linux/zen-kernel/2.6.31-zen0.nix) { + inherit fetchurl stdenv perl mktemp module_init_tools + lib builderDefs; + }; + /* Kernel modules are inherently tied to a specific kernel. So rather than provide specific instances of those packages for a specific kernel, we have a function that builds those packages