side-effect of initialising the console properly (i.e., enabling Ctrl-[C, Z]). svn path=/nixu/trunk/; revision=801wip/yesman
parent
1f7a8c8ae9
commit
1e87e75d07
@ -1,9 +1,9 @@ |
||||
{stdenv, bash, coreutils, findutils}: |
||||
{stdenv, bash, coreutils, findutils, utillinux, sysvinit, e2fsprogs, nix}: |
||||
|
||||
derivation { |
||||
name = "init"; |
||||
system = stdenv.system; |
||||
builder = ./builder.sh; |
||||
src = ./init.sh; |
||||
inherit stdenv bash coreutils findutils; |
||||
inherit stdenv bash coreutils findutils utillinux sysvinit e2fsprogs nix; |
||||
} |
||||
|
@ -1,14 +1,33 @@ |
||||
#! @bash@/bin/sh -e |
||||
|
||||
export PATH=@bash@/bin:@coreutils@/bin:@findutils@/bin |
||||
trap "echo 'ignoring TERM signal'" SIGTERM |
||||
trap "echo 'ignoring INT signal'" SIGINT |
||||
|
||||
export PATH=@nix@/bin:@bash@/bin:@coreutils@/bin:@findutils@/bin:@utillinux@/bin:@utillinux@/sbin:@sysvinit@/bin:@sysvinit@/sbin:@e2fsprogs@/bin:@e2fsprogs@/sbin |
||||
|
||||
echo "--- Nix ---" |
||||
|
||||
#echo "remounting root..." |
||||
echo "mounting /proc..." |
||||
mount -n -t proc none /proc |
||||
|
||||
echo "checking /dev/root..." |
||||
e2fsck -y /dev/root || test "$?" -le 1 |
||||
|
||||
echo "remounting / writable..." |
||||
mount -n -o remount,rw /dev/root / |
||||
|
||||
echo "mounting /mnt/host..." |
||||
mount -n -t hostfs none /mnt/host |
||||
|
||||
echo "starting root shell..." |
||||
|
||||
@bash@/bin/sh |
||||
|
||||
echo "remounting / read-only..." |
||||
mount -n -o remount,rw /dev/root / || echo "(failed)" # ignore errors |
||||
|
||||
echo "syncing..." |
||||
sync || echo "(failed)" # ignore errors |
||||
|
||||
echo "shutting down..." |
||||
exit 0 |
||||
halt -d -f |
||||
|
@ -1,4 +1,9 @@ |
||||
rec { |
||||
inherit (import pkgs/system/i686-linux.nix) stdenv bash coreutils findutils; |
||||
init = (import ./init) {inherit stdenv bash coreutils findutils;}; |
||||
inherit (import pkgs/system/i686-linux.nix) |
||||
stdenv bash coreutils findutils utillinux sysvinit e2fsprogs nix; |
||||
|
||||
init = (import ./init) |
||||
{inherit stdenv bash coreutils findutils utillinux sysvinit e2fsprogs nix;}; |
||||
|
||||
everything = [init sysvinit]; |
||||
} |
||||
|
Loading…
Reference in new issue