about summary refs log tree commit diff
path: root/pkgs/os-specific/linux/kernel/randstruct-provide-seed.patch
blob: 1328b9cee3c95b082470496e4a07455292006cbe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
diff -ru a/scripts/gcc-plugins/gen-random-seed.sh b/scripts/gcc-plugins/gen-random-seed.sh
--- a/scripts/gcc-plugins/gen-random-seed.sh	2019-01-11 11:50:29.228258920 +0100
+++ b/scripts/gcc-plugins/gen-random-seed.sh	2019-01-11 12:18:33.555902720 +0100
@@ -2,7 +2,7 @@
 # SPDX-License-Identifier: GPL-2.0
 
 if [ ! -f "$1" ]; then
-	SEED=`od -A n -t x8 -N 32 /dev/urandom | tr -d ' \n'`
+	SEED="NIXOS_RANDSTRUCT_SEED"
 	echo "const char *randstruct_seed = \"$SEED\";" > "$1"
 	HASH=`echo -n "$SEED" | sha256sum | cut -d" " -f1 | tr -d ' \n'`
 	echo "#define RANDSTRUCT_HASHED_SEED \"$HASH\"" > "$2"