Recommended by: cperciva
Reviewed by: cperciva
Relnotes: tzsetup and bsdconfig now assume that the "hardware" clock inside a VM is set to UTC
REALLYDOIT=1
REINSTALL=
USEDIALOG=1
-SKIPUTC=
+SKIPUTC= # See MAIN
VERBOSE=
TZ_OR_FAIL=
CHROOTENV=
############################################################ MAIN
+# Skip initial question regarding UTC v. Wall-Clock time if run in VM
+[ "$( sysctl -n kern.vm_guest 2> /dev/null )" = "none" ] || SKIPUTC=1
+
# Incorporate rc-file if it exists
[ -f "$HOME/.bsdconfigrc" ] && f_include "$HOME/.bsdconfigrc"
#include <sys/param.h>
#include <sys/queue.h>
#include <sys/stat.h>
+#include <sys/sysctl.h>
#include <dialog.h>
{
char title[64], prompt[128];
int c, fd, rv, skiputc;
+ char vm_guest[16] = "";
+ size_t len = sizeof(vm_guest);
skiputc = 0;
+
+ /* Default skiputc to 1 for VM guests */
+ if (sysctlbyname("kern.vm_guest", vm_guest, &len, NULL, 0) == 0 &&
+ strcmp(vm_guest, "none") != 0)
+ skiputc = 1;
+
while ((c = getopt(argc, argv, "C:nrs")) != -1) {
switch(c) {
case 'C':