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:
parent
dfa61299fe
commit
f20d80957c
10
fill-disk.sh
10
fill-disk.sh
@ -224,7 +224,7 @@ mount --bind /cdrom/nix /nix
|
|||||||
|
|
||||||
echo probing for hardware...
|
echo probing for hardware...
|
||||||
|
|
||||||
kudzu
|
#kudzu
|
||||||
|
|
||||||
export NIX_DATA_DIR=$root/nix/share
|
export NIX_DATA_DIR=$root/nix/share
|
||||||
export NIX_LOG_DIR=$root/nix/log/nix
|
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
|
export NIX_CONF_DIR=$root/nix/etc
|
||||||
NIX_CMD_PATH=@nix@/bin
|
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...
|
echo initialising Nix DB...
|
||||||
$NIX_CMD_PATH/nix-store --init
|
$NIX_CMD_PATH/nix-store --init
|
||||||
@ -309,7 +309,7 @@ echo "127.0.0.1 localhost" >> $root/etc/hosts
|
|||||||
|
|
||||||
echo storing hardware information...
|
echo storing hardware information...
|
||||||
|
|
||||||
kudzu -p > $root/etc/sysconfig/hwconf
|
#kudzu -p > $root/etc/sysconfig/hwconf
|
||||||
#cp /etc/modprobe.conf $root/etc/
|
#cp /etc/modprobe.conf $root/etc/
|
||||||
|
|
||||||
echo setting up initial account information...
|
echo setting up initial account information...
|
||||||
|
@ -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 -))
|
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 -))
|
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 -))
|
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
|
#(while read storepath; do
|
||||||
#cp -fa --parents ${storepath} ${archivesDir}
|
#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 ${bash}/bin ${initdir}
|
||||||
cp -fau --parents ${utilLinux}/bin ${initdir}
|
cp -fau --parents ${utilLinux}/bin ${initdir}
|
||||||
chmod -R u+w ${initdir}
|
chmod -R u+w ${initdir}
|
||||||
|
echo utilLinux $utilLinux
|
||||||
cp -fau --parents ${utilLinux}/sbin ${initdir}
|
cp -fau --parents ${utilLinux}/sbin ${initdir}
|
||||||
|
echo coreutils
|
||||||
cp -fau --parents ${coreutilsdiet}/bin ${initdir}
|
cp -fau --parents ${coreutilsdiet}/bin ${initdir}
|
||||||
cp -fau --parents ${e2fsprogs}/bin ${initdir}
|
cp -fau --parents ${e2fsprogs}/bin ${initdir}
|
||||||
chmod -R u+w ${initdir}
|
chmod -R u+w ${initdir}
|
||||||
|
echo e2fsprogs
|
||||||
cp -fau --parents ${e2fsprogs}/sbin ${initdir}
|
cp -fau --parents ${e2fsprogs}/sbin ${initdir}
|
||||||
cp -fau --parents ${modutils}/bin ${initdir}
|
cp -fau --parents ${modutils}/bin ${initdir}
|
||||||
chmod -R u+w ${initdir}
|
chmod -R u+w ${initdir}
|
||||||
|
echo modutils
|
||||||
cp -fau --parents ${modutils}/sbin ${initdir}
|
cp -fau --parents ${modutils}/sbin ${initdir}
|
||||||
#cp -fau --parents ${hotplug} ${initdir}
|
#cp -fau --parents ${hotplug} ${initdir}
|
||||||
#cp -fau --parents ${kudzu} ${initdir}
|
#cp -fau --parents ${kudzu} ${initdir}
|
||||||
|
6
scripts/kernel.nix
Normal file
6
scripts/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
scripts/make-kernel.sh
Executable file
49
scripts/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 $kernel/% $archivesDir/%
|
Loading…
x
Reference in New Issue
Block a user