add some testscripts for generating kernel modules layout. Right now too

much cruft gets symlinked, needs weeding and documenting...lots of
documenting....

svn path=/nixu/trunk/; revision=4501
This commit is contained in:
Armijn Hemel 2006-01-06 15:51:19 +00:00
parent dfa61299fe
commit f20d80957c
4 changed files with 65 additions and 6 deletions

View File

@ -224,7 +224,7 @@ mount --bind /cdrom/nix /nix
echo probing for hardware...
kudzu
#kudzu
export NIX_DATA_DIR=$root/nix/share
export NIX_LOG_DIR=$root/nix/log/nix
@ -232,11 +232,11 @@ export NIX_STATE_DIR=$root/nix/var/nix
export NIX_CONF_DIR=$root/nix/etc
NIX_CMD_PATH=@nix@/bin
echo bringing up networking...
#echo bringing up networking...
nic=`kudzu -p | grep eth | sort | uniq | cut -d ' ' -f 2`
#nic=`kudzu -p | grep eth | sort | uniq | cut -d ' ' -f 2`
echo "NIC: $nic"
#echo "NIC: $nic"
echo initialising Nix DB...
$NIX_CMD_PATH/nix-store --init
@ -309,7 +309,7 @@ echo "127.0.0.1 localhost" >> $root/etc/hosts
echo storing hardware information...
kudzu -p > $root/etc/sysconfig/hwconf
#kudzu -p > $root/etc/sysconfig/hwconf
#cp /etc/modprobe.conf $root/etc/
echo setting up initial account information...

View File

@ -83,7 +83,7 @@ which=$($NIX_CMD_PATH/nix-store -r $(echo '(import ./pkgs.nix).which' | $NIX_CMD
gnutar=$($NIX_CMD_PATH/nix-store -r $(echo '(import ./pkgs.nix).gnutar' | $NIX_CMD_PATH/nix-instantiate -))
eject=$($NIX_CMD_PATH/nix-store -r $(echo '(import ./pkgs.nix).eject' | $NIX_CMD_PATH/nix-instantiate -))
sysklogd=$($NIX_CMD_PATH/nix-store -r $(echo '(import ./pkgs.nix).sysklogd' | $NIX_CMD_PATH/nix-instantiate -))
kudzu=$($NIX_CMD_PATH/nix-store -r $(echo '(import ./pkgs.nix).kudzu' | $NIX_CMD_PATH/nix-instantiate -))
#kudzu=$($NIX_CMD_PATH/nix-store -r $(echo '(import ./pkgs.nix).kudzu' | $NIX_CMD_PATH/nix-instantiate -))
#(while read storepath; do
#cp -fa --parents ${storepath} ${archivesDir}
@ -231,13 +231,17 @@ chmod u+x ${initdir}/ramdisk-login.sh
cp -fau --parents ${bash}/bin ${initdir}
cp -fau --parents ${utilLinux}/bin ${initdir}
chmod -R u+w ${initdir}
echo utilLinux $utilLinux
cp -fau --parents ${utilLinux}/sbin ${initdir}
echo coreutils
cp -fau --parents ${coreutilsdiet}/bin ${initdir}
cp -fau --parents ${e2fsprogs}/bin ${initdir}
chmod -R u+w ${initdir}
echo e2fsprogs
cp -fau --parents ${e2fsprogs}/sbin ${initdir}
cp -fau --parents ${modutils}/bin ${initdir}
chmod -R u+w ${initdir}
echo modutils
cp -fau --parents ${modutils}/sbin ${initdir}
#cp -fau --parents ${hotplug} ${initdir}
#cp -fau --parents ${kudzu} ${initdir}

6
scripts/kernel.nix Normal file
View File

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

49
scripts/make-kernel.sh Executable file
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 $kernel/% $archivesDir/%