From c2bf8c47bce5693c7596669b2d92a5ed62385709 Mon Sep 17 00:00:00 2001 From: Armijn Hemel Date: Mon, 16 Jan 2006 17:18:43 +0000 Subject: [PATCH] svn path=/nixpkgs/trunk/; revision=4565 --- .../linux/kernelscripts/create-modules.sh | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 pkgs/os-specific/linux/kernelscripts/create-modules.sh diff --git a/pkgs/os-specific/linux/kernelscripts/create-modules.sh b/pkgs/os-specific/linux/kernelscripts/create-modules.sh new file mode 100755 index 000000000000..681587f62dd7 --- /dev/null +++ b/pkgs/os-specific/linux/kernelscripts/create-modules.sh @@ -0,0 +1,36 @@ +#! /bin/sh -e + +#archivesDir=$(@mktemp@/bin/mktemp -d) +archivesDir=/ + +cpwd=@coreutils@/bin/pwd + +storeExpr=$(@nix@/bin/nix-store -qR $(@nix@/bin/nix-store -r $(echo '(import ./kernel.nix).everything' | @nix@/bin/nix-instantiate -))) + +kernel=$(@nix@/bin/nix-store -r $(echo '(import ./kernel.nix).kernel' | @nix@/bin/nix-instantiate -)) + +ov511=$(@nix@/bin/nix-store -r $(echo '(import ./kernel.nix).ov511' | @nix@/bin/nix-instantiate -)) + +#echo making kernel stuff + +kernelVersion=$(cd $kernel/lib/modules/; @coreutils@/bin/ls -d *) +@coreutils@/bin/mkdir -p $archivesDir/lib/modules/$kernelVersion + +#echo $kernelVersion + +cd $kernel + +# make directories + +@findutils@/bin/find . -not -path "./lib/modules/$kernelVersion/build*" -type d | @findutils@/bin/xargs -n 1 -i% @coreutils@/bin/mkdir -p $archivesDir/% + +# link all files +@findutils@/bin/find . -not -path "./lib/modules/$kernelVersion/build*" -type f | @findutils@/bin/xargs -n 1 -i% @coreutils@/bin/ln -s $kernel/% $archivesDir/% + +# make directories + +cd $ov511 +@findutils@/bin/find . -not -path "./lib/modules/$kernelVersion/build*" -type d | @findutils@/bin/xargs -n 1 -i% @coreutils@/bin/mkdir -p $archivesDir/% + +# link all files +@findutils@/bin/find . -not -path "./lib/modules/$kernelVersion/build*" -type f | @findutils@/bin/xargs -n 1 -i% @coreutils@/bin/ln -s $ov511/% $archivesDir/%