1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-26 15:41:40 +00:00
nixpkgs/pkgs/os-specific/linux/kernelscripts/builder.sh
Armijn Hemel 6aca0d8f9d more fixes
svn path=/nixpkgs/trunk/; revision=5985
2006-07-28 13:29:33 +00:00

35 lines
881 B
Bash
Executable file

source $stdenv/setup
export MODULE_DIR=$out/lib/modules/
kernelVersion=$(cd $kernel/lib/modules/; ls -d *)
mkdir -p $out/lib/modules/$kernelVersion
cd $kernel
echo making kernel directories
find . -not -path "./lib/modules/$kernelVersion/build*" -type d | xargs -n 1 -i% mkdir -p $out/%
echo symlinking kernel modules
find . -not -path "./lib/modules/$kernelVersion/build*" -a -not -path \
"./System*" -a -not -path "./vmlinuz*" -type f | xargs -n 1 -i% \
ln -s $kernel/% $out/%
echo $modules
for i in $modules; do
echo making directories for $i
cd $i
find . -not -path "./lib/modules/$kernelVersion/build*" -type d | xargs -n 1 -i% mkdir -p $out/%
echo symlinking modules for $i
find . -not -path "./lib/modules/$kernelVersion/build*" -type f | xargs -n 1 -i% ln -s $i/% $out/%
done
echo running depmod
$module_init_tools/sbin/depmod -ae $kernelVersion