From: Sascha Wildner Date: Mon, 26 Nov 2012 18:39:57 +0000 (+0100) Subject: installer: Fix handling of CMOS set to UTC vs. CMOS set to wall time. X-Git-Tag: v3.4.0rc~784 X-Git-Url: https://gitweb.dragonflybsd.org/~tuxillo/dragonfly.git/commitdiff_plain/47572d7e2d970f9ef93bc4203c73b182350d34a7 installer: Fix handling of CMOS set to UTC vs. CMOS set to wall time. It was reversed in the installer (compared to tzsetup(8)). /etc/wall_cmos_clock needs to be created when the CMOS is set to the time of the clock on the wall. While here, also add removing the file in case the user selects 'CMOS set to UTC'. This is if he chose the other setting previously and then tried again. Reported-by: many Dragonfly-bug: Dragonfly-bug: --- diff --git a/usr.sbin/installer/dfuibe_installer/fn_configure.c b/usr.sbin/installer/dfuibe_installer/fn_configure.c index dcb8114484..efacd16c4e 100644 --- a/usr.sbin/installer/dfuibe_installer/fn_configure.c +++ b/usr.sbin/installer/dfuibe_installer/fn_configure.c @@ -769,20 +769,29 @@ fn_set_timezone(struct i_fn_args *a) char *s = NULL; char current_path[256], selection[256], temp[256]; int found_file = 0; + int result; - cmds = commands_new(); - - switch (dfui_be_present_dialog(a->c, _("Local or UTC (Greenwich Mean Time) clock"), + result = dfui_be_present_dialog(a->c, _("Local or UTC (Greenwich Mean Time) clock"), _("Yes|No"), _("Is this machine's CMOS clock set to UTC?\n\n" - "If it is set to local time, or you don't know, please choose NO here!"))) { + "If it is set to local time, or you don't know, please choose NO here!")); + if (result < 1) + abort_backend(); + + cmds = commands_new(); + switch (result) { case 1: - cmds = commands_new(); + command_add(cmds, "%s%s -f %s%setc/wall_cmos_clock", + a->os_root, cmd_name(a, "RM"), + a->os_root, a->cfg_root); + break; + case 2: command_add(cmds, "%s%s %s%setc/wall_cmos_clock", a->os_root, cmd_name(a, "TOUCH"), a->os_root, a->cfg_root); - commands_execute(a, cmds); + break; } + commands_execute(a, cmds); snprintf(current_path, 256, "%s%susr/share/zoneinfo", a->os_root, a->cfg_root);