runInLinuxVM: Set the clock properly
This commit is contained in:
parent
b6d3526c53
commit
f73ff0529e
|
@ -2,7 +2,7 @@
|
||||||
, kernel ? pkgs.linux_3_10
|
, kernel ? pkgs.linux_3_10
|
||||||
, img ? "bzImage"
|
, img ? "bzImage"
|
||||||
, rootModules ?
|
, rootModules ?
|
||||||
[ "virtio_pci" "virtio_blk" "virtio_balloon" "ext4" "unix" "9p" "9pnet_virtio" ]
|
[ "virtio_pci" "virtio_blk" "virtio_balloon" "ext4" "unix" "9p" "9pnet_virtio" "rtc_cmos" ]
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with pkgs;
|
with pkgs;
|
||||||
|
@ -57,6 +57,7 @@ rec {
|
||||||
mknod ${dev}/random c 1 8
|
mknod ${dev}/random c 1 8
|
||||||
mknod ${dev}/urandom c 1 9
|
mknod ${dev}/urandom c 1 9
|
||||||
mknod ${dev}/tty c 5 0
|
mknod ${dev}/tty c 5 0
|
||||||
|
mknod ${dev}/rtc c 254 0
|
||||||
. /sys/class/block/${hd}/uevent
|
. /sys/class/block/${hd}/uevent
|
||||||
mknod ${dev}/${hd} b $MAJOR $MINOR
|
mknod ${dev}/${hd} b $MAJOR $MINOR
|
||||||
'';
|
'';
|
||||||
|
@ -159,6 +160,10 @@ rec {
|
||||||
#! ${bash}/bin/sh
|
#! ${bash}/bin/sh
|
||||||
source /tmp/xchg/saved-env
|
source /tmp/xchg/saved-env
|
||||||
|
|
||||||
|
# Set the system time from the hardware clock. Works around an
|
||||||
|
# apparent KVM > 1.5.2 bug.
|
||||||
|
${pkgs.utillinux}/sbin/hwclock -s
|
||||||
|
|
||||||
export NIX_STORE=/nix/store
|
export NIX_STORE=/nix/store
|
||||||
export NIX_BUILD_TOP=/tmp
|
export NIX_BUILD_TOP=/tmp
|
||||||
export TMPDIR=/tmp
|
export TMPDIR=/tmp
|
||||||
|
|
Loading…
Reference in New Issue