PDA

View Full Version : Boot time is zero on RPi



northpole
2013-04-09, 11:36
Just noticed the Kali on Raspberry Pi doesn't keep time/date and hence cannot calculate boot time.
Output for cat/proc/stat:


#cat /proc/stat
cpu 18409 0 8394 87466 16011 56 105 0 0 0
cpu0 18409 0 8394 87466 16011 56 105 0 0 0
.
..
ctxt 216778
btime 0
.
..


Date is set to the default 1970. Output for date:


#date
Thu Jan 1 05:55:27 IST 1970

The RPi has no internal clock, so unlike other hardware this doesn't store or update clock. The stock OS raspbian has some mechanism to keep time. But I didn't find that in Kali. The 'btime 0' will definitely cause issues to many other apps.

I am not sure if this is global or happening only on my instance. But I suggest including the 'ntpdate' package by default and setting it to update with a server on every boot.