move kernelscripts to nixpkgs

svn path=/nixpkgs/trunk/; revision=4564
This commit is contained in:
Armijn Hemel 2006-01-16 17:12:42 +00:00
parent 43a679bab7
commit 488dc36428
4 changed files with 79 additions and 0 deletions

View File

@ -0,0 +1,15 @@
#! /bin/sh -e
. $stdenv/setup
mkdir $out
mkdir $out/bin
for i in $createModules; do
dst=$out/bin/$(basename $i | cut -c34-)
sed \
-e "s^@coreutils\@^$coreutils^g" \
-e "s^@nix\@^$nix^g" \
< $i > $dst
chmod +x $dst
done

View File

@ -0,0 +1,9 @@
{ stdenv, coreutils, nix}:
derivation {
name = "kernelscripts";
system = stdenv.system;
builder = ./builder.sh;
createModules = ./create-modules.sh;
inherit stdenv coreutils nix;
}

View File

@ -0,0 +1,6 @@
rec {
inherit (import /nixpkgs/trunk/pkgs/system/i686-linux.nix)
stdenv kernel ov511;
everything = [kernel ov511];
}

View File

@ -0,0 +1,49 @@
#! /bin/sh -e
archivesDir=$(mktemp -d)
manifest=${archivesDir}/MANIFEST
nixpkgs=/nixpkgs/trunk/pkgs
fill_disk=$archivesDir/scripts/fill-disk.sh
ramdisk_login=$archivesDir/scripts/ramdisk-login.sh
storePaths=$archivesDir/mystorepaths
validatePaths=$archivesDir/validatepaths
bootiso=/tmp/nixos.iso
initrd=/tmp/initram.img
initdir=${archivesDir}/initdir
initscript=$archivesDir/scripts/init.sh
NIX_CMD_PATH=$(dirname $(which nix-store))
cpwd=`pwd`
storeExpr=$($NIX_CMD_PATH/nix-store -qR $($NIX_CMD_PATH/nix-store -r $(echo '(import ./kernel.nix).everything' | $NIX_CMD_PATH/nix-instantiate -)))
kernel=$($NIX_CMD_PATH/nix-store -r $(echo '(import ./kernel.nix).kernel' | $NIX_CMD_PATH/nix-instantiate -))
ov511=$($NIX_CMD_PATH/nix-store -r $(echo '(import ./kernel.nix).ov511' | $NIX_CMD_PATH/nix-instantiate -))
echo $kernel
echo $ov511
echo making kernel stuff
kernelVersion=$(cd $kernel/lib/modules/; ls -d *)
mkdir -p $archivesDir/lib/modules/$kernelVersion
echo $kernelVersion
cd $kernel
# make directories
find . -not -path "./lib/modules/$kernelVersion/build*" -type d | xargs -n 1 -i% mkdir -p $archivesDir/%
# link all files
find . -not -path "./lib/modules/$kernelVersion/build*" -type f | xargs -n 1 -i% ln -s $kernel/% $archivesDir/%
# make directories
cd $ov511
find . -not -path "./lib/modules/$kernelVersion/build*" -type d | xargs -n 1 -i% mkdir -p $archivesDir/%
# link all files
find . -not -path "./lib/modules/$kernelVersion/build*" -type f | xargs -n 1 -i% ln -s $ov511/% $archivesDir/%