aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/tzsetup
Commit message (Collapse)AuthorAgeFilesLines
* tzsetup: correct timezone symlink targetEd Maste2024-09-301-2/+2
| | | | | | | | | | | | | In chroot mode tzsetup prepended the chroot path to the symlink target, which is not correct. Use the same path for the symlink regardless of chroot mode. PR: 281332 Reported by: scf, Herbert J. Skuhra Reviewed by: olce Fixes: 5e16809c953f ("tzsetup: symlink /etc/localtime instead of co...") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46725
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* Revert "tzsetup: ask local/UTC question only on x86"Ed Maste2024-06-172-16/+10
| | | | | | | | | I am unsure if AArch64 Windows systems keep UTC or local time in the RTC by default, so keep tzsetup consistent across architectures for now. This reverts commit aa6fb1d277be47c51abc309ac9305def0fce7f9d. Reported by: Mark Millard
* tzsetup: ask local/UTC question only on x86Ed Maste2024-06-142-11/+17
| | | | | | | | | | | Storing local time in the RTC is a legacy of 1990s PCs; it's not relevant on other platforms of interest to FreeBSD. While here switch to C99 bool. Sponsored by: The FreeBSD Foundation Reviewed by: allanjude (earlier), imp (earlier) Differential Revision: https://reviews.freebsd.org/D45575
* tzsetup: add detail for -s optionEd Maste2024-06-141-1/+5
| | | | | | | | | | Skipping the UTC question via -s will not create or delete /etc/wall_cmos_clock. Reported by: Tomoaki AOKI Reviewed by: imp, allanjude, jrm Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45576
* tzsetup: Correct UTC descriptionEd Maste2024-06-131-1/+1
| | | | | | | | | UTC is Coordinated Universal Time, not Greenwich Mean Time. Reviewed by: imp, allanjude MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45573
* tzsetup: be explicit about *timezone* abbreviationEd Maste2024-04-161-1/+1
| | | | | | | | | | | | | | | | During the install process tzsetup asks a question like Does the abbreviation `EDT' look reasonable? The installer asks lots of questions, some that relate to the previous screen or topic and some that do not. A new user installed FreeBSD for the first time and was confused by this question, not realizing that it was asking whether the abbreviation is correct for the selected timezone. Reviewed by: bapt, brooks, imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D44500
* tzsetup: symlink /etc/localtime instead of copyingEd Maste2023-11-242-94/+27
| | | | | | | | | Using a symlink means that new timezone data (installed by an errata update, say) will be usable without having to be copied again. Reviewed by: bapt, kevans, philip Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37005
* tzsetup: make UTC the first (default) regionBrooks Davis2023-10-301-3/+3
| | | | | | | | | | | | | Many sysadmins prefer to configure their systems to UTC and it's a reasonable default when installing, making it easier to get a usable system by just hitting <return> repeatidly. Renumber UTC to 0 to preserve the finger memory of those selecting a region by shortcut. Reviewed by: jrtc27, emaste Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D42383
* tzsetup: add support for countries in two continentsPierre Pronchery2023-10-131-6/+61
| | | | | | | | | This supports countries located across multiple continents, as per the zone1970.tab file. This only affects Cyprus and Türkiye at the moment. PR: 236874 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41306
* Remove $FreeBSD$: two-line nroff patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-162-2/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* tzsetup: fix "misleading indentation" warning with -DVERBOSEYuri Pankov2023-07-261-1/+1
|
* tzsetup: appease checkstyle9Yuri Pankov2023-04-271-2/+2
|
* tzsetup: adopt zone1970.tab changesYuri Pankov2023-04-272-163/+167
| | | | | | | | | | | | | | | | | | | - assumption that single-zone countries do not have description is no longer correct; do not try to optimize this case as it's only going to make the code more confusing and we now have menus with a single zone selection because of this - remove the single-country continent short cut, it also only serves to confuse users as we now have such a continent - instead add a single-zone contry short cut (see above), now all single-zone countries fall here - use the #@ continent overrides that zone1970.tab introduces (this is visible at least fixing Iceland being currently listed under Africa) - add Arctic Ocean "continent" coming only from the overrides at the moment - update baseline with the changes Reviewed by: bapt, philip Differential Revision: https://reviews.freebsd.org/D39606
* tzsetup: fix bootstrapping for github CI jobsYuri Pankov2023-04-261-21/+21
| | | | | Move dump_zonetab() under HAVE_BSDDIALOG as the parsing code it relies on already is.
* tzsetup: add baseline file to control parsed zonetab contentsYuri Pankov2023-04-233-2/+727
| | | | | | | | Introduce undocumented option -d to dump parsed zonetab file contents and add a "baseline" target along with instructions on updating it. Reviewed by: philip Differential Revision: https://reviews.freebsd.org/D39634
* tzsetup(8): update paths to zone tab and tzdata sourceYuri Pankov2023-04-191-28/+22
| | | | | | | | | | | tzsetup now uses zone1970.tab and zoneinfo source is located in contrib/tzdata, update the man page accordingly. While here, drop obsolete Tn macros and insert vertical breaks (mostly before Dl in examples) to improve readability. Reviewed by: pauamma_gundo.com (manpages) Differential Revision: https://reviews.freebsd.org/D39643
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-191-1/+1
|
* tzsetup: remove left overs from libbsddialog conversionBaptiste Daroussin2022-08-261-10/+0
| | | | PR: 265954
* tzsetup(8): Refactoring to delete dialog(3) codeAlfonso S. Siciliano2022-04-111-103/+38
| | | | | | | | | | | | | | | Little refactoring to complete the conversion to bsddialog(3), not functional changes: * Delete: remaining code for autosizing using BSDDIALOG_AUTOSIZE. * Add: constants to delete magical numbers and to avoid unclear returned values. * Delete: redundant 'conf.button.default_cancel=false', performed by bsddialog_initconf(). * Add: a new function message_zoneinfo_file() to merge features. Approved by: bapt (mentor) Differential Revision: https://reviews.freebsd.org/D34862
* bsddialog: import version 0.1Alfonso Siciliano2022-01-281-6/+5
| | | | | | | | | | | | | | | Import bsddialog 0.1 Utility and Library, fully refatorized, API stable, manuals completed, easier to maintain and improve. Update deps for new API: add mixedgauge consts, delete __DECONST and add bsddialog_geterror() info to avoid silent errors * tzsetup * kbdmap * distextract Differential Revision: https://reviews.freebsd.org/D34066
* tzsetup: Fix unicode supportAlfonso Siciliano2021-12-171-0/+5
| | | | Differential revision: https://reviews.freebsd.org/D33532
* tzsetup: adapt for libbsddialog 0.0.1Alfonso Siciliano2021-12-131-57/+6
| | | | | | | | | | | libbsdialog 0.0.1 provides: * bsddialog_conf.auto_minwidth: * menurows is variable with autosize (properly defines max menurows) Then tzsetup can use BSDDIALOG_AUTOSIZE keeping the dialog behavior: min 24 cols, max 16 menurows Differential revision: https://reviews.freebsd.org/D33397
* tzsetup: Default to UTCEmmanuel Vadot2021-12-081-2/+1
| | | | | | | | | | Restore old behavior. Fixes: f872dde34c ("tzsetup: replace libdialog with libbsddialog") Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D33334 Sponsored by: Beckhoff Automation GmbH & Co. KG
* bsddialog: import snapshot 2021-12-05Baptiste Daroussin2021-12-061-13/+13
|
* tzsetup: remove dedundant declarationBaptiste Daroussin2021-11-241-1/+1
|
* tzsetup: replace libdialog with libbsddialogBaptiste Daroussin2021-11-242-96/+99
| | | | | Reviewed by: alfix86_gmail.com (bsddialog author) Differential Revision: https://reviews.freebsd.org/D33077
* ncurses: chase dependency changes in the source treeBaptiste Daroussin2021-10-041-1/+1
| | | | Differential Revision: https://reviews.freebsd.org/D32098
* Don't link against libdialog/ncurses when bootstrapping tzsetupAlex Richardson2020-08-071-1/+1
| | | | Notes: svn path=/head/; revision=364025
* Remove sparc64 ifdefWarner Losh2020-02-101-2/+0
| | | | | | | | | | | Now we default to setting the hardware clock to UTC everywhere. sparc64 was the old odd-man out before. Reivewed by: cy@, bcr@ Differential Revision: https://reviews.freebsd.org/D23593 Notes: svn path=/head/; revision=357735
* Update Makefile.depend filesSimon J. Gerraty2019-12-111-3/+0
| | | | | | | | | | | | | Update a bunch of Makefile.depend files as a result of adding Makefile.depend.options files Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22494 Notes: svn path=/head/; revision=355617
* Add Makefile.depend.optionsSimon J. Gerraty2019-12-111-0/+10
| | | | | | | | | | | | | | | | | | | | Leaf directories that have dependencies impacted by options need a Makefile.depend.options file to avoid churn in Makefile.depend DIRDEPS for cases such as OPENSSL, TCP_WRAPPERS etc can be set in local.dirdeps-options.mk which can add to those set in Makefile.depend.options See share/mk/dirdeps-options.mk Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22469 Notes: svn path=/head/; revision=355616
* tzsetup: upgrade to zone1970.tabThomas Munro2019-07-171-18/+19
| | | | | | | | | | | | | | zone.tab is deprecated. Install zone1970.tab alongside it, and use it for tzsetup(8). This is also useful for other applications that need the modern better maintained file. Reviewed by: philip Approved by: allanjude (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20646 Notes: svn path=/head/; revision=350079
* In read_zones(), check if the file name actually fit in the bufferXin LI2018-08-091-3/+7
| | | | | | | | | | | and make sure it would terminate with nul with strlcpy(). Reviewed by: imp (earlier revision) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D16595 Notes: svn path=/head/; revision=337522
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Revert the parts of r322097 related to /etc/wall_cmos_clock handling asMarius Strobl2017-08-071-44/+14
| | | | | | | | | | the previous behavior actually is required for setting up configurations in which the RTC is using UTC but the timezone is not. Still, besides uniform error handling, that file should get the same treatment in the non-interactive variants supported by tzsetup(8). Notes: svn path=/head/; revision=322203
* - Move creation and unlinking of /etc/wall_cmos_clock from the handlingMarius Strobl2017-08-051-70/+54
| | | | | | | | | | | | | | | | | | | | | of the initial UTC dialog to install_zoneinfo() so that file gets the necessary treatment also when that dialog is skipped via "-s", when selecting UTC from the time zone menu or on the command-line instead etc. - Make the initial UTC dialog actually work by giving the relevant files the necessary treatment and then exit when choosing "Yes" there instead of moving on to the time zone menu regardless. - Since r301131, /etc/localtime is also installed when selecting UTC in interactive configurations (which previously meant only via the time zone menu, though). Thus, the code added in r230298 which treats a NULL zone file name as UTC and removes /etc/localtime in that case can go again. - Consistently refer to "could not delete" (as chosen by the oldest such code in here) when unlink(2) fails instead of a to mixture of "delete" and "unlink" in error messages. Notes: svn path=/head/; revision=322097
* Use SRCTOP-relative paths to other directories instead of .CURDIR-relative onesEnji Cooper2017-03-011-1/+1
| | | | | | | | | | This simplifies pathing in make/displayed output. MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=314463
* Fix build of tzsetup when WITHOUT_DIALOG is setBaptiste Daroussin2016-10-222-58/+104
| | | | | | | | | | | | | | Hide dialog specific code behind HAVE_DIALOG. It allows to build a stripped down version (missing the dialog UI) but perfectly function tzsetup when world is built WITHOUT_DIALOG Reorganise a bit the code to limit the number of blocks under HAVE_DIALOG Reviewed by: emaste Sponsored by: https://reviews.freebsd.org/D8325 Notes: svn path=/head/; revision=307802
* Fix tzsetup not installing /etc/localtime for UTCSteven Hartland2016-06-011-2/+3
| | | | | | | | | | | | | | | | | | | | | | If tzsetup UTC is run then it successfully configured the system for UTC including installing /etc/localtime however if the user ran just tzsetup for interactive configuration and select UTC no /etc/localtime was installed which resulted in failures for utilities which require said file. Change set_zone_utc to call install_zoneinfo("UTC") to ensure that /etc/localtime is created for interactive UTC selection. Users who have previously run tzsetup in interactive mode and select UTC can install the missing /etc/localtime by running tzsetup -r. Also correct static miss-match for set_zone_utc. MFC after: 2 weeks Relnotes: Yes Sponsored by: Multiplay Notes: svn path=/head/; revision=301131
* Avoid buffer overflow or truncation when constructing path_zoneinfo_file.Don Lewis2016-05-261-1/+3
| | | | | | | | | Reported by: Coverity CID: 1011160 MFC after: 1 week Notes: svn path=/head/; revision=300706
* Use NULL instead of 0 for pointers.Marcelo Araujo2016-04-151-8/+8
| | | | | | | | | | | | fgetln(3) will returns NULL if cannot get a line from a stream. strsep(3) it will returns NULL if the end of the string was reached. jemalloc(3) malloc will returns NULL if it cannot allocate memory. fgetln(3) it will returns NULL if it cannot get a line from a stream. MFC after: 4 weeks Notes: svn path=/head/; revision=298033
* Revert r289269 for now. After looking at share/zoneinfo/Makefile this couldXin LI2015-10-271-11/+15
| | | | | | | | potentially break non-root installs and we need a better solution, probably by doing it differently when no UI is involved. Notes: svn path=/head/; revision=290031
* Use chroot(2) instead of using prefixes for files.Xin LI2015-10-131-15/+11
| | | | | | | | | | | | | | | | Previously, the code prefixes the chroot path to actual file paths to simulate the effect. This, however, will not work for tzset(3) which expects the current system have a working set of timezone data files, and that is not always the case. This changeset simplifies the handling of paths and use an actual chroot(2) call to implement the effect. PR: bin/197313 MFC after: 2 weeks Notes: svn path=/head/; revision=289269
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+21
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge sync of headSimon J. Gerraty2015-05-272-4/+3
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Merge from head@274682Simon J. Gerraty2014-11-191-0/+9
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=274683