arm linux-----時鍾時區設置


參考資料

https://blog.csdn.net/wavemcu/article/details/29375363

http://www.voidcn.com/article/p-tstodgag-bsb.html

配置方法
  1. 添加timezone文件
    將PC端的/usr/share/zoneinfo整個zoneinfo文件夾復制到ROOTFS的/usr/share下,這樣嵌入式系統中就有了timezone。
root@imx6ul:~# ls /usr/share/zoneinfo/Asia/Shanghai
/usr/share/zoneinfo/Asia/Shanghai
  1. 修改系統UTC 標記為 CST
    UTC=no
root@imx6ul:~# cat /etc/default/rcS 
#
#       Defaults for the boot scripts in /etc/rcS.d
#

# Time files in /tmp are kept in days.
TMPTIME=0
# Set to yes if you want sulogin to be spawned on bootup
SULOGIN=no
# Set to no if you want to be able to login over telnet/rlogin
# before system startup is complete (as soon as inetd is started)
DELAYLOGIN=no
# Assume that the BIOS clock is set to UTC time (recommended)
UTC=no
# Set VERBOSE to "no" if you would like a more quiet bootup.
VERBOSE=no
# Set EDITMOTD to "no" if you don't want /etc/motd to be edited automatically
EDITMOTD=no
# Whether to fsck root on boot
ENABLE_ROOTFS_FSCK=no
# Set FSCKFIX to "yes" if you want to add "-y" to the fsck at startup.
FSCKFIX=yes
# Set TICKADJ to the correct tick value for this specific machine
#TICKADJ=10000
# Enable caching in populate-volatile.sh
VOLATILE_ENABLE_CACHE=yes
# Indicate whether the rootfs is intended to be read-only or not.
# Setting ROOTFS_READ_ONLY to yes and rebooting will give you a read-only rootfs.
# Normally you should not change this value.
ROOTFS_READ_ONLY=no
  1. 系統RTC硬件時鍾注意事項
# hwclock -w  //  默認是指本地時鍾寫入到硬件時鍾
# hwclock -r   //  默認是按照本地時鍾顯示


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM