move kernelscripts to nixpkgs
svn path=/nixpkgs/trunk/; revision=4564
This commit is contained in:
parent
43a679bab7
commit
488dc36428
15
pkgs/os-specific/linux/kernelscripts/builder.sh
Executable file
15
pkgs/os-specific/linux/kernelscripts/builder.sh
Executable 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
|
9
pkgs/os-specific/linux/kernelscripts/default.nix
Normal file
9
pkgs/os-specific/linux/kernelscripts/default.nix
Normal 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;
|
||||
}
|
6
pkgs/os-specific/linux/kernelscripts/kernel.nix
Normal file
6
pkgs/os-specific/linux/kernelscripts/kernel.nix
Normal file
@ -0,0 +1,6 @@
|
||||
rec {
|
||||
inherit (import /nixpkgs/trunk/pkgs/system/i686-linux.nix)
|
||||
stdenv kernel ov511;
|
||||
|
||||
everything = [kernel ov511];
|
||||
}
|
49
pkgs/os-specific/linux/kernelscripts/make-kernel.sh
Executable file
49
pkgs/os-specific/linux/kernelscripts/make-kernel.sh
Executable 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/%
|
Loading…
Reference in New Issue
Block a user